제출 #132659

#제출 시각아이디문제언어결과실행 시간메모리
132659Talant커다란 상품 (IOI17_prize)C++17
20 / 100
58 ms504 KiB
#include "prize.h" #include <bits/stdc++.h> #define sc second #define fr first #define mk make_pair #define pb push_back using namespace std; const int N = (1e6 + 5); const int inf = (1e9 + 7); int find_best(int n) { int cur = 0; int cn = 0; while (1) { int l = cur,r = n - 1; vector<int> res = ask(cur); if (res[0] + res[1] == 0) return cur; while (r - l > 1) { int m = (r + l) >> 1; res = ask(m); if (res[0] + res[1] == 0) return m; if (res[0] <= cn) l = m; else r = m; } res = ask(r); if (res[0] + res[1] == 0) return r; if (res[0] <= cn) l = r; cur = l + 1; if (cur > n - 1) break; } }

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp: In function 'int find_best(int)':
prize.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...