显示代码纯文本
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<iostream>
#define Begin freopen("unlessseq.in","r",stdin);freopen("unlessseq.out","w",stdout);
#define End fclose(stdin);fclose(stdout);
using namespace std;
const int maxn=1010;
void Init();
int main(){
Begin;
Init();
//system("pause");
End;
return 0;
}
void Init(){
int n;scanf("%d",&n);
for(int i=1;i<=n;i++){
int x;scanf("%d",&x);
int k=(8*x-7);int h=(int)(sqrt(k));
if(h*h!=k)puts("0");
else {
if((h+1)%2==0)puts("1");
else puts("0");
}
}
}