제출 #1321612

#제출 시각아이디문제언어결과실행 시간메모리
1321612kasamchi커다란 상품 (IOI17_prize)C++20
0 / 100
26 ms400 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

int find_best(int n) {
	int l = 0, r = n - 1;
    while (l + 1 < r) {
        int m = l + (r - l) / 2;
        vector<int> res = ask(m);
        if (res[0] == 1) {
            r = m;
        } else if (res[1] == 1) {
            l = m;
        } else {
            return m;
        }
    }
}

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

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