# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223441 | 2020-04-15T09:23:43 Z | cheeheng | Matching (COCI20_matching) | C++14 | 6 ms | 2688 KB |
#include <bits/stdc++.h> using namespace std; vector<int> AdjList[100005]; int X[100005]; int Y[100005]; int p[1048579]; bool visited[1048579]; bool canJoin[2005][2005]; int group[22]; bool picked[22]; int main(){ int N; scanf("%d", &N); for(int i = 0; i < N; i ++){ scanf("%d%d", &X[i], &Y[i]); } for(int i = 0; i < N; i ++){ for(int j = i+1; j < N; j ++){ if(X[i] == X[j] || Y[i] == Y[j]){ canJoin[i][j] = true; AdjList[i].push_back(j); AdjList[j].push_back(i); }else{ canJoin[i][j] = false; } } } for(int i = 0; i < N/2; i ++){ group[i] = 0; group[i+N/2] = 1; } printf("DA\n"); for(int i = 0; i < N; i ++){ for(int j = 0; j < N; j ++){ if(i == j){continue;} if(picked[i] || picked[j]){ continue; } if(X[i] == X[j]){ picked[i] = true; picked[j] = true; printf("%d %d\n", i+1, j+1); } } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Incorrect | 6 ms | 2688 KB | Unexpected end of file - int32 expected |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Incorrect | 6 ms | 2688 KB | Unexpected end of file - int32 expected |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Incorrect | 6 ms | 2688 KB | Unexpected end of file - int32 expected |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Incorrect | 6 ms | 2688 KB | Unexpected end of file - int32 expected |
6 | Halted | 0 ms | 0 KB | - |