24 lines
413 B
C++
Raw Normal View History

2020-04-23 21:58:35 +08:00
#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;
}
}
}