放编译器上没问题,到洛谷上CE了
#include<bits/stdc++.h>
using namespace std;
int n;
int a[1000005];
int main(){
cin>>n;
int z=n*n,x=0,t=0;
while((cin>>a[x])!=0){
x++;
}
for(int i=0;i<x;i++){
if(i%2==0){
for(int j=1;j<=a[i];j++){
t++;
if(t>n){
cout<<endl;
t=1;
}
cout<<0;
}
}
else{
for(int j=1;j<=a[i];j++){
t++;
if(t>n){
cout<<endl;
t=1;
}
cout<<1;
}
}
}
return 0;
}