Submission #1041482

# Submission time Handle Problem Language Result Execution time Memory
1041482 2024-08-02T04:41:05 Z 정민찬(#11002) Brought Down the Grading Server? (CEOI23_balance) C++17
0 / 100
15 ms 5724 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
    ios_base :: sync_with_stdio(false); cin.tie(NULL);
    ll N, S, T;
    cin >> N >> S >> T;
    vector<vector<ll>> a(N, vector<ll>(S));
    for (ll i=0; i<N; i++) {
        for (ll j=0; j<S; j++) {
            cin >> a[i][j];
        }
    }
    for (ll msk=0; msk<(1<<N); msk++) {
        bool flag = true;
        for (ll i=1; i<=T; i++) {
            ll fir = 0, sec = 0;
            for (ll j=0; j<N; j++) {
                if (msk & (1<<j)) {
                    if (a[j][0] == i) fir ++;
                    if (a[j][1] == i) sec ++;
                }
                else if (a[j][0] == i) sec ++;
                else if (a[j][1] == i) fir ++;
            }
            if (abs(fir - sec) > 1) {
                flag = false;
                break;
            }
        }
        if (flag) {
            for (ll j=0; j<N; j++) {
                if (!(msk & (1<<j))) swap(a[j][0], a[j][1]);
                cout << a[j][0] << ' ' << a[j][1] << '\n';
            }
            return 0;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 600 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Correct
2 Correct 0 ms 348 KB Correct
3 Correct 2 ms 348 KB Correct
4 Incorrect 1 ms 348 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 5724 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 5724 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Correct
2 Correct 0 ms 348 KB Correct
3 Correct 2 ms 348 KB Correct
4 Incorrect 1 ms 348 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 5724 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 5724 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 600 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -