您的位置:首页 > 其它

51nod 1087 1 10 100 1000

2016-11-06 15:25 232 查看
#include <bits/stdc++.h>
using namespace std;

int main()
{
long long T,n,x;
cin>>T;
while(T--)
{
scanf("%lld",&n);
if(n==1)
{
printf("1\n");
continue;
}
x=sqrt(2*n-1);
n-=(1+x)*x/2;
if(n==1)
printf("1\n");
else
printf("0\n");
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  51nod