| 记录编号 | 320325 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1128.[NOIP 2010冲刺五]无穷的序列 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.549 s | ||
| 提交时间 | 2016-10-11 21:01:16 | 内存使用 | 0.51 MiB | ||
#include<cstdio>
#include<iostream>
#include<set>
using namespace std;
set<int> S;
int f[50000],n,cur,cnt=1;
int main()
{
freopen("unlessseq.in","r",stdin);
freopen("unlessseq.out","w",stdout);
f[1]=1;
S.insert(1);
while(cnt++)
{
f[cnt]=f[cnt-1]+cnt-1;
if(f[cnt]>1000000000) break;
S.insert(f[cnt]);
}
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&cur);
if(S.count(cur)) puts("1");
else puts("0");
}
return 0;
}