# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713035 | 2023-03-21T00:34:17 Z | lam | Easter Eggs (info1cup17_eastereggs) | C++14 | 24 ms | 588 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; const int maxn = 1010; typedef pair<int,int> ii; #define ff first #define ss second int n; vector <int> question; int dau[maxn],s[maxn]; vector <int> adj[maxn],comp; void dfs(int x, int p) { comp.push_back(x); for (int i:adj[x]) if (i!=p) dfs(i,x); } int findEgg(int N, vector <ii> bridges) { n=N; question.clear(); for (int i=1; i<=n; i++) adj[i].clear(); for (ii i:bridges) { adj[i.ff].push_back(i.ss); adj[i.ss].push_back(i.ff); } dfs(1,1); int l=0; int r=n-1; int ans = -1; while (l<r) { int mid=(l+r)/2; vector <int> tmp; for (int i=0; i<=mid; i++) tmp.push_back(comp[i]); if (query(tmp)) r=mid; else l=mid+1; } return comp[r]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Number of queries: 4 |
2 | Correct | 2 ms | 208 KB | Number of queries: 4 |
3 | Correct | 1 ms | 208 KB | Number of queries: 4 |
4 | Correct | 1 ms | 208 KB | Number of queries: 4 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 336 KB | Number of queries: 8 |
2 | Correct | 12 ms | 436 KB | Number of queries: 9 |
3 | Correct | 14 ms | 584 KB | Number of queries: 9 |
4 | Correct | 16 ms | 464 KB | Number of queries: 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 472 KB | Number of queries: 9 |
2 | Correct | 13 ms | 480 KB | Number of queries: 9 |
3 | Correct | 17 ms | 536 KB | Number of queries: 9 |
4 | Correct | 14 ms | 588 KB | Number of queries: 9 |