제출 #566518

#제출 시각아이디문제언어결과실행 시간메모리
566518Siffer커다란 상품 (IOI17_prize)C++14
0 / 100
1 ms336 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int find_best(int n) { if(ask(0)[1]==0) return 0; vector<int> s, as; int a = 1; int b = 1; while(b <= n) { s.push_back(a); as.push_back(b); a = a*a + 1; b += a; } int k = 0; int p = 0; for(; (1<<(p+1)) <= n; p++); for(int i = p; ~i; i--) { int l = k+(1<<i); if(ask(l)[1]) k = l; } return k+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...