Submission #566530

# Submission time Handle Problem Language Result Execution time Memory
566530 2022-05-22T11:31:57 Z sofapuden The Big Prize (IOI17_prize) C++14
20 / 100
65 ms 1304 KB
#include "prize.h"
#include<bits/stdc++.h>

using namespace std;

int f(int l, int r){
	int m = (l+r)/2;
	vector<int> v = ask(m);
	if(v[0] == 0 && v[1] == 0)return m;
	if(l == r)return -1;
	if(v[1] > v[0]){
		int x = f(m+1,r);
		if(x != -1)return x;
	}
	return f(l,m-1);
}

int find_best(int n) {
	return f(0,n-1);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 288 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 1 ms 292 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 292 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 288 KB Output is correct
9 Correct 1 ms 292 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Incorrect 65 ms 1304 KB Incorrect
12 Halted 0 ms 0 KB -