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 ...
随机推荐
- Ajax+Spring MVC实现跨域请求(JSONP)JSONP 跨域
JSONP原理及实现 接下来,来实际模拟一个跨域请求的解决方案.后端为Spring MVC架构的,前端则通过Ajax进行跨域访问. 1.首先客户端需要注册一个callback(服务端通过该callba ...
- PS:抠图方法1(利用对比度ctrl+l)
PS:抠图方法1(利用对比度ctrl+l) 工具/原料 Photoshop.美女照片 方法/步骤 小编使用的是Photoshop cs5版本,大家使用其他版本都没有关系,界面略有不同,但操 ...
- think in uml-关系
1.关联关系association 在一段时间内将多个类的实例连接在一起 某个对象在一段时间内一直"知道"另一个对象的存在 2.依赖关系dependency 一个对象的修改会导致另 ...
- fp oo
http://blog.enfranchisedmind.com/2009/05/scala-not-functional/
- ENC28j60以太网芯片驱动程序简介
ENC28j60以太网芯片驱动程序简介 ENC28J60 驱动开发要点 enc28J60 和 Arduino (1)——ping通你的Arduino MCU51单片机uIP协议栈+ENC28J60网卡 ...
- css 重新学习系列(2)
摘自: http://www.cnblogs.com/liuzhaoyang/articles/3289456.html Position定位:relative | absolute 定位一直是WEB ...
- liunx 平台下软件包管理
RPM/DPKG 两大阵营简介 在 GNU/Linux( 以下简称 Linux) 操作系统中,RPM 和 DPKG 为最常见的两类软件包管理工具,他们分别应用于基于 RPM 软件包的 Linux 发行 ...
- 【转载】关于SetWindowOrgEx、SetViewportOrgEx、SetViewportExtEx 和SetWindowExtEx 详解
关于SetWindowOrgEx.SetViewportOrgEx.SetViewportExtEx 和SetWindowExtEx 详解 1. SetWindowOrgEx是设置窗口的原点坐标. ...
- 转:WebDriver进行屏幕截图
例: 打开百度首页 ,进行截图 01 packagecom.example.tests; 02 importjava.io.File; 03 importorg.apache.commons.io ...
- 43个优秀的Swift开源项目推荐(转载)
["轮子"] 工具类 SwiftyJSON:GitHub 上最为开发者认可的 JSON 解析类 Dollar.swift:Swift 版 Lo-Dash (或 underscore ...