답안 #55046

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
55046 2018-07-05T22:44:09 Z adamczh1 커다란 상품 (IOI17_prize) C++17
20 / 100
60 ms 556 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

int find_best(int n) {
	int lo = 0, hi = n - 1;
	while (1) {
		int mid = (lo + hi) / 2;
		vector<int> tmp = ask(mid);
		if (tmp[0]) {
			hi = mid - 1;
		} else if (tmp[1]) {
			lo = mid + 1;
		} else {
			return mid;
		}
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 440 KB Output is correct
3 Correct 2 ms 440 KB Output is correct
4 Correct 2 ms 524 KB Output is correct
5 Correct 2 ms 524 KB Output is correct
6 Correct 3 ms 524 KB Output is correct
7 Correct 4 ms 524 KB Output is correct
8 Correct 3 ms 524 KB Output is correct
9 Correct 2 ms 524 KB Output is correct
10 Correct 2 ms 524 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 524 KB Output is correct
2 Correct 2 ms 524 KB Output is correct
3 Correct 3 ms 528 KB Output is correct
4 Correct 2 ms 548 KB Output is correct
5 Correct 3 ms 556 KB Output is correct
6 Correct 2 ms 556 KB Output is correct
7 Correct 2 ms 556 KB Output is correct
8 Correct 2 ms 556 KB Output is correct
9 Correct 3 ms 556 KB Output is correct
10 Correct 3 ms 556 KB Output is correct
11 Incorrect 60 ms 556 KB Incorrect
12 Halted 0 ms 0 KB -