답안 #134392

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
134392 2019-07-22T15:36:44 Z rondojim 커다란 상품 (IOI17_prize) C++17
90 / 100
109 ms 5496 KB
#include "prize.h"
#include <bits/stdc++.h>

using namespace std;

const int N = 200000, buk = 480;
 
vector<int> res[N];
int n, mx = -1;

vector<int> ASK(int p){
	if(res[p].size()) return res[p];
	return res[p] = ask(p);
}
 
int FIND(int l,int r){
	if(l == r){
		vector<int> tmp = ASK(l);
		if(tmp[0] == 0 && tmp[1] == 0) return l;
		return -1;
	}
	vector<int> tmp1, tmp2;
	tmp1 = ASK(l);
	tmp2 = ASK(r);
	if(tmp1[0] == 0 && tmp1[1] == 0) return l;
	if(tmp2[0] == 0 && tmp2[1] == 0) return r;
	int md = (l + r)/2;
	if(tmp1 == tmp2) return -1;
	int t = FIND(l, md);
	int t2 = FIND(md + 1, r);
	if(t != -1) return t;
	return t2;
}
 
 
int find_best(int _N) {
	n = _N;
	return FIND(0,n - 1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4984 KB Output is correct
2 Correct 7 ms 4984 KB Output is correct
3 Correct 6 ms 5004 KB Output is correct
4 Correct 6 ms 5092 KB Output is correct
5 Correct 6 ms 4984 KB Output is correct
6 Correct 6 ms 5008 KB Output is correct
7 Correct 6 ms 4984 KB Output is correct
8 Correct 5 ms 4984 KB Output is correct
9 Correct 6 ms 5028 KB Output is correct
10 Correct 6 ms 4984 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4984 KB Output is correct
2 Correct 7 ms 5012 KB Output is correct
3 Correct 7 ms 5004 KB Output is correct
4 Correct 6 ms 5088 KB Output is correct
5 Correct 6 ms 4984 KB Output is correct
6 Correct 7 ms 5012 KB Output is correct
7 Correct 7 ms 5012 KB Output is correct
8 Correct 6 ms 4984 KB Output is correct
9 Correct 6 ms 5012 KB Output is correct
10 Correct 7 ms 4984 KB Output is correct
11 Correct 20 ms 5032 KB Output is correct
12 Correct 11 ms 5164 KB Output is correct
13 Correct 16 ms 5144 KB Output is correct
14 Correct 26 ms 5112 KB Output is correct
15 Partially correct 101 ms 5232 KB Partially correct - number of queries: 7760
16 Partially correct 93 ms 5260 KB Partially correct - number of queries: 8133
17 Partially correct 87 ms 5240 KB Partially correct - number of queries: 8135
18 Partially correct 86 ms 5244 KB Partially correct - number of queries: 8135
19 Partially correct 85 ms 5308 KB Partially correct - number of queries: 7684
20 Partially correct 46 ms 5160 KB Partially correct - number of queries: 5258
21 Partially correct 80 ms 5496 KB Partially correct - number of queries: 8082
22 Partially correct 68 ms 5240 KB Partially correct - number of queries: 6249
23 Correct 9 ms 5008 KB Output is correct
24 Correct 13 ms 4984 KB Output is correct
25 Partially correct 87 ms 5240 KB Partially correct - number of queries: 7391
26 Partially correct 77 ms 5240 KB Partially correct - number of queries: 7388
27 Correct 9 ms 4984 KB Output is correct
28 Partially correct 93 ms 5168 KB Partially correct - number of queries: 7281
29 Partially correct 47 ms 5252 KB Partially correct - number of queries: 6202
30 Partially correct 83 ms 5240 KB Partially correct - number of queries: 8075
31 Partially correct 94 ms 5200 KB Partially correct - number of queries: 8080
32 Correct 14 ms 4984 KB Output is correct
33 Correct 6 ms 4988 KB Output is correct
34 Partially correct 82 ms 5356 KB Partially correct - number of queries: 8139
35 Correct 10 ms 5016 KB Output is correct
36 Partially correct 76 ms 5188 KB Partially correct - number of queries: 8070
37 Correct 10 ms 5064 KB Output is correct
38 Correct 8 ms 4984 KB Output is correct
39 Partially correct 83 ms 5376 KB Partially correct - number of queries: 8072
40 Partially correct 78 ms 5112 KB Partially correct - number of queries: 7045
41 Partially correct 58 ms 5220 KB Partially correct - number of queries: 8134
42 Partially correct 87 ms 5212 KB Partially correct - number of queries: 8134
43 Partially correct 82 ms 5280 KB Partially correct - number of queries: 7909
44 Partially correct 96 ms 5240 KB Partially correct - number of queries: 8128
45 Partially correct 80 ms 5240 KB Partially correct - number of queries: 7340
46 Partially correct 94 ms 5368 KB Partially correct - number of queries: 8126
47 Partially correct 89 ms 5228 KB Partially correct - number of queries: 7436
48 Partially correct 85 ms 5240 KB Partially correct - number of queries: 8135
49 Partially correct 84 ms 5268 KB Partially correct - number of queries: 8128
50 Partially correct 85 ms 5240 KB Partially correct - number of queries: 8128
51 Partially correct 89 ms 5240 KB Partially correct - number of queries: 8132
52 Partially correct 65 ms 5200 KB Partially correct - number of queries: 8127
53 Correct 7 ms 4904 KB Output is correct
54 Partially correct 85 ms 5224 KB Partially correct - number of queries: 8061
55 Partially correct 86 ms 5268 KB Partially correct - number of queries: 8131
56 Partially correct 86 ms 5252 KB Partially correct - number of queries: 8129
57 Partially correct 49 ms 5284 KB Partially correct - number of queries: 8073
58 Partially correct 85 ms 5292 KB Partially correct - number of queries: 8138
59 Partially correct 79 ms 5268 KB Partially correct - number of queries: 8134
60 Partially correct 90 ms 5152 KB Partially correct - number of queries: 8076
61 Correct 8 ms 5040 KB Output is correct
62 Correct 9 ms 5012 KB Output is correct
63 Correct 9 ms 4988 KB Output is correct
64 Correct 8 ms 4984 KB Output is correct
65 Correct 7 ms 5028 KB Output is correct
66 Correct 7 ms 5012 KB Output is correct
67 Correct 7 ms 4904 KB Output is correct
68 Correct 7 ms 5008 KB Output is correct
69 Correct 7 ms 5120 KB Output is correct
70 Correct 7 ms 4984 KB Output is correct
71 Partially correct 62 ms 5268 KB Partially correct - number of queries: 8104
72 Correct 18 ms 4984 KB Output is correct
73 Partially correct 89 ms 5240 KB Partially correct - number of queries: 7999
74 Partially correct 55 ms 5328 KB Partially correct - number of queries: 8044
75 Correct 8 ms 4984 KB Output is correct
76 Partially correct 74 ms 5160 KB Partially correct - number of queries: 7024
77 Partially correct 88 ms 5368 KB Partially correct - number of queries: 8114
78 Correct 11 ms 5124 KB Output is correct
79 Correct 46 ms 5112 KB Output is correct
80 Partially correct 109 ms 5164 KB Partially correct - number of queries: 8110
81 Partially correct 63 ms 5216 KB Partially correct - number of queries: 8110
82 Partially correct 90 ms 5292 KB Partially correct - number of queries: 8036
83 Correct 8 ms 5120 KB Output is correct
84 Partially correct 82 ms 5240 KB Partially correct - number of queries: 6790
85 Partially correct 85 ms 5332 KB Partially correct - number of queries: 8107
86 Correct 24 ms 4984 KB Output is correct
87 Correct 11 ms 4988 KB Output is correct
88 Correct 19 ms 4988 KB Output is correct
89 Correct 13 ms 5052 KB Output is correct
90 Correct 7 ms 5120 KB Output is correct
91 Correct 13 ms 5112 KB Output is correct
92 Correct 7 ms 4984 KB Output is correct
93 Correct 15 ms 5112 KB Output is correct
94 Correct 13 ms 5112 KB Output is correct
95 Correct 11 ms 5132 KB Output is correct
96 Correct 13 ms 5112 KB Output is correct
97 Correct 6 ms 4988 KB Output is correct