제출 #1164692

#제출 시각아이디문제언어결과실행 시간메모리
1164692SmuggingSpunThe Big Prize (IOI17_prize)C++20
0 / 100
1070 ms11156 KiB
#include<bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { vector<vector<int>>cnt(n, vector<int>(2, -1)); auto id = [&] (int i){ if(cnt[i][0] != -1){ return cnt[i]; } return cnt[i] = ask(i); }; for(int i = 0; i < n; ){ if(id(i)[0] == 0 && id(i)[1] == 0){ return i; } if(id(i) != id(i + 1)){ i++; } else{ int low = i + 2, high = n - 2, p = n - 1; while(low <= high){ int mid = (low + high) >> 1; if(id(i) != id(mid)){ high = (p = mid) - 1; } else{ } } i = p; } } }

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

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