测试数据过了,但是末尾的数据过不了

P1319 压缩技术

tadehaobaba、 @ 2021-09-25 15:46:38


#include<iostream>
using namespace std;
int a[10000];
int main()
{

    int n;
    cin >> n;
    int sum = 0;
    int x0, x1;
    for (;;)
    {

        cin >> x0;
        for (int x = 1; x <= x0; x++)
        {
            sum++;
            a[sum] = 0;

        }

        cin >> x1;
        for (int y = 1; y <= x1; y++)
        {
            sum++;
            a[sum] = 1;

        }
        if (sum == n * n)
        {
            break;
        }

    }
    for (int i = 1; i <= n * n; i++)
    {
        if (i % n != 0)
        {
            cout << a[i];
        }
        else {
            cout << a[i] << endl;
        }
    }
    return 0;
}80 0 10 360 4 211 2 400 2 12 10 16 2 78 2 78 2 78 2 18 2 23 11 24 2 78 2 78 2 78 2 78 2 78 2 28 2 48 2 72 2 78 2 78 2 78 2 516 2 400 2 93 4 40 10 575 2 400 2 38 2 78 2 78 2 78 2 18 2 58 2 78 2 78 2 78 2 78 2 78 2 28 2 48 2 72 2 78 2 78 2 78 2 28 43 445 2 400 2 93 4 40 

|