#include <bits/stdc++.h>
using namespace std;
#define arr array
#define pii pair<int, int>
#define fir first
#define sec second
const int R = 1e5 + 5, C = 2 + 5, K = 1e5 + 5, INF = 1e9;
int r, c, k;
arr<arr<int, C>, R> vl;
arr<int, K> blnc;
int main() {
// freopen("bl.in", "r", stdin);
cin >> r >> c >> k; assert(c == 2);
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
cin >> vl[i][j];
for (int msk = 0; msk < (1 << r); msk++) {
fill(blnc.begin(), blnc.end(), 0);
for (int i = 1; i <= r; i++) {
if (msk & (1 << (i - 1))) blnc[vl[i][1]]++, blnc[vl[i][2]]--;
else blnc[vl[i][1]]--, blnc[vl[i][2]]++;
}
bool hlt = false;
for (int i = 1; i <= k; i++)
if (abs(blnc[k]) >= 2) hlt = true;
if (hlt) continue;
for (int i = 1; i <= r; i++) {
if (msk & (1 << (i - 1))) cout << vl[i][1] << " " << vl[i][2] << endl;
else cout << vl[i][2] << " " << vl[i][1] << endl;
}
break;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2492 KB |
Correct |
2 |
Runtime error |
1 ms |
536 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2652 KB |
Correct |
2 |
Incorrect |
1 ms |
2488 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 |
Incorrect |
156 ms |
5784 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 |
156 ms |
5784 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 |
Correct |
0 ms |
2652 KB |
Correct |
2 |
Incorrect |
1 ms |
2488 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 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
156 ms |
5784 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 |
156 ms |
5784 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 |
Correct |
1 ms |
2492 KB |
Correct |
2 |
Runtime error |
1 ms |
536 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |