Submission #1041758

# Submission time Handle Problem Language Result Execution time Memory
1041758 2024-08-02T07:48:58 Z 변재우(#11004) Brought Down the Grading Server? (CEOI23_balance) C++17
10 / 100
28 ms 392 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;

int N, S, T, A[22], B[22];

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>N>>S>>T;
    for(int i=1; i<=N; i++) cin>>A[i]>>B[i];
    for(int i=0; i<(1<<N); i++) {
        int C[22]={0}, C2[22]={0};
        for(int j=1; j<=N; j++) {
            if(i&(1<<(j-1))) C[A[j]]++, C2[B[j]]++;
            else C[B[j]]++, C2[A[j]]++;
        }
        bool flag=true;
        for(int j=1; j<=T; j++) if(abs(C[j]-C2[j])>1) flag=false;
        if(flag) {
            for(int j=1; j<=N; j++) {
                if(i&(1<<(j-1))) cout<<A[j]<<" "<<B[j]<<"\n";
                else cout<<B[j]<<" "<<A[j]<<"\n";
            }
            break;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Correct
2 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 1 ms 348 KB Correct
3 Correct 1 ms 348 KB Correct
4 Correct 1 ms 348 KB Correct
5 Correct 0 ms 348 KB Correct
6 Correct 28 ms 392 KB Correct
7 Correct 1 ms 348 KB Correct
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 1 ms 348 KB Correct
3 Correct 1 ms 348 KB Correct
4 Correct 1 ms 348 KB Correct
5 Correct 0 ms 348 KB Correct
6 Correct 28 ms 392 KB Correct
7 Correct 1 ms 348 KB Correct
8 Runtime error 0 ms 348 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Correct
2 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -