QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#347777#6743. water235wtz2333WA 1ms3656kbC++141.2kb2024-03-09 15:22:442024-03-09 15:22:46

Judging History

你现在查看的是最新测评结果

  • [2024-03-09 15:22:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3656kb
  • [2024-03-09 15:22:44]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mo = 998244353;
const int P = 1e9 + 7;
const int maxn = 2010;
int f[maxn][maxn];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    if(n == 2 && m == 2) {
        cout << 2 << "\n";
        cout << "1 0\n0 1\n";
        return 0;
    }
    int cnt = 0;
    int nn,mm;
    if(n % 2 == 0) nn = n - 1;
    else nn = n;
    if(m % 2 == 0) mm = m - 1;
    else mm = m;
    for(int i = 0;i < nn;i ++) {
        for(int j = 0;j < mm;j ++) {
            if(i % 3 == 0) {
                if(j % 2 == 0){
                    cnt ++;
                    f[i][j] = 1;
                }
            }else if(i % 3 == 2) {
                if(j % 2 == 1) {
                    cnt ++;
                    f[i][j] = 1;
                }
            }
        }
    }
    if(n % 2 == 0) {
        f[n - 1][0] = 1;
        cnt ++;
    }
    if(m % 2 == 0){
        f[0][m - 1] = 1;
        cnt ++;
    }
    cout << cnt << endl;
    for(int i = 0;i < n;i ++) {
        for(int j = 0;j < m;j ++) {
            cout << f[i][j] << " ";
        }cout << "\n";
    }
    // }
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3656kb

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

3 3

output:

3
1 0 1 
0 0 0 
0 1 0 

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

1 4

output:

3
1 0 1 1 

result:

ok The answer is correct.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

2 2

output:

2
1 0
0 1

result:

ok The answer is correct.

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3576kb

input:

2 4

output:

4
1 0 1 1 
1 0 0 0 

result:

wrong answer The answer is wrong: expected = 3, found = 4