POJ 3617 (贪心)
来源:互联网 发布:linux挂起是什么意思 编辑:程序博客网 时间:2024/05/14 05:58
题目地址:http://poj.org/problem?id=3617
AC代码:
#include <cstdio>char s[2002], tmp[2];int n;int main(){ while(~scanf("%d", &n)) { for(int i=0;i<n;i++) { scanf("%s", tmp); s[i] = tmp[0]; } int l = 0, r = n - 1, cnt = 0; while(l <= r) { int i = 0, left = true; while(l + i <= r - i) { if(s[l+i] < s[r-i]) { break; } if(s[l+i] > s[r-i]) { left = false; break; } i ++; } if(left == true) putchar(s[l++]); else putchar(s[r--]); cnt ++; if(cnt % 80 == 0) putchar('\n'); } } return 0;}
0 0
- POJ 3617 (贪心)
- POJ 3617(贪心)
- POJ 3617 - Best Cow Line(贪心)
- poj 3617 Best Cow Line(贪心)
- POJ 3617 Best Cow Line(贪心)
- POJ 3617 Best Cow Line (贪心)
- POJ 3617 Best Cow Line (贪心)
- POJ 3617 Best Cow Line(贪心)
- POJ 3617 Best Cow Line(贪心)
- poj 3617 Best Cow Line(贪心)
- poj 3617 贪心
- poj 3617贪心
- POJ 3617 贪心
- POJ 3617 (贪心)
- POJ 3617 3069 贪心
- poj 3617 贪心
- POJ 1328(贪心)
- POJ 1818(贪心)
- ubuntu永久修改主机名
- 1009. Product of Polynomials (25)
- 旁观者
- Middle-题目93:60. Permutation Sequence
- KTV点歌系统数据库设计文档
- POJ 3617 (贪心)
- SQL的定义与使用
- 1087. All Roads Lead to Rome (30) PAT
- 【Tesseract】Tesseract API在VS 2013中的配置以及调用
- C#中的多文档界面与多窗体界面
- 一些可能有用的网址
- seaborn
- php curl get和post
- JS for与for in对比(包含性能测试)