Submission #588050

#TimeUsernameProblemLanguageResultExecution timeMemory
588050jmyszka2007Coins (LMIO19_monetos)C++17
11.79 / 100
16 ms1052 KiB
#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 timeMemoryGrader output
Fetching results...