제출 #69466

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
694662018-08-21 01:53:11DiuvenThe Big Prize (IOI17_prize)C++14
20 / 100
67 ms2424 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
const int MX=200010;
bool up[MX];
int L[MX], R[MX], sum, n, ans;
void my_ask(int i){
static set<int> S;
if(S.find(i)!=S.end()) return;
S.insert(i);
vi now=ask(i);
L[i]=now[0], R[i]=now[1];
}
void search(int s, int e, int lc, int rc){
if(s>e) return;
int m=(s+e)/2;
for(int i=m; i<=e; i++){
my_ask(i);
if(L[i]+R[i]==0) ans=i;
if(L[i]+R[i]==sum){
if(lc<L[i]-(i-m)) search(s,m-1,lc,R[i]+i-m);
if(rc<R[i]) search(i+1,e,L[i],rc);
break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...