# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61618 | 2018-07-26T08:13:05 Z | Flying_dragon_02 | Easter Eggs (info1cup17_eastereggs) | C++17 | 40 ms | 572 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; #define fi first #define se second #define pb push_back #define mp make_pair typedef pair<int, int> ii; vector<int> graph[600]; int child[600], m, root, par[600], ok = 0, arr[600], num = 1; bool vis1[600], vis2[600]; vector<int> ask; void dfs(int u, int p){ arr[num] = u; num++; for(int i = 0; i < graph[u].size(); i++){ int v = graph[u][i]; if(v == p) continue; dfs(v, u); } } int findEgg(int N, vector<ii> bridges){ for(int i = 1; i <= N; i++) graph[i].clear(); num = 1; for(int i = 0; i < bridges.size(); i++){ int u = bridges[i].fi, v = bridges[i].se; graph[u].pb(v); graph[v].pb(u); } dfs(1, 1); int l = 1, r = N, mid; while(l < r){ mid = (l + r) / 2; ask.clear(); for(int j = 1; j <= mid; j++) ask.pb(arr[j]); if(query(ask)) r = mid; else l = mid + 1; } return arr[l]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Number of queries: 4 |
2 | Correct | 3 ms | 376 KB | Number of queries: 4 |
3 | Correct | 3 ms | 496 KB | Number of queries: 4 |
4 | Correct | 3 ms | 496 KB | Number of queries: 4 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 496 KB | Number of queries: 8 |
2 | Correct | 22 ms | 496 KB | Number of queries: 9 |
3 | Correct | 23 ms | 520 KB | Number of queries: 9 |
4 | Correct | 40 ms | 520 KB | Number of queries: 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 572 KB | Number of queries: 9 |
2 | Correct | 39 ms | 572 KB | Number of queries: 9 |
3 | Correct | 27 ms | 572 KB | Number of queries: 9 |
4 | Correct | 23 ms | 572 KB | Number of queries: 9 |