比赛 防止浮躁的小练习v0.3 评测结果 RRRRRRRRRR
题目名称 YL杯超级篮球赛 最终得分 0
用户昵称 GROWL GOOD BOYส็ 运行时间 0.000 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2016-10-12 16:17:05
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int N;
/*  n*(n-1)/2 + 1 的位数上是1 */
int main()
{
    freopen("unlessseq.in","r",stdin);
    freopen("unlessseq.out","w",stdout);
    scanf("%d",&N);
    long long x;
    for(int i=1;i<=N;i++)
    {
         scanf("%lld",&x);   
         if(8*x-7<=0)puts("0");
         else 
         {
              long long ha=sqrt(8*x-7);
              if(ha*ha==8*x-7)puts("1");
              else puts("0");
         } 
    }
    fclose(stdin);
    fclose(stdout);
    return 0;
}