답안 #1069860

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1069860 2024-08-22T09:27:06 Z NeroZein Brought Down the Grading Server? (CEOI23_balance) C++17
10 / 100
28 ms 7364 KB
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);	
	int n, s, t;
	cin >> n >> s >> t;
	vector<int> tot(t);
	vector<vector<int>> a(n, vector<int> (s)); 
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < s; ++j) {
			cin >> a[i][j];
			--a[i][j]; 
			tot[a[i][j]]++; 
		}
	}
	for (int mask = 0; mask < (1 << n); ++mask) {
		vector<vector<int>> cnt(s, vector<int> (t));
		for (int i = 0; i < n; ++i) {
			bool rev = (mask >> i & 1); 
			for (int j = 0; j < 2; ++j) {
				int task = a[i][j ^ rev]; 
				cnt[j][task]++; 
			}
		}
		bool ok = true; 
		for (int i = 0; i < t; ++i) {
			for (int j = 0; j < 2; ++j) {
				if (cnt[j][i] > (tot[i] + 1) / 2) {
					ok = false; 
				}
			}
		}
		if (ok) {
			for (int i = 0; i < n; ++i) {
				bool rev = mask >> i & 1; 
				for (int j = 0; j < s; ++j) {
					cout << a[i][j ^ rev] + 1 << " \n"[j == s - 1]; 
				}
			}
			return 0; 
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Correct
2 Incorrect 0 ms 344 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 0 ms 344 KB Correct
3 Correct 1 ms 348 KB Correct
4 Correct 1 ms 348 KB Correct
5 Correct 0 ms 456 KB Correct
6 Correct 28 ms 348 KB Correct
7 Correct 1 ms 348 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 7364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 7364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 0 ms 344 KB Correct
3 Correct 1 ms 348 KB Correct
4 Correct 1 ms 348 KB Correct
5 Correct 0 ms 456 KB Correct
6 Correct 28 ms 348 KB Correct
7 Correct 1 ms 348 KB Correct
8 Incorrect 15 ms 7364 KB Unexpected end of file - int32 expected
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 7364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 7364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Correct
2 Incorrect 0 ms 344 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
3 Halted 0 ms 0 KB -