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 ...
随机推荐
- php.ini与php-fpm.conf配置文件的区别
php-fpm.conf是PHP-FPM特有的配置文件 php.ini是所以php模式中必须的配置文件 两者的区别是,php-fpm.conf是PHP-FPM进程管理器的配置文件,php.ini是PH ...
- yum仅下载不安装
通常是使用yum来安装解决依赖包关系,如果有一台服务器没法连接外网或yum源没有设置,希望通过另一台服务器将这些RPM包下载下来,然后再去安装.那么怎么使用yum工具来下载RPM包呢? 使用yum 要 ...
- boost ASIO实例
client端代码 #include <iostream> #include <boost/asio.hpp> #include <boost/bind.hpp> ...
- js中子页面父页面方法和变量相互调用
(1)子页面调用父页面的方法或者变量: window.parent.方法()或者变量名window.parent相当于定位到父页面 之后的操作和在父页面中写代码一样写 window.parent.aa ...
- cfdiv2/c/找规律
题目连接 £:若n<4,NO: £:若n==4,特判,n==5,特判. £:若n>=6,用2-4组成24,1和5和6组成零,即可. #include <set> #includ ...
- sql server 2005导出数据
*/ EXEC sp_configure 'show advanced options', 1 GO */ 配置选项 'show advanced options' 已从 0 更改为 1.请运 ...
- getByClassName2016/4/21
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- Node.js学习 - Global Object
全局对象:特殊的对象,它及其所有属性都可以在程序的任何地方访问. __filename 表示当前正在执行的脚本的文件名.它将输出文件所在位置的绝对路径,且和命令行参数所指定的文件名不一定相同. 如果在 ...
- windbg 之 如何设置模块加载时断下
这里先介绍两个指令: sx指令: The sx* commands control the action that the debugger takes when an exception occur ...
- CNS的数据库搜索网站可用solr实现
使用solr的DIH (data import handler) 可以操作后台数据库,前端solr自带的search ui (localhost:8983/solr/collection1/brows ...