Submission #523601

# Submission time Handle Problem Language Result Execution time Memory
523601 2022-02-07T22:02:08 Z dron_rp The Big Prize (IOI17_prize) C++14
20 / 100
95 ms 328 KB
#include "prize.h"

using namespace std;

int find_best(int n) {
	int lo = 0, hi = n-1;
	while (lo<=hi){
		int mid = lo + (hi-lo)/2;
		vector<int> ans = ask(mid);
		if (ans[0] == 0 && ans[1] == 0) return mid;
		else if (ans[0] > ans[1]){
			hi = mid-1;
		} else{
			lo = mid+1;
		}
	}
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 260 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 0 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 260 KB Output is correct
3 Correct 1 ms 260 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 0 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 264 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 0 ms 328 KB Output is correct
10 Correct 1 ms 284 KB Output is correct
11 Incorrect 95 ms 200 KB Incorrect
12 Halted 0 ms 0 KB -