답안 #70805

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70805 2018-08-23T13:17:06 Z bnahmad15 커다란 상품 (IOI17_prize) C++17
90 / 100
140 ms 5740 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] == tmp1[1] && tmp1[0] == 0)
		return l;
	if(tmp2[0] == tmp2[1] && tmp2[0] == 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 9 ms 4984 KB Output is correct
2 Correct 9 ms 5044 KB Output is correct
3 Correct 8 ms 5044 KB Output is correct
4 Correct 8 ms 5044 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 8 ms 5196 KB Output is correct
7 Correct 7 ms 5196 KB Output is correct
8 Correct 8 ms 5196 KB Output is correct
9 Correct 7 ms 5196 KB Output is correct
10 Correct 7 ms 5256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 5256 KB Output is correct
2 Correct 10 ms 5260 KB Output is correct
3 Correct 7 ms 5260 KB Output is correct
4 Correct 9 ms 5260 KB Output is correct
5 Correct 8 ms 5260 KB Output is correct
6 Correct 7 ms 5260 KB Output is correct
7 Correct 7 ms 5260 KB Output is correct
8 Correct 8 ms 5260 KB Output is correct
9 Correct 7 ms 5260 KB Output is correct
10 Correct 7 ms 5260 KB Output is correct
11 Correct 19 ms 5260 KB Output is correct
12 Correct 13 ms 5260 KB Output is correct
13 Correct 13 ms 5260 KB Output is correct
14 Correct 18 ms 5308 KB Output is correct
15 Partially correct 78 ms 5544 KB Partially correct - number of queries: 7760
16 Partially correct 107 ms 5544 KB Partially correct - number of queries: 8133
17 Partially correct 91 ms 5544 KB Partially correct - number of queries: 8135
18 Partially correct 105 ms 5544 KB Partially correct - number of queries: 8135
19 Partially correct 82 ms 5544 KB Partially correct - number of queries: 7684
20 Partially correct 44 ms 5544 KB Partially correct - number of queries: 5258
21 Partially correct 93 ms 5572 KB Partially correct - number of queries: 8082
22 Partially correct 61 ms 5572 KB Partially correct - number of queries: 6249
23 Correct 10 ms 5572 KB Output is correct
24 Correct 21 ms 5572 KB Output is correct
25 Partially correct 93 ms 5572 KB Partially correct - number of queries: 7391
26 Partially correct 108 ms 5572 KB Partially correct - number of queries: 7388
27 Correct 9 ms 5572 KB Output is correct
28 Partially correct 95 ms 5596 KB Partially correct - number of queries: 7281
29 Partially correct 78 ms 5596 KB Partially correct - number of queries: 6202
30 Partially correct 117 ms 5596 KB Partially correct - number of queries: 8075
31 Partially correct 105 ms 5596 KB Partially correct - number of queries: 8080
32 Correct 17 ms 5596 KB Output is correct
33 Correct 7 ms 5596 KB Output is correct
34 Partially correct 105 ms 5644 KB Partially correct - number of queries: 8139
35 Correct 13 ms 5644 KB Output is correct
36 Partially correct 131 ms 5644 KB Partially correct - number of queries: 8070
37 Correct 23 ms 5644 KB Output is correct
38 Correct 12 ms 5644 KB Output is correct
39 Partially correct 104 ms 5644 KB Partially correct - number of queries: 8072
40 Partially correct 87 ms 5644 KB Partially correct - number of queries: 7045
41 Partially correct 115 ms 5644 KB Partially correct - number of queries: 8134
42 Partially correct 95 ms 5644 KB Partially correct - number of queries: 8134
43 Partially correct 102 ms 5644 KB Partially correct - number of queries: 7909
44 Partially correct 92 ms 5644 KB Partially correct - number of queries: 8128
45 Partially correct 86 ms 5644 KB Partially correct - number of queries: 7340
46 Partially correct 96 ms 5644 KB Partially correct - number of queries: 8126
47 Partially correct 44 ms 5644 KB Partially correct - number of queries: 7436
48 Partially correct 41 ms 5644 KB Partially correct - number of queries: 8135
49 Partially correct 97 ms 5644 KB Partially correct - number of queries: 8128
50 Partially correct 97 ms 5644 KB Partially correct - number of queries: 8128
51 Partially correct 86 ms 5644 KB Partially correct - number of queries: 8132
52 Partially correct 47 ms 5644 KB Partially correct - number of queries: 8127
53 Correct 8 ms 5644 KB Output is correct
54 Partially correct 140 ms 5644 KB Partially correct - number of queries: 8061
55 Partially correct 46 ms 5644 KB Partially correct - number of queries: 8131
56 Partially correct 95 ms 5740 KB Partially correct - number of queries: 8129
57 Partially correct 90 ms 5740 KB Partially correct - number of queries: 8073
58 Partially correct 40 ms 5740 KB Partially correct - number of queries: 8138
59 Partially correct 54 ms 5740 KB Partially correct - number of queries: 8134
60 Partially correct 116 ms 5740 KB Partially correct - number of queries: 8076
61 Correct 11 ms 5740 KB Output is correct
62 Correct 9 ms 5740 KB Output is correct
63 Correct 12 ms 5740 KB Output is correct
64 Correct 12 ms 5740 KB Output is correct
65 Correct 7 ms 5740 KB Output is correct
66 Correct 8 ms 5740 KB Output is correct
67 Correct 7 ms 5740 KB Output is correct
68 Correct 8 ms 5740 KB Output is correct
69 Correct 8 ms 5740 KB Output is correct
70 Correct 7 ms 5740 KB Output is correct
71 Partially correct 102 ms 5740 KB Partially correct - number of queries: 8104
72 Correct 12 ms 5740 KB Output is correct
73 Partially correct 94 ms 5740 KB Partially correct - number of queries: 7999
74 Partially correct 81 ms 5740 KB Partially correct - number of queries: 8044
75 Correct 8 ms 5740 KB Output is correct
76 Partially correct 81 ms 5740 KB Partially correct - number of queries: 7024
77 Partially correct 96 ms 5740 KB Partially correct - number of queries: 8114
78 Correct 17 ms 5740 KB Output is correct
79 Correct 51 ms 5740 KB Output is correct
80 Partially correct 54 ms 5740 KB Partially correct - number of queries: 8110
81 Partially correct 111 ms 5740 KB Partially correct - number of queries: 8110
82 Partially correct 120 ms 5740 KB Partially correct - number of queries: 8036
83 Correct 8 ms 5740 KB Output is correct
84 Partially correct 36 ms 5740 KB Partially correct - number of queries: 6790
85 Partially correct 67 ms 5740 KB Partially correct - number of queries: 8107
86 Correct 25 ms 5740 KB Output is correct
87 Correct 10 ms 5740 KB Output is correct
88 Correct 23 ms 5740 KB Output is correct
89 Correct 21 ms 5740 KB Output is correct
90 Correct 9 ms 5740 KB Output is correct
91 Correct 19 ms 5740 KB Output is correct
92 Correct 7 ms 5740 KB Output is correct
93 Correct 11 ms 5740 KB Output is correct
94 Correct 12 ms 5740 KB Output is correct
95 Correct 14 ms 5740 KB Output is correct
96 Correct 11 ms 5740 KB Output is correct
97 Correct 7 ms 5740 KB Output is correct