# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
486345 | 2021-11-11T10:53:32 Z | NintsiChkhaidze | Easter Eggs (info1cup17_eastereggs) | C++14 | 18 ms | 480 KB |
#include <bits/stdc++.h> #include "grader.h" #define pb push_back using namespace std; vector <int> v[525]; int in[525],cnt; void dfs(int x,int par){ in[++cnt] = x; for (int j=0;j<v[x].size();j++){ int to = v[x][j]; if (to == par) continue; dfs(to,x); } } int findEgg (int n, vector < pair < int, int > > vec){ for (int i=0;i<vec.size();i++){ int a = vec[i].first,b = vec[i].second; v[a].pb(b),v[b].pb(a); } int ANS=0; cnt=0; dfs(1,1); int l = 1,r = n; while(l <= r){ int mid = (l+r)>>1; vector <int> q; q.clear(); for (int i = 1; i <= mid; i++) q.pb(in[i]); bool check = query(q); if (check) { ANS = in[mid]; r = mid - 1; } else l = mid + 1; } for (int i=1;i<=n;i++) v[i].clear(),in[i]=0; return ANS; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 200 KB | Number of queries: 5 |
2 | Partially correct | 3 ms | 200 KB | Number of queries: 5 |
3 | Partially correct | 1 ms | 200 KB | Number of queries: 5 |
4 | Partially correct | 4 ms | 200 KB | Number of queries: 5 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 328 KB | Number of queries: 9 |
2 | Correct | 10 ms | 328 KB | Number of queries: 9 |
3 | Correct | 16 ms | 332 KB | Number of queries: 9 |
4 | Correct | 16 ms | 328 KB | Number of queries: 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 18 ms | 360 KB | Number of queries: 10 |
2 | Correct | 15 ms | 336 KB | Number of queries: 9 |
3 | Partially correct | 18 ms | 352 KB | Number of queries: 10 |
4 | Partially correct | 16 ms | 480 KB | Number of queries: 10 |