例题 6-2 Rails Uva514(此处是poj1363的代码)
来源:互联网 发布:数据架构师 编辑:程序博客网 时间:2024/06/16 09:17
#include <iostream>#include <stack>#include <string.h>#include <cstdio>using namespace std;const int AX = 1e3+66;int a[AX];int main(){int n;while( scanf("%d",&n) && n ){while( scanf("%d",&a[1]) ){if( a[1] == 0 ) { cout << endl ; break;}stack<int>s;for( int i = 2 ; i <= n ; i++ ){scanf("%d",&a[i]);}int num = 1;for( int i = 1 ; i <= n ; i++ ){s.push(i);while( !s.empty() && s.top() == a[num] ){s.pop();num ++ ;}}cout << ( ( num == n+1 ) ? "Yes" : "No" ) << endl;memset(a,0,sizeof(a));}}return 0;}
阅读全文
0 0
- 例题 6-2 Rails Uva514(此处是poj1363的代码)
- UVa514 Rails(铁轨)
- UVA514 - Rails(栈)
- 铁轨(Rails) UVa514
- UVA514 Rails(栈)
- UVA514 Rails (stack)
- Rails(UVa514)(栈)
- Uva514-Rails(基本栈)
- poj1363 Rails(栈的应用)
- UVA514-Rails
- UVa514 Rails
- Rails uva514
- Uva514-Rails
- POJ1363:Rails
- UVa514-Rails-铁轨--栈的使用
- 铁轨Rails UVA514(stack运用)
- poj1363--Rails解题报告(c++版)
- UVA514 Rails(铁轨)
- Raspberry Pi 的應用
- python实战游戏开发——驾驶飞船
- 例题6-1 双端队列 uva210
- 复合类型的字节对齐
- PlayerPrefs 的用法
- 例题 6-2 Rails Uva514(此处是poj1363的代码)
- Java方法参数
- IO流及集合框架结构图
- Qt界面美化2
- 大整数加法
- 编程,更多?更好?更快?
- hadoop起动后没有datanode的问题
- Qt界面美化3
- Qt界面美化4