# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
49165 | 2018-05-22T22:54:26 Z | StainFizzy | Simurgh (IOI17_simurgh) | C++14 | 47 ms | 436 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(0); if(count_common_roads(roads) == n_ -1) { return roads; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 376 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 376 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 376 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | correct |
2 | Incorrect | 44 ms | 436 KB | WA in grader: NO |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 376 KB | WA in grader: NO |
2 | Halted | 0 ms | 0 KB | - |