QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#220570#6743. water235ycccc319#WA 1ms3460kbC++17692b2023-10-20 15:41:222023-10-20 15:41:22

Judging History

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

  • [2023-10-20 15:41:22]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3460kb
  • [2023-10-20 15:41:22]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;


int main() {
    int n, m;
    cin >> n >> m;
    int ans = 0;
    vector<vector<bool>> v(n + 1, vector<bool>(m + 1));
    for (int i = 1; i <= m; i++) {
        v[1][i] = (i & 1);
    }
    for (int i = 2; i <= n; i++) {
        if (i != n)v[i][m] = ((i + m + 1) & 1);
        else v[i][m] = 1;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (v[i][j])ans++;
        }
    }
    cout << ans << "\n";
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            cout << v[i][j] << " ";
        }
        cout << "\n";
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

3
1 0 1 
0 0 0 
0 0 1 

result:

ok The answer is correct.

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3412kb

input:

1 4

output:

2
1 0 1 0 

result:

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