记录编号 |
138831 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2010冲刺五]无穷的序列 |
最终得分 |
100 |
用户昵称 |
乌龙猹 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.569 s |
提交时间 |
2014-11-06 15:56:38 |
内存使用 |
86.09 MiB |
显示代码纯文本
- #include<cstdio>
- #include<cctype>
- using namespace std;
-
- int ret;
- char ch;
- int qin()
- {
- ret=0;
- while(ch=getchar(),!isdigit(ch));
- while(ret=ret*10+ch-'0',ch=getchar(),isdigit(ch));
- return ret;
- }
-
- int n,x;
- int tot=1,ans=2;
- bool f[100000001];
-
- int main()
- {
- freopen("unlessseq.in","r",stdin);
- freopen("unlessseq.out","w",stdout);
- n=qin();
- f[1]=1;
- for(int i=1;i<=n;i++)
- {
- x=qin();
- if(x<=tot)
- {
- printf("%d\n",f[x]);
- continue;
- }
- while(tot<x)
- {
- tot+=ans;
- f[tot+1]=1;
- ans++;
- }
- printf("%d\n",f[x]);
- }
- return 0;
- }