Ural_1494. Monobilliards(栈)
2011-12-03 19:31
309 查看
题意看了老半天,就是说给一个序列[1, n],看是否是(1, 2, 3, ... n),入栈以后出栈时可以得到的序列。
My Code:
View Code
My Code:
View Code
#include <iostream> #include <cstdio> using namespace std; const int N = 100007; int st1 , st2 ; int main() { //freopen("data.in", "r", stdin); int i, top1, top2, n; while(cin >> n) { for(i = 0; i < n; i++) { cin >> st2[i]; } top1 = 0; top2 = 0; for(i = 1; i <= n; i++) { st1[++top1] = i; while(top1 != 0 && st1[top1] == st2[top2]) { --top1; ++top2; } } if(top1) cout << "Cheater"; else cout << "Not a proof"; cout << endl; } return 0; }
相关文章推荐
- URAL 1494 Monobilliards (栈)
- Ural 1494. Monobilliards
- 1494. Monobilliards(栈)
- ural 1494 Monobilliards
- Monobilliards
- 1031. Railway Tickets(URAL 1031 )
- [Unity Tips]在脚本中使用MonoBehavior.OnAnimatorMove()和StateMachineBehavior.OnStateMove()改变根运动
- Mono on CentOS 6.3 安装笔记
- ural1090 逆序对(归并排序和树状数组)
- 为什么要使用MONO
- Mono的新解释器
- URAL 1957 Wrong Answer 暴力
- 使用Mono让.NET程序跨平台运行
- ural 1203. Scientific Conference(dp)给定N个区间,求最大的不相交的区间数
- 【BZOJ1814】Ural 1519 Formula 1 插头DP
- URAL 1382 Game with Cards
- URAL - 1081 Binary Lexicographic Sequence (DP)
- Ural 1023. Buttons
- 根据牛腩老师的mono for android 视频,用xamarin for android 写的一个简单程序范例
- ural 1024. Permutations (置换群)