为啥是WA啊,我真的不李姐~

P1319 压缩技术

zsy_NKU @ 2022-11-10 19:16:02


#include<iostream>
#include<cmath>
#include <iomanip>
using namespace std;
int main()
{
    int n,h=0,b=1;
    cin >> n;
    while(h<n*n)
    {
        int k;
        b = 0-b;
        cin >> k;
        if (b == -1) {
            for (int j = 1; j <= k; j++) {
                cout << 0;
                h++;
                if (h % 7 == 0)
                    cout << endl;
            }
        }
        if (b == 1) {
            for (int j = 1; j <= k; j++) {
                cout << 1;
                h++;
                if (h % 7 == 0)
                    cout << endl;
            }
        }

    }

}

by bk1212 @ 2022-11-10 19:34:07

大哥,这是n*n的矩阵,要mod n


|