ural1494 Monobilliards
Monobilliards
Memory limit: 64 MB
Input
Output
Samples
input | output |
---|---|
2 |
Not a proof |
3 |
Cheater |
Notes
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
const int maxn=1e5+;
const int dis[][]={{,},{-,},{,-},{,}};
using namespace std;
ll gcd(ll p,ll q){return q==?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=;while(q){if(q&)f=f*p;p=p*p;q>>=;}return f;}
int n,m,k,t,now;
bool flag;
priority_queue<int>a;
int main()
{
int i,j;
now=;
scanf("%d",&n);
while(n--)
{
scanf("%d",&j);
while(now<=j)a.push(now),now++;
if(a.top()!=j)flag=true;
else a.pop();
}
if(flag)puts("Cheater");
else puts("Not a proof");
//system("pause");
return ;
}
ural1494 Monobilliards的更多相关文章
- 1494. Monobilliards(栈)
1494 之前记得数据结构试卷上有这种题 就是判断某一出栈顺序 是不是满足以1.2...n为入栈顺序 a1,a2,a3..an; 对于任意相邻a[i],a[i+1] 如果a[i]>a[i+1]+ ...
- ural 1494 Monobilliards
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; ],b ...
随机推荐
- css3 media媒体查询器用法总结 兼容ie8以下的方法
总结一下响应式设计的核心CSS技术Media(媒体查询器)的用法. http://www.360doc.com/content/14/0704/06/10734150_391862769.shtml ...
- Inno Setup入门(十九)——Inno Setup类参考(5)
: Install Setup 2013-02-02 11:29 377人阅读 评论(0) 收藏 举报 单选按钮 单选按钮在安装中也很常见,例如同一个程序可以选择安装不同的性质的功能,例如选择32位或 ...
- jsonarray和jsonobject
JSONArray ja = new JSONArray(); ja.put("11"); ja.put("22"); ja.put("33" ...
- MYSQL和ORACLE的触发器与存储过程语法差异
整改了一番脚本,遇到了一些两种数据库之间的差异,记录一下: 触发器: 差异 MYSQL ORACLE 说明 创建语句不同 create trigger `AA` BEFORE INSERT on `B ...
- UIActivityIndicatorView的详细使用(加载菊花)
UIActivityIndicatorView实例提供轻型视图,这些视图显示一个标准的旋转进度轮.当使用这些视图时,最重要的一个关键词是小.20×20像素是大多数指示器样式获得最清楚显示效果的大小.只 ...
- iOS NSString类中获取子字符串
NSString类中提供了这样三个方法用于获取子字符串: – substringFromIndex://取字符串长度从0开始,当index=str.length时字符串为空"" – ...
- Ubuntu配置eclipse
1.安装jdk 去官网下载最新版jdk,目前是 jdk-8u45-linux-x64.tar.gz 创建Java的目标路径文件夹,这里我们放在/usr/lib/jvm下面.在终端下操作: sudo m ...
- JS里的CSS函数
<title>无标题文档</title> <script> function css(obj,name,value){ if(arguments.length==2 ...
- 动画——animation部分
动画部分是HTML5的新增部分,其特性是可以不借助js代码就可以单单凭借着css部分完成部分动态效果.其效果华丽,强大,炫酷无比,只要你想得到的动态效果都可以通过css3来完成. <style& ...
- HTTP的学习
一个完整的HTTP请求: 1 简历TCP连接 2 web浏览器像web服务器发送请求命令 3 web浏览器发送请求头信息 4 web服务器应答 5 web服务器发送应答头信息 6 web服务器像浏览器 ...