제출 #415142

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4151422021-05-31 15:10:55Bill_00커다란 상품 (IOI17_prize)C++14
97.61 / 100
87 ms1952 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int l[200005],r[200005],x[200005],answer=-1;
void solve(int L,int R){
if(answer!=-1) return;
if(L+1==R){
return;
}
int m=(L+R)>>1;
vector<int>res=ask(m);
l[m]=res[0];
r[m]=res[1];
if(l[m]+r[m]==0){
answer=m;
return;
}
if(l[m]!=l[R] || r[m]!=r[R]){
solve(m,R);
}
if(answer!=-1) return;
if(l[m]!=l[L] || r[m]!=r[L]){
solve(L,m);
}
}
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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp: In function 'int find_best(int)':
prize.cpp:35:6: warning: unused variable 'm' [-Wunused-variable]
   35 |  int m=(n-1)/2;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...