
code:
#include<bits/stdc++.h>
#define NN 1500005
using namespace std;
const int N=1e9+7;
int a[N]={0,1},x[NN];
signed main(void)
{
int n,o=1,maxx=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&x[i]);
maxx=max(maxx,x[i]);
}
for(int i=2;i<=maxx;i+=o)
{
a[i]=1;
for(int j=1;j<=o;j++)
{
a[i+j]=0;
}
o++;
}
for(int i=1;i<=n;i++)
{
printf("%d",a[x[i]]);
if (i<=n-1)
{
printf("\n");
}
}
return 0;
}
是我c++没装对吗?
求助!!!