QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637193 | #6743. water235 | UESTC_DECAYALI# | WA | 0ms | 3572kb | C++20 | 682b | 2024-10-13 10:53:29 | 2024-10-13 10:53:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+5;
bool flag;
int ans[N], c;
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin >> n >> m;
if (n>m) swap(n, m), flag=true;
for (int i=0; i<n; ++i) ans[i*m+i]=1;
for (int i=n; i<m; ++i) if ((i-n)%2==1) ans[i]=1;
if (n<m) ans[m-1]=1;
if (!flag) {
for (int i=0; i<n; ++i) {
for (int j=0; j<m; ++j) cout << ans[i*m+j] << ' ';
cout << '\n';
}
} else {
for (int j=0; j<m; ++j) {
for (int i=0; i<n; ++i) cout << ans[i*m+j] << ' ';
cout << '\n';
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
2 1
output:
1 1
result:
wrong output format Unexpected end of file - int32 expected