QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#439894 | #6743. water235 | suibian_xiaozhao# | WA | 0ms | 3600kb | C++23 | 1.5kb | 2024-06-12 20:21:13 | 2024-06-12 20:21:14 |
Judging History
answer
//
// Created by DELLPC on 24-5-19.
//
#include "bits/stdc++.h"
using namespace std;
using i64 = long long;
using i32 = unsigned int;
#define endl '\n'
i64 mod = 998244353;
i64 qpow(i64 a, i64 b, i64 mods = 1e9 + 7) {
i64 ans = 1;
while (b) {
if (b & 1) {
ans = ans * a % mods;
}
a = a * a % mods;
b >>= 1;
}
return ans;
}
//求逆元
i64 inv(i64 a, i64 mods = 1e9 + 7) {
return qpow(a, mods - 2, mods);
}
void solve() {
int n, m;
cin >> n >> m;
// cerr << n << m << endl;
vector<vector<int>> arr(n + 1, vector<int>(n + 1));
if (n % 2 == 0 && m % 2 == 0) {
for (int i = 1; i <= n; i += 2) {
arr[i][1] = 1;
}
for (int i = 2; i <= m; i += 2){
arr[n][i] = 1;
}
} else {
for (int i = 1; i <= n; i += 2) {
arr[i][1] = 1;
}
if (n % 2 == 0) {
arr[n][1] = 1;
}
for (int i = 1; i <= m; i += 2) {
arr[1][i] = 1;
}
if (m % 2 == 0) {
arr[1][m] = 1;
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cout << arr[i][j] << " ";
}
cout << endl;
}
}
int main() {
// cerr << 1996488708ll * 2ll %mod<<endl;
ios::sync_with_stdio(0), cin.tie(0);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
2 1
output:
1 1
result:
wrong output format Unexpected end of file - int32 expected