# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
49164 | 2018-05-22T22:53:24 Z | StainFizzy | Simurgh (IOI17_simurgh) | C++14 | 87 ms | 488 KB |
#include "simurgh.h" #include <bits/stdc++.h> #define N 55 #define f first #define s second using namespace std; typedef pair<int, int> pii; int ok[N], mm, nn; vector<pii> grafo[N]; vector<int> roads; void dfs(int x) { ok[x] = 1; random_shuffle(grafo[x].begin(), grafo[x].end()); for(auto v: grafo[x]) { if(ok[v.f]) continue; roads.push_back(v.s); ok[v.f] = 1; dfs(v.f); } } std::vector<int> find_roads(int n_, std::vector<int> u, std::vector<int> v) { for(int i = 0; i < u.size(); i++) { grafo[u[i]].push_back({v[i], i}); grafo[v[i]].push_back({u[i], i}); } while(true) { memset(ok, 0, sizeof ok); roads.clear(); dfs(1); if(count_common_roads(roads) == n_ -1) { return roads; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 87 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 87 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 87 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 488 KB | correct |
2 | Incorrect | 44 ms | 488 KB | WA in grader: NO |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 87 ms | 256 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |