QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#485834#6743. water235duckindogWA 0ms3780kbC++23601b2024-07-21 10:16:522024-07-21 10:16:53

Judging History

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

  • [2024-07-21 10:16:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3780kb
  • [2024-07-21 10:16:52]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int32_t main() { 
  cin.tie(0)->sync_with_stdio(0);

  int n, m; cin >> n >> m;
  vector<vector<int>> a(n + 1, vector<int>(m + 1));


  for (int i = 5; i <= n; i += 2) a[i][m] = 1;
  if (n >= 3) a[3][1] = 1;
  if (!(n & 1)) a[n][m] = 1;
  for (int j = 1; j <= m; j += 2) a[1][j] = 1;

  int answer = 0;
  for (int i = 1; i <= n; ++i) { 
    for (int j = 1; j <= m; ++j) answer += a[i][j];
  }
  
  cout << answer << "\n";
  for (int i = 1; i <= n; ++i) { 
    for (int j = 1; j <= m; ++j) cout << a[i][j] << " \n"[j == m];
  }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3728kb

input:

2 1

output:

2
1
1

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

3
1 0 1
0 0 0
1 0 0

result:

ok The answer is correct.

Test #3:

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

input:

1 4

output:

2
1 0 1 0

result:

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