QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#272207 | #6743. water235 | mobbb# | WA | 0ms | 3816kb | C++17 | 673b | 2023-12-02 16:28:09 | 2023-12-02 16:28:09 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;cin >> n >> m;
vector<vector<int>> vis(n + 5,vector<int>(m + 5));
auto r = vis;
int cnt = 0;
for (int i = 1;i <= n;i+=2){
if (!r[i][1])
cnt++;
r[i][1] = 1;
}
if (n % 2 == 0) r[n][1] = 1,cnt++;
for (int i = 1;i <= m;i+=2){
if (!r[1][i])
cnt++;
r[1][i] = 1;
}
if (m % 2 == 0) r[1][m] = 1,cnt++;
cout << cnt << endl;
for (int i = 1;i <= n;i++){
for (int j = 1;j <= m;j++)
cout << r[i][j] << " \n"[j == m];
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3504kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3816kb
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: 0ms
memory: 3588kb
input:
1 4
output:
3 1 0 1 1
result:
ok The answer is correct.
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3624kb
input:
2 2
output:
3 1 1 1 0
result:
wrong answer The answer is wrong: expected = 2, found = 3