Submission #41846

# Submission time Handle Problem Language Result Execution time Memory
41846 2018-02-21T15:09:36 Z rahasia The Big Prize (IOI17_prize) C++14
20 / 100
30 ms 2020 KB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int l,r,c,ma;
int find_best(int n) {
	for(int i = 0; i < n; i++) {
		std::vector<int> res = ask(i);
		if(res[0] + res[1] == 0)
			return i;
//		ma=max(ma,res[0]+res[1]);
//		if(res[0]+res[1]<ma)
//			continue;
		l=i+1;
		r=n-1;
		while(l<=r)
		{
			c=(l+r)/2;
			vector<int> hv=ask(c);
			if(hv==res)
			{
				i=c;
				l=c+1;
			}
			else
				r=c-1;
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2020 KB Output is correct
2 Correct 1 ms 2020 KB Output is correct
3 Correct 0 ms 2020 KB Output is correct
4 Correct 0 ms 2020 KB Output is correct
5 Correct 1 ms 2020 KB Output is correct
6 Correct 0 ms 2020 KB Output is correct
7 Correct 1 ms 2020 KB Output is correct
8 Correct 1 ms 2020 KB Output is correct
9 Correct 1 ms 2020 KB Output is correct
10 Correct 1 ms 2020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2020 KB Output is correct
2 Correct 0 ms 2020 KB Output is correct
3 Correct 1 ms 2020 KB Output is correct
4 Correct 0 ms 2020 KB Output is correct
5 Correct 1 ms 2020 KB Output is correct
6 Correct 0 ms 2020 KB Output is correct
7 Correct 1 ms 2020 KB Output is correct
8 Correct 1 ms 2020 KB Output is correct
9 Correct 0 ms 2020 KB Output is correct
10 Correct 0 ms 2020 KB Output is correct
11 Correct 1 ms 2020 KB Output is correct
12 Correct 0 ms 2020 KB Output is correct
13 Correct 1 ms 2020 KB Output is correct
14 Correct 2 ms 2020 KB Output is correct
15 Correct 10 ms 2020 KB Output is correct
16 Incorrect 30 ms 2020 KB Incorrect
17 Halted 0 ms 0 KB -