思考很久,查看讨论题解,思路无误,本地输出结果也正确,为什么不能ac(20分)?
查看原帖
思考很久,查看讨论题解,思路无误,本地输出结果也正确,为什么不能ac(20分)?
816571
X_yugg123楼主2022/10/27 17:06

只过了#7#8两个点,不应该啊

#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    long n,x,sum=0,count=0;
    bool zero=true,first=false,op=0;
    cin>>n;
    while(sum<n*n)
    {
        cin>>x;
        sum+=x;
        if(zero==true)
        {
            for(int j=0;j<x;j++)
            {
                if((count%n==0)&&(first==true)) cout<<endl;
                if(first==false) first=true;
                cout<<op;
                count++;
            }
            op=!op;
            zero=false;
        }
        else
        {
            for(int j=0;j<x;j++)
            {
                if(count%n==0) cout<<endl;
                cout<<op;
                count++;
            }
            op=!op;
            zero=true;
        }
    }
    return 0;
}
2022/10/27 17:06
加载中...