Submission #426738

# Submission time Handle Problem Language Result Execution time Memory
426738 2021-06-14T09:29:04 Z Hazem The Big Prize (IOI17_prize) C++14
90 / 100
167 ms 328 KB
#include "prize.h"
#include <bits/stdc++.h>

using namespace std;

int find_best(int n) {

	vector<int>cur = ask(0);
	int idx = 0;
	if(!cur[0]&&!cur[1])
		return 0;

	while(1){
		
		int l = idx,r = min(n-1,idx+900);
		int premid = -1;
		while(l<r){
			int mid = (l+r+1)/2;
			assert(premid!=mid);
			premid = mid;
			if(ask(mid)==cur)l = mid;
			else r = mid-1;
		}
		cur = ask(l+1);
		idx = l+1;
		assert(idx<n);
		if(!cur[0]&&!cur[1])
			return idx;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 280 KB Output is correct
2 Correct 7 ms 264 KB Output is correct
3 Correct 19 ms 200 KB Output is correct
4 Correct 30 ms 284 KB Output is correct
5 Correct 6 ms 288 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 18 ms 284 KB Output is correct
8 Correct 12 ms 288 KB Output is correct
9 Correct 18 ms 200 KB Output is correct
10 Correct 40 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 284 KB Output is correct
2 Correct 14 ms 200 KB Output is correct
3 Correct 20 ms 264 KB Output is correct
4 Correct 15 ms 280 KB Output is correct
5 Correct 10 ms 280 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 18 ms 200 KB Output is correct
8 Correct 16 ms 200 KB Output is correct
9 Correct 18 ms 200 KB Output is correct
10 Correct 21 ms 200 KB Output is correct
11 Correct 14 ms 256 KB Output is correct
12 Correct 1 ms 284 KB Output is correct
13 Correct 14 ms 276 KB Output is correct
14 Correct 5 ms 200 KB Output is correct
15 Correct 23 ms 200 KB Output is correct
16 Partially correct 38 ms 276 KB Partially correct - number of queries: 8050
17 Correct 1 ms 284 KB Output is correct
18 Partially correct 130 ms 200 KB Partially correct - number of queries: 9747
19 Correct 1 ms 200 KB Output is correct
20 Correct 28 ms 284 KB Output is correct
21 Correct 31 ms 200 KB Output is correct
22 Correct 10 ms 200 KB Output is correct
23 Correct 3 ms 200 KB Output is correct
24 Correct 2 ms 200 KB Output is correct
25 Partially correct 59 ms 200 KB Partially correct - number of queries: 5519
26 Partially correct 72 ms 284 KB Partially correct - number of queries: 5437
27 Correct 10 ms 200 KB Output is correct
28 Partially correct 98 ms 200 KB Partially correct - number of queries: 9805
29 Partially correct 119 ms 264 KB Partially correct - number of queries: 7459
30 Partially correct 153 ms 264 KB Partially correct - number of queries: 9817
31 Correct 1 ms 264 KB Output is correct
32 Correct 39 ms 264 KB Output is correct
33 Correct 1 ms 200 KB Output is correct
34 Correct 43 ms 264 KB Output is correct
35 Correct 15 ms 284 KB Output is correct
36 Correct 38 ms 200 KB Output is correct
37 Correct 7 ms 272 KB Output is correct
38 Correct 3 ms 280 KB Output is correct
39 Correct 35 ms 280 KB Output is correct
40 Partially correct 82 ms 200 KB Partially correct - number of queries: 8378
41 Partially correct 74 ms 280 KB Partially correct - number of queries: 5371
42 Partially correct 39 ms 284 KB Partially correct - number of queries: 5371
43 Correct 68 ms 280 KB Output is correct
44 Correct 34 ms 200 KB Output is correct
45 Correct 30 ms 200 KB Output is correct
46 Correct 1 ms 284 KB Output is correct
47 Correct 50 ms 284 KB Output is correct
48 Partially correct 76 ms 200 KB Partially correct - number of queries: 6921
49 Correct 9 ms 200 KB Output is correct
50 Partially correct 105 ms 268 KB Partially correct - number of queries: 9728
51 Correct 50 ms 200 KB Output is correct
52 Correct 1 ms 200 KB Output is correct
53 Correct 22 ms 200 KB Output is correct
54 Correct 38 ms 280 KB Output is correct
55 Correct 1 ms 320 KB Output is correct
56 Partially correct 94 ms 200 KB Partially correct - number of queries: 9739
57 Partially correct 53 ms 324 KB Partially correct - number of queries: 6897
58 Partially correct 96 ms 200 KB Partially correct - number of queries: 7009
59 Partially correct 84 ms 200 KB Partially correct - number of queries: 5371
60 Partially correct 32 ms 272 KB Partially correct - number of queries: 5220
61 Correct 36 ms 200 KB Output is correct
62 Correct 3 ms 200 KB Output is correct
63 Correct 11 ms 272 KB Output is correct
64 Correct 28 ms 200 KB Output is correct
65 Correct 23 ms 200 KB Output is correct
66 Correct 19 ms 200 KB Output is correct
67 Correct 21 ms 200 KB Output is correct
68 Correct 1 ms 200 KB Output is correct
69 Correct 34 ms 200 KB Output is correct
70 Correct 36 ms 200 KB Output is correct
71 Partially correct 131 ms 200 KB Partially correct - number of queries: 9901
72 Correct 30 ms 200 KB Output is correct
73 Partially correct 160 ms 200 KB Partially correct - number of queries: 9754
74 Partially correct 134 ms 200 KB Partially correct - number of queries: 9817
75 Correct 37 ms 200 KB Output is correct
76 Partially correct 105 ms 200 KB Partially correct - number of queries: 8654
77 Partially correct 161 ms 200 KB Partially correct - number of queries: 9819
78 Correct 33 ms 200 KB Output is correct
79 Partially correct 85 ms 200 KB Partially correct - number of queries: 5699
80 Partially correct 97 ms 284 KB Partially correct - number of queries: 9832
81 Partially correct 167 ms 200 KB Partially correct - number of queries: 9859
82 Partially correct 149 ms 200 KB Partially correct - number of queries: 9756
83 Correct 33 ms 200 KB Output is correct
84 Partially correct 120 ms 200 KB Partially correct - number of queries: 8426
85 Partially correct 139 ms 200 KB Partially correct - number of queries: 9880
86 Correct 32 ms 200 KB Output is correct
87 Correct 34 ms 200 KB Output is correct
88 Correct 23 ms 200 KB Output is correct
89 Correct 45 ms 200 KB Output is correct
90 Correct 29 ms 200 KB Output is correct
91 Correct 18 ms 200 KB Output is correct
92 Correct 35 ms 200 KB Output is correct
93 Correct 37 ms 200 KB Output is correct
94 Correct 42 ms 200 KB Output is correct
95 Correct 40 ms 200 KB Output is correct
96 Correct 38 ms 200 KB Output is correct
97 Correct 20 ms 200 KB Output is correct