제출 #430447

#제출 시각아이디문제언어결과실행 시간메모리
430447Icebear16커다란 상품 (IOI17_prize)C++14
0 / 100
144 ms288 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int find_best(int n){ vector<int> a; double j=0,k=n,h; while((k-j)!=1){ h=ceil(((k-j)/2)+j); a=ask(h); if(a[0]==0 && a[1]==0){ return h; break; }else if(a[0]<a[1]){ if(h==n-2){ return (n-1); break; } j=ceil((k-j)/2); }else if(a[0]>a[1]){ if(h==1){ return 0; break; } k=ceil(((k-j)/2)+j); } } }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:7:14: warning: control reaches end of non-void function [-Wreturn-type]
    7 |  vector<int> a;
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...