답안 #1055349

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1055349 2024-08-12T17:51:27 Z phoenix 커다란 상품 (IOI17_prize) C++17
20 / 100
61 ms 5464 KB
#include "prize.h"
#include <bits/stdc++.h>

using namespace std;

const int N = 200200;

vector<int> arr[N];

vector<int> ASK(int p) {
	if (arr[p].empty())
		arr[p] = ask(p);
	return arr[p];	
}

int find_best(int n) {
	int i = 0;
	while (i < n) {
		int l = i, r = n;
		if (ASK(l)[0] + ASK(l)[1] == 0) {
			return l;
		}
		while (r - l > 1) {
			int m = (l + r) / 2;
			if (ASK(m) == ASK(l))
				l = m;
			else {
				if (ASK(m)[0] + ASK(m)[1] == 0) 
					return m;
				r = m;
			} 
		}
		i = r;
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 5128 KB Output is correct
7 Correct 1 ms 4952 KB Output is correct
8 Correct 1 ms 4952 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 5128 KB Output is correct
7 Correct 1 ms 4952 KB Output is correct
8 Correct 1 ms 5136 KB Output is correct
9 Correct 1 ms 4952 KB Output is correct
10 Correct 1 ms 4952 KB Output is correct
11 Correct 3 ms 4952 KB Output is correct
12 Correct 1 ms 4952 KB Output is correct
13 Correct 5 ms 4952 KB Output is correct
14 Correct 3 ms 4952 KB Output is correct
15 Correct 9 ms 5388 KB Output is correct
16 Incorrect 61 ms 5464 KB Incorrect
17 Halted 0 ms 0 KB -