ysy666 @ 2017-02-07 17:01:28
我下载的in是:
1000 5 0 100 101 200
900 1000
207 400
401 899
但out是6
这是什么情况
by ysy666 @ 2017-02-08 10:37:24
#include<iostream>
using namespace std;
int a[100000];
int main()
{
int n,t=0;
int x=0,y=0;
cin>>n;
int z=n;
for(int i=1;x<n*n;i++)
{
cin>>a[i];
x+=a[i];
t++;
}
for(int i=1;i<=t;i++)
{
if(i%2==1)
{
for(int j=1;j<=a[i];j++)
{
cout<<"0 ";
y++;
if(y==z)
{
cout<<endl;
y=0;
}
}
}if(i%2==0)
{
for(int j=1;j<=a[i];j++)
{
cout<<"1 ";
y++;
if(y==z)
{
cout<<endl;
y=0;
}
}
}
}
return 0;
}
by ysy666 @ 2017-02-08 10:38:07
全部WA,求改错
by rick12 @ 2017-08-30 21:02:54
'''cpp
#include<stdio.h>
int main()
{
int n,a[205],l=0,i=0,f=0;
scanf("%d",&n);
while(scanf("%d",&a[i])==1&&f<n*n)
{
while(a[i]!=0)
{
if(f%n==0&&i)printf("\n");
printf("%d",l);
a[i]--;
f++;
}
l=!l;
i++;
}
return 0;
}
''' 我也全WA了
by yzxoi @ 2017-09-10 16:15:46
mee too
#include<bits/stdc++.h>
using namespace std;
int n,q=0;
int s[700];
int a[205][205];
int nows=0;
int main(){
cin>>n;
int j=0;
cin>>s[j];
char c=getchar();
while(c!='\n'){
j++;
cin>>s[j];
c=getchar();
}
int k=0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(q==0){
s[k]++;
q=1;
}
if(s[k]>=2){
s[k]--;
}else{
k++;
if(nows==0) nows=1;
else nows=0;
}
cout<<nows;
}
cout<<endl;
}
return 0;
}