# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
61654 | 2018-07-26T09:05:16 Z | EntityIT | Easter Eggs (info1cup17_eastereggs) | C++14 | 78 ms | 3096 KB |
#include<bits/stdc++.h> #include "grader.h" using namespace std; #define pb push_back #define fi first #define se second typedef pair<int, int> ii; const int N = 1e5 + 5; int a[N], cur; vector<int> gr[N]; void dfs(int u, int p) { a[++cur] = u; for (int v : gr[u]) if(v != p) dfs(v, u); } int findEgg(int n, vector<ii> edge) { for (int i = 0; i < N; ++i) gr[i].clear(); for (ii i : edge) { gr[i.fi].pb(i.se); gr[i.se].pb(i.fi); } dfs(1, 1); vector<int> ask; int l = 1, r = n; while(l < r) { int mid = l + r >> 1; ask.clear(); for (int i = 1; i <= mid; ++i) ask.pb(a[i]); if(query(ask)) r = mid; else l = mid + 1; } return a[l]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 2680 KB | Number of queries: 4 |
2 | Correct | 9 ms | 2732 KB | Number of queries: 4 |
3 | Correct | 12 ms | 2820 KB | Number of queries: 4 |
4 | Correct | 10 ms | 2820 KB | Number of queries: 4 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 26 ms | 2820 KB | Number of queries: 8 |
2 | Correct | 28 ms | 3004 KB | Number of queries: 9 |
3 | Correct | 61 ms | 3004 KB | Number of queries: 9 |
4 | Correct | 61 ms | 3096 KB | Number of queries: 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 78 ms | 3096 KB | Number of queries: 9 |
2 | Correct | 58 ms | 3096 KB | Number of queries: 9 |
3 | Correct | 57 ms | 3096 KB | Number of queries: 9 |
4 | Correct | 71 ms | 3096 KB | Number of queries: 9 |