外贸网站做的作用是什么,TP框架网站的中英文切换怎么做,网站一般在哪里找,免费站推广网站不用下载题意#xff1a;给定长度为N的字符串S#xff0c;现要构造一个字符串T#xff08;起初为空串#xff09;。任意进行一下的一种操作#xff1a; 1从S的头部删除一个字符#xff0c;加到T的尾部 2从S的尾部删除一个字符#xff0c;加到T的尾部 目的使T的字典序最小… 题意给定长度为N的字符串S现要构造一个字符串T起初为空串。任意进行一下的一种操作 1从S的头部删除一个字符加到T的尾部 2从S的尾部删除一个字符加到T的尾部 目的使T的字典序最小。每80个字母一行 注意当首尾俩个数相同时我们应比较里面的俩个次首和次尾 1 #include cstdio2 #include cstring3 #include cstdlib4 #include cctype5 #include cmath6 #include time.h7 #include string8 #include map9 #include stack
10 #include set
11 #include queue
12 #include vector
13 #include algorithm
14 #include iostream
15 using namespace std;
16 typedef long long ll;
17 typedef pairint,int P;
18 #define PI acos( -1.0 )
19 const double E 1e-8;
20
21 const int NO 2000 5;
22 char ch[NO];
23 int n;
24
25 void Solve()
26 {
27 int x 0, y n - 1;
28 int t 0;
29 while( x y )
30 {
31 bool flag false;
32 for( int i 0; i n; i )
33 if( ch[xi] ch[y-i] ) {
34 flag false;
35 break;
36 }
37 else if( ch[xi] ch[y-i] ) {
38 flag true;
39 break;
40 }
41 t;
42 if( flag ) putchar( ch[x] );
43 else putchar( ch[y--] );
44 if( t % 80 0 )
45 putchar( \n );
46 }
47 if( t % 80 )
48 puts( );
49 }
50
51 int main()
52 {
53 scanf( %d, n );
54 for( int i 0; i n; i )
55 {
56 getchar();
57 ch[i] getchar();
58 }
59 Solve();
60 return 0;
61 } View Code 转载于:https://www.cnblogs.com/ADAN1024225605/p/4087902.html