# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
588050 | jmyszka2007 | Coins (LMIO19_monetos) | C++17 | 16 ms | 1052 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int 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';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |