记录编号 320403 评测结果 AAAAAAAAAA
题目名称 [NOIP 2010冲刺五]无穷的序列 最终得分 100
用户昵称 GravatarHzoi_Go灬Fire 是否通过 通过
代码语言 C++ 运行时间 0.277 s
提交时间 2016-10-11 21:28:03 内存使用 0.31 MiB
显示代码纯文本
  1. #include<cmath>
  2. #include<cstring>
  3. #include<cstdio>
  4. #include<algorithm>
  5. #include<cstdlib>
  6. #include<iostream>
  7. #define Begin freopen("unlessseq.in","r",stdin);freopen("unlessseq.out","w",stdout);
  8. #define End fclose(stdin);fclose(stdout);
  9. using namespace std;
  10. const int maxn=1010;
  11. void Init();
  12.  
  13. int main(){
  14. Begin;
  15. Init();
  16. //system("pause");
  17. End;
  18. return 0;
  19. }
  20. void Init(){
  21. int n;scanf("%d",&n);
  22. for(int i=1;i<=n;i++){
  23. int x;scanf("%d",&x);
  24. int k=(8*x-7);int h=(int)(sqrt(k));
  25. if(h*h!=k)puts("0");
  26. else {
  27. if((h+1)%2==0)puts("1");
  28. else puts("0");
  29. }
  30. }
  31. }