QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637188 | #6743. water235 | UESTC_DECAYALI# | WA | 1ms | 3648kb | C++20 | 673b | 2024-10-13 10:51:02 | 2024-10-13 10:51:02 |
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;
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: 1ms
memory: 3648kb
input:
2 1
output:
1 1
result:
wrong output format Unexpected end of file - int32 expected