# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588050 | jmyszka2007 | Coins (LMIO19_monetos) | C++17 | 16 ms | 1052 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |