제출 #588034

#제출 시각아이디문제언어결과실행 시간메모리
588034jmyszka2007Coins (LMIO19_monetos)C++17
5.34 / 100
10 ms496 KiB
#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';
		}
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...