Submission #335669

# Submission time Handle Problem Language Result Execution time Memory
335669 2020-12-13T15:28:19 Z couplefire The Big Prize (IOI17_prize) C++17
90 / 100
114 ms 512 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

int find_best(int n) {
    if(n == 1) return 0;
    int mx = 0;
	for(int i = 0; i<min(500, n); i++){
        vector<int> vv = ask(i);
        mx = max(mx, vv.front()+vv.back());
    }
    int cur = 0;
    for(int i = 0; i<mx; i++){
        int lo = cur, hi = n-1;
        while(lo < hi){
            int mid = lo+(hi-lo)/2;
            vector<int> vv = ask(mid);
            int a = vv.front(), b = vv.back();
            if(a+b < mx) hi = mid;
            else if(a == i) lo = mid+1;
            else hi = mid-1;
        }
        vector<int> vvv = ask(lo);
        if(vvv.front()+vvv.back() == 0) return lo;
        cur = lo+1; 
    }
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 364 KB Output is correct
2 Correct 6 ms 364 KB Output is correct
3 Correct 6 ms 364 KB Output is correct
4 Correct 4 ms 364 KB Output is correct
5 Correct 5 ms 364 KB Output is correct
6 Correct 7 ms 364 KB Output is correct
7 Correct 7 ms 364 KB Output is correct
8 Correct 3 ms 492 KB Output is correct
9 Correct 4 ms 364 KB Output is correct
10 Correct 7 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 364 KB Output is correct
2 Correct 4 ms 364 KB Output is correct
3 Correct 7 ms 364 KB Output is correct
4 Correct 7 ms 364 KB Output is correct
5 Correct 7 ms 364 KB Output is correct
6 Correct 3 ms 492 KB Output is correct
7 Correct 5 ms 364 KB Output is correct
8 Correct 7 ms 364 KB Output is correct
9 Correct 5 ms 364 KB Output is correct
10 Correct 5 ms 364 KB Output is correct
11 Correct 8 ms 364 KB Output is correct
12 Correct 5 ms 364 KB Output is correct
13 Correct 8 ms 364 KB Output is correct
14 Correct 9 ms 364 KB Output is correct
15 Correct 23 ms 364 KB Output is correct
16 Partially correct 67 ms 364 KB Partially correct - number of queries: 7197
17 Correct 6 ms 364 KB Output is correct
18 Partially correct 86 ms 364 KB Partially correct - number of queries: 8352
19 Correct 3 ms 512 KB Output is correct
20 Correct 32 ms 364 KB Output is correct
21 Correct 31 ms 364 KB Output is correct
22 Correct 14 ms 364 KB Output is correct
23 Correct 5 ms 364 KB Output is correct
24 Correct 7 ms 364 KB Output is correct
25 Correct 44 ms 364 KB Output is correct
26 Correct 43 ms 364 KB Output is correct
27 Correct 6 ms 364 KB Output is correct
28 Partially correct 77 ms 364 KB Partially correct - number of queries: 7987
29 Partially correct 50 ms 492 KB Partially correct - number of queries: 6187
30 Partially correct 66 ms 364 KB Partially correct - number of queries: 8279
31 Correct 5 ms 364 KB Output is correct
32 Correct 10 ms 364 KB Output is correct
33 Correct 2 ms 364 KB Output is correct
34 Correct 28 ms 364 KB Output is correct
35 Correct 6 ms 364 KB Output is correct
36 Correct 17 ms 364 KB Output is correct
37 Correct 7 ms 364 KB Output is correct
38 Correct 7 ms 364 KB Output is correct
39 Correct 30 ms 364 KB Output is correct
40 Partially correct 60 ms 364 KB Partially correct - number of queries: 7146
41 Partially correct 42 ms 364 KB Partially correct - number of queries: 5216
42 Partially correct 42 ms 364 KB Partially correct - number of queries: 5216
43 Correct 41 ms 492 KB Output is correct
44 Correct 32 ms 364 KB Output is correct
45 Correct 33 ms 364 KB Output is correct
46 Correct 5 ms 512 KB Output is correct
47 Correct 42 ms 364 KB Output is correct
48 Partially correct 60 ms 364 KB Partially correct - number of queries: 6323
49 Correct 11 ms 364 KB Output is correct
50 Partially correct 75 ms 364 KB Partially correct - number of queries: 8354
51 Correct 30 ms 364 KB Output is correct
52 Correct 6 ms 364 KB Output is correct
53 Correct 6 ms 364 KB Output is correct
54 Correct 35 ms 364 KB Output is correct
55 Correct 5 ms 364 KB Output is correct
56 Partially correct 64 ms 364 KB Partially correct - number of queries: 8343
57 Partially correct 54 ms 364 KB Partially correct - number of queries: 6238
58 Partially correct 36 ms 368 KB Partially correct - number of queries: 6348
59 Partially correct 47 ms 364 KB Partially correct - number of queries: 5217
60 Correct 26 ms 492 KB Output is correct
61 Correct 6 ms 364 KB Output is correct
62 Correct 3 ms 368 KB Output is correct
63 Correct 7 ms 364 KB Output is correct
64 Correct 6 ms 364 KB Output is correct
65 Correct 9 ms 364 KB Output is correct
66 Correct 35 ms 364 KB Output is correct
67 Correct 5 ms 364 KB Output is correct
68 Partially correct 72 ms 364 KB Partially correct - number of queries: 8991
69 Correct 44 ms 364 KB Output is correct
70 Correct 7 ms 364 KB Output is correct
71 Partially correct 67 ms 364 KB Partially correct - number of queries: 8301
72 Correct 10 ms 364 KB Output is correct
73 Partially correct 67 ms 364 KB Partially correct - number of queries: 8184
74 Partially correct 64 ms 364 KB Partially correct - number of queries: 8256
75 Correct 8 ms 364 KB Output is correct
76 Partially correct 54 ms 364 KB Partially correct - number of queries: 7141
77 Partially correct 83 ms 364 KB Partially correct - number of queries: 8345
78 Correct 9 ms 364 KB Output is correct
79 Correct 37 ms 364 KB Output is correct
80 Partially correct 79 ms 364 KB Partially correct - number of queries: 8350
81 Partially correct 71 ms 364 KB Partially correct - number of queries: 8330
82 Partially correct 67 ms 364 KB Partially correct - number of queries: 8290
83 Correct 6 ms 364 KB Output is correct
84 Partially correct 64 ms 364 KB Partially correct - number of queries: 6926
85 Partially correct 76 ms 364 KB Partially correct - number of queries: 8385
86 Partially correct 77 ms 364 KB Partially correct - number of queries: 9465
87 Correct 10 ms 384 KB Output is correct
88 Partially correct 53 ms 364 KB Partially correct - number of queries: 8952
89 Partially correct 80 ms 364 KB Partially correct - number of queries: 9389
90 Correct 5 ms 364 KB Output is correct
91 Partially correct 51 ms 364 KB Partially correct - number of queries: 5665
92 Partially correct 86 ms 364 KB Partially correct - number of queries: 8990
93 Partially correct 94 ms 364 KB Partially correct - number of queries: 9418
94 Partially correct 77 ms 364 KB Partially correct - number of queries: 9421
95 Partially correct 114 ms 364 KB Partially correct - number of queries: 9405
96 Partially correct 85 ms 364 KB Partially correct - number of queries: 9338
97 Partially correct 79 ms 364 KB Partially correct - number of queries: 8990