답안 #64451

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
64451 2018-08-04T13:49:50 Z nvmdava 커다란 상품 (IOI17_prize) C++17
0 / 100
8 ms 5072 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;


vector<int> ans[200500];
int mx = -1;
int find(int l, int r){
	if(ans[l][0] == ans[r][0]){
		return 0;
	}
	int m = (l + r) >> 1, L = m, R = m + 1;
	while(l < L){
		ans[L] =ask(L);
		if(ans[L][0] + ans[L][1] == mx){
			break;
		}
		if(ans[L][0] + ans[L][1] == 0){
			return L;
		}
		L--;
	}
	while(r > R){
		ans[R] =ask(R);
		if(ans[R][0] + ans[R][1] == mx){
			break;
		}
		if(ans[R][0] + ans[R][1] == 0){
			return R;
		}
		R++;
	}
	return max(find(l, L), find(r, R));
}

int find_best(int n) {
  return 3;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 4900 KB answer is not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 5072 KB answer is not correct
2 Halted 0 ms 0 KB -