제출 #1053300

#제출 시각아이디문제언어결과실행 시간메모리
1053300Unforgettablepl커다란 상품 (IOI17_prize)C++17
20 / 100
51 ms432 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; const int THRESHOLD = 400; const int THRESHOLD_JUMP = 400; const int BIGGER_JUMP = 131072; int find_best(int n){ int moves = 0; for(int i=0;i<n;i++) { assert(++moves<10000); auto base = ask(i); int curr = base[0]+base[1]; if(curr==0)return i; if(curr>THRESHOLD) { for(int jump=BIGGER_JUMP;jump;jump/=2) { if(i+jump>=n)continue; assert(++moves<10000); auto temp = ask(i+jump); if(temp==base)i+=jump; } } else { int curradded = 0; for(int jump=256;jump;jump/=2) { if(i+jump>=n)continue; if(curradded+jump>THRESHOLD_JUMP)continue; assert(++moves<10000); auto temp = ask(i+jump); if(temp==base){ i+=jump; curradded+=jump; } } } } }

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

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