제출 #527401

#제출 시각아이디문제언어결과실행 시간메모리
527401stefantaga커다란 상품 (IOI17_prize)C++14
0 / 100
1 ms200 KiB
#include "prize.h" using namespace std; int find_best(int n) { for (int i = 0; i < n-1; ++ i ) { int left = i+1, right = n-1; vector <int> val = ask(i); int poz_right = i; if (val[0] + val[1] == 0) { return i; } while (left <= right) { int mid = (left + right) / 2; vector <int> cnt = ask(i); bool Type = (cnt[0] + cnt[1] == val[0] + val[1]); if (Type) { int cate_sunt = cnt[0] - val[0]; if (cate_sunt == 0) { poz_right = mid; left = mid + 1; } else right = mid - 1; } else { right = mid - 1; } } i = poz_right; } return n-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...