Submission #869782

#TimeUsernameProblemLanguageResultExecution timeMemory
869782AriadnaICC (CEOI16_icc)C++14
7 / 100
229 ms620 KiB
#include <bits/stdc++.h> #include "icc.h" using namespace std; vector < int > p; int root(int a) { if (p[a] == a) return a; return p[a] = root(p[a]); } void join(int a, int b) { p[root(a)] = root(b); } void run(int N) { p = vector < int >(N); for (int i = 0; i < N; ++i) { p[i] = i; } for (int t = 1; t < N; ++t) { bool founded = false; for (int i = 0; i < N && !founded; ++i) { for (int j = i + 1; j < N && !founded; ++j) { if (root(i) == root(j)) continue; int a[1] = {i + 1}; int b[1] = {j + 1}; if (query(1, 1, a, b)) { setRoad(i + 1, j + 1); join(i, j); founded = true; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...