Submission #1164679

#TimeUsernameProblemLanguageResultExecution timeMemory
1164679SmuggingSpun커다란 상품 (IOI17_prize)C++20
20 / 100
23 ms408 KiB
#include<bits/stdc++.h>
#include "prize.h"
using namespace std;
int find_best(int n) {
	int low = 0, high = n - 1;
    while(low <= high){
        int mid = (low + high) >> 1;
        vector<int>ret = ask(mid);
        if(ret[0] == 0 && ret[1] == 0){
            return mid;
        }
        if(ret[0] == 1){
            high = mid - 1;
        }
        else{
            low = mid + 1;
        }
    }
}

Compilation message (stderr)

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