# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
412401 | 2021-05-26T20:08:42 Z | aris12345678 | Easter Eggs (info1cup17_eastereggs) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; const int mxN = 515; int findEgg(int n, vector<pair<int, int> > bridges) { int st = 1, en = n, md, ans; while(st <= en) { md = (st+en)/2; vector<int> left, right; for(int i = st; i <= md; i++) left.push_back(i); for(int i = md+1; i <= en; i++) right.push_back(i); if(query(left)) { if(left.size() == 1) ans = left[0]; en = md-1; } else { if(right.size() == 1) ans = right[0]; st = md+1; } } return ans; }