ural 1494 Monobilliards
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int a[],b[];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
for(int i=; i<=n; i++)
scanf("%d",a+i);
int top=,top1=;
for(int i=; i<=n; i++)
{
b[++top]=i;
while(top&&b[top]==a[top1]){
top--;top1++;
}
}
if(top) printf("Cheater\n");
else printf("Not a proof\n");
}
return ;
}
ural 1494 Monobilliards的更多相关文章
- 1494. Monobilliards(栈)
1494 之前记得数据结构试卷上有这种题 就是判断某一出栈顺序 是不是满足以1.2...n为入栈顺序 a1,a2,a3..an; 对于任意相邻a[i],a[i+1] 如果a[i]>a[i+1]+ ...
- 【BZOJ 1494】【NOI 2007】生成树计数
http://www.lydsy.com/JudgeOnline/problem.php?id=1494 这道题..因为k很小,而且我们只关心连续的k个节点的连通性,所以把连续的k个点轮廓线上的连通性 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
随机推荐
- Back to Basics: Using KVO
One of the things I like most about Apple’s iOS SDK is the consistent and easy-to-use API they provi ...
- php开启错误提示
1.在php.ini文件里加上下面两句 display_errors = Onerror_reporting = E_ALL | E_STRICT 2.在Apache的 httpd.conf文件里加上 ...
- java笔记7之录入
1 为了让程序的数据更符合开发的数据,我们就加入了键盘录入. 让程序更灵活一下. 那么,我们如何实现键盘数据的录入呢? A:导包 格式: ...
- DBParameter比拼接字符串慢的解决办法
List<DBParameter> param = new List<DBParameter>(){ new DBParameter("@Question ...
- 数据迁移sql
1.把数据库test中的表Table1中的数据插入到数据库test2中的表Table2:insert into test2.Table2(a,c,d) select a,c,5 from test.T ...
- linux if 判断字符串是否相等
在命令行中修改时间: 如果linux系统时间等于2017-09-09,则ok:否则将当前系统时间修改为2017-09-09 var=`date '+%Y-%m-%d'`;if [ "$var ...
- Unity3D Asset stored 已下载的位置
Unity3D Asset stored下载资源在本地的什么目录里呢?C:\Users\accountName\AppData\Roaming\Unity\Asset Store
- Java基础知识强化79:被遗忘的Java Math类
1. Math类概述 Math类包含用于执行基本数学运算的方法,如初等指数.对数.平方根和三角函数. 2. 成员变量 和 成员方法(常用的) (1)成员变量 public static final d ...
- 与useradd命令相关的两个默认配置文件
Configuration Files for User Management Defaults When working with tools as useradd, some defaul ...
- Android学习手记(5) 基本UI布局
1.View和ViewGroup Activity是Android应用程序的基本管理单元,Android的每一个窗口都是通过一个Activity来定义的,但是Activity并不能直接用来显示窗口.我 ...