답안 #41844

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
41844 2018-02-21T15:07:18 Z rahasia 커다란 상품 (IOI17_prize) C++14
20 / 100
19 ms 2020 KB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int l,r,c;
int find_best(int n) {
	for(int i = 0; i < n; i++) {
		std::vector<int> res = ask(i);
		if(res[0] + res[1] == 0)
			return i;
		l=i;
		r=n-1;
		while(l<=r)
		{
			c=(l+r)/2;
			vector<int> hv=ask(c);
			if(hv==res)
			{
				i=c;
				l=c+1;
			}
			else
				r=c-1;
		}
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2020 KB Output is correct
2 Correct 0 ms 2020 KB Output is correct
3 Correct 0 ms 2020 KB Output is correct
4 Correct 0 ms 2020 KB Output is correct
5 Correct 0 ms 2020 KB Output is correct
6 Correct 0 ms 2020 KB Output is correct
7 Correct 0 ms 2020 KB Output is correct
8 Correct 1 ms 2020 KB Output is correct
9 Correct 0 ms 2020 KB Output is correct
10 Correct 0 ms 2020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2020 KB Output is correct
2 Correct 0 ms 2020 KB Output is correct
3 Correct 1 ms 2020 KB Output is correct
4 Correct 1 ms 2020 KB Output is correct
5 Correct 0 ms 2020 KB Output is correct
6 Correct 0 ms 2020 KB Output is correct
7 Correct 1 ms 2020 KB Output is correct
8 Correct 1 ms 2020 KB Output is correct
9 Correct 0 ms 2020 KB Output is correct
10 Correct 0 ms 2020 KB Output is correct
11 Correct 1 ms 2020 KB Output is correct
12 Correct 1 ms 2020 KB Output is correct
13 Correct 17 ms 2020 KB Output is correct
14 Correct 7 ms 2020 KB Output is correct
15 Correct 6 ms 2020 KB Output is correct
16 Incorrect 19 ms 2020 KB Incorrect
17 Halted 0 ms 0 KB -