QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#129269#6743. water235SolitaryDream#WA 1ms3876kbC++20614b2023-07-22 13:19:572023-07-22 13:19:59

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-22 13:19:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3876kb
  • [2023-07-22 13:19:57]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
    scanf("%d%d", &n, &m);
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        if (i == n - 1 || i % 2 == 0) ++ans;
    }
    for (int i = 1; i < m; ++i) {
        if (i == m - 1 || i % 2 == 0) ++ans;
    }
    printf("%d\n", ans);
    for (int i = 0; i < n; puts(""), ++i) 
        for (int j = 0; j < m; ++j) {
            if (j == 0 && (i == n - 1 || i % 2 == 0)) printf("%d ", 1);
            else if (i == 0 && (j == m - 1 || j % 2 == 0)) printf("%d ", 1);
            else printf("0 ");
        }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

3 3

output:

3
1 0 1 
0 0 0 
1 0 0 

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

1 4

output:

3
1 0 1 1 

result:

ok The answer is correct.

Test #4:

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

input:

2 2

output:

3
1 1 
1 0 

result:

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