QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#163680 | #6743. water235 | ucup-team1209# | WA | 1ms | 3420kb | C++20 | 2.2kb | 2023-09-04 13:56:58 | 2023-09-04 13:56:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
cin >> n >> m;
vector <vector <int> > ans(n);
if((n & 1) && (m & 1)) {
for(int i = 0; i < n; i++) {
if(i == 0) {
for(int j = 0; j < m; j++) {
if(j & 1 ^ 1) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
else {
for(int j = 0; j < m; j++) {
if(j == 0 && (i & 1 ^ 1)) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
cout << '\n';
}
}
if((n & 1 ^ 1) && (m & 1 ^ 1)) {
for(int i = 0; i < n; i++) {
if(i == 0) {
for(int j = 0; j < m; j++) {
if(j & 1) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
else {
for(int j = 0; j < m; j++) {
if(j == 0 && (i & 1)) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
cout << '\n';
}
}
if((n & 1 ^ 1) && (m & 1)) {
for(int i = 0; i < n; i++) {
if(i == 0) {
for(int j = 0; j < m; j++) {
if(j & 1 ^ 1) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
else {
for(int j = 0; j < m; j++) {
if(j == 0 && (i & 1)) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
cout << '\n';
}
}
if((n & 1) && (m & 1 ^ 1)) {
for(int i = 0; i < n; i++) {
if(i == 0) {
for(int j = 0; j < m; j++) {
if((j == 0) || (j & 1)) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
else {
for(int j = 0; j < m; j++) {
if(j == 0 && (i & 1 ^ 1)) cout << 1 << ' ';
else cout << 0 <<' ';
}
}
cout << '\n';
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3420kb
input:
2 1
output:
1 1
result:
wrong output format Unexpected end of file - int32 expected