# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
67631 | 2018-08-15T07:09:01 Z | tatatan | Easter Eggs (info1cup17_eastereggs) | C++11 | 3 ms | 704 KB |
#include <bits/stdc++.h> #include "grader.h" #define mp make_pair #define pb push_back #define pii pair<int,int> #define LL long long #define st first #define nd second #define endl '\n' using namespace std; vector<int> v[512]; int cnt,used[512]; void dfs(int x,int y,int en,vector<int> &add) { if(cnt==en) return; add.pb(x); if(!used[x]) ++cnt; for(int i=0;i<v[x].size();++i) if(v[x][i]!=y) dfs(v[x][i],x,en,add); } int findEgg (int n, vector < pair < int, int > > br) { memset(used,0,sizeof used); for(int i=0;i<n;++i) v[i].clear(); for(int i=0;i<n;++i) { v[br[i].st].pb(br[i].nd); v[br[i].nd].pb(br[i].st); } int left=n; while(left!=1) { vector<int> add; cnt=0; dfs(0,-1,left/2,add); if(query(add)) { left=left/2; fill(used,used+n,1); for(int i=0;i<add.size();++i) used[add[i]]=0; } else { for(int i=0;i<add.size();++i) used[add[i]]=1; left-=left/2; } } for(int i=0;i<n;++i) if(!used[i]) return i+1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 504 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 704 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 704 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |