# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228027 | 2020-04-29T15:10:44 Z | AaronNaidu | Simurgh (IOI17_simurgh) | C++14 | 6 ms | 384 KB |
#include <bits/stdc++.h> #include "simurgh.h" using namespace std; int n; vector<int> u, v; vector<int> subset, toRet; bool visited[600]; void getSubset(int used, int pos) { if (used == n-1) { for (int i = 0; i < n-1; i++) { visited[u[subset[i]]] = true; visited[v[subset[i]]] = true; } bool allRight = true; for (int i = 0; i < n; i++) { if (!visited[i]) { allRight = false; } } if (allRight) { if (count_common_roads(subset) == n-1) { toRet = subset; } } for (int i = 0; i < n; i++) { visited[i] = false; } return; } if (pos >= u.size()) { return; } for (int i = pos; i < u.size(); i++) { subset.push_back(i); getSubset(used+1, i+1); subset.pop_back(); } } vector<int> find_roads(int ln, vector<int> lu, vector<int> lv) { n = ln; u = lu; v = lv; getSubset(0, 0); return toRet; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | correct |
2 | Incorrect | 5 ms | 384 KB | WA in grader: NO |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |