# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918501 | 2024-01-30T01:57:18 Z | hacizadal | Easter Eggs (info1cup17_eastereggs) | C++17 | 82 ms | 131072 KB |
#include <bits/stdc++.h> #include "grader.h" #define ll long long #define pll pair<ll, ll> using namespace std; vector<ll>g[550], eggs; ll used[550]; void dfs(ll v) { eggs.push_back(v); for (auto u : g[v]){ if (used[u] == 0){ dfs(u); } } } int findEgg (int N, vector < pair < int, int > > bridges) { for (ll i = 0; i<bridges.size(); i++){ g[bridges[i].first].push_back(bridges[i].second); g[bridges[i].second].push_back(bridges[i].first); } dfs(1); ll l = 0, r = N - 1; while (l < r){ ll m = (l + r)/2; vector<int>f; for (ll i = 0; i<m; i++){ f.push_back(eggs[i]); } if (query(f)){ r = m; } else { l = m + 1; } } return eggs[r]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 72 ms | 131072 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 73 ms | 131072 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 82 ms | 131072 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |