제출 #135105

#제출 시각아이디문제언어결과실행 시간메모리
135105alexandra_udristoiu커다란 상품 (IOI17_prize)C++14
0 / 100
3 ms504 KiB
#include<iostream> #include<vector> #include "prize.h" using namespace std; int find_best(int n){ int nr, p, st, dr, mid; vector<int> a; a = ask(0); if(a[1] == 0){ return 1; } p = 0; nr = a[1]; while(nr > 0){ st = p + 1; dr = n; while(st <= dr){ mid = (st + dr) / 2; a = ask(mid); if(a[1] == nr){ st = mid + 1; } else{ dr = mid - 1; } } a = ask(st); if(a[1] == 0){ return st; } p = st + 1; nr--; } }

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

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