POJ3617
来源:互联网 发布:金钻淘宝店有哪些 编辑:程序博客网 时间:2024/06/14 12:42
#include<cstdio>#include<iostream>using namespace std;const int maxn = 2000 + 5;int N;char S[maxn];void solve() { bool left = false; int x = 0; int y = N - 1; int cnt = 0; while (x <= y) { bool left = false; for (int i = 0; x + i < y; i++) { if (S[x + i] < S[y - i]) { left = true; break; } else if (S[x + i] > S[y - i]) { left = false; break; } } if (left) putchar(S[x++]); else putchar(S[y--]); cnt++; if(cnt == 80){ putchar('\n'); cnt = 0; } }}int main() { while (scanf("%d", &N) == 1) { getchar(); for (int i = 0; i < N; i++) { scanf("%c", &S[i]); getchar(); } solve(); } return 0;}
阅读全文
0 0
- poj3617
- poj3617
- poj3617
- poj3617
- poj3617
- POJ3617
- POJ3617
- 贪心--poj3617
- poj3617题解
- poj3617 贪心
- poj3617贪心
- poj3617 贪心
- poj3617【贪心】
- POJ3617 Best Cow Line
- POJ3617 Best Cow Line
- POJ3617 Best Cow Line
- best cow line(poj3617)
- POJ3617 字符串问题
- 【重磅推荐】34张史上最全IT架构师技术知识图谱
- 关于java中the jar file C:\program files\java\jar7\lib\rt.jar has no ...
- 收获,不止SQL优化——抓住SQL的本质--第十章
- 程序,进程,线程(任务)
- 搭建ftp服务器
- POJ3617
- python协程与异步I/O
- leetcode 26. Remove Duplicates from Sorted Array
- mysql-jdbc 6.0 serverTimezone参数详解
- 抓取360图片
- Java基础总结---IO流
- 俄国资安服务商发现可关闭英特尔管理引擎的方式
- VMware共享文件夹
- Python3之阻塞I/O,非阻塞I/O及I/O多路复用