#include <bits/stdc++.h>
using namespace std;
char tab[310][310];
int main() {
int t, n, k, k1;
cin >> t >> n >> k >> k1;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
cin >> tab[i][j];
}
}
int ans1 = 0;
int ans2 = 0;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n / 2; j++) {
if(tab[i][j]) {
ans1++;
}
}
}
for(int i = 1; i <= n / 2; i++) {
for(int j = 1; j <= n; j++) {
if(tab[i][j]) {
ans2++;
}
}
}
if(ans1 < ans2) {
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n / 2; j++) {
cout << "0 ";
}
for(int j = 1; j <= n / 2; j++) {
cout << "1 ";
}
cout << '\n';
}
}
else {
for(int i = 1; i <= n / 2; i++) {
for(int j = 1; j <= n; j++) {
cout << "0 ";
}
cout << '\n';
}
for(int i = 1; i <= n / 2; i++) {
for(int j = 1; j <= n; j++) {
cout << "1 ";
}
cout << '\n';
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
K = 24 |
2 |
Incorrect |
1 ms |
212 KB |
K = 623 |
3 |
Partially correct |
9 ms |
484 KB |
K = 20313 |
4 |
Partially correct |
10 ms |
468 KB |
K = 23205 |
5 |
Incorrect |
9 ms |
468 KB |
K = 21462 |
6 |
Partially correct |
9 ms |
468 KB |
K = 22330 |
7 |
Partially correct |
9 ms |
460 KB |
K = 22537 |
8 |
Incorrect |
9 ms |
468 KB |
K = 25631 |
9 |
Incorrect |
9 ms |
496 KB |
K = 22541 |
10 |
Partially correct |
10 ms |
468 KB |
K = 22367 |