src2020/3053_longdui/new.cpp

24 lines
413 B
C++

#include <iostream>
#include<set>
using namespace std;
set<int> cun;
int main()
{
int n,now=1;
for(int i=0;now<=1000000000;i++){
now+=i;
cun.insert(now);
}
cin>>n;
for(int i=1;i<=n;i++){
int u;
cin>>u;
if(cun.find(u)==cun.end()){
cout<<"0"<<endl;
}else{
cout<<"1"<<endl;
}
}
}