QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#485832#6743. water235duckindogWA 0ms3652kbC++23572b2024-07-21 10:13:232024-07-21 10:13:23

Judging History

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

  • [2024-07-21 10:13:23]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-07-21 10:13:23]
  • 提交

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 = 2; i <= n; i += 2) a[i][m] = 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: 3652kb

input:

2 1

output:

2
1
1

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

4
1 0 1
0 0 1
0 0 1

result:

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