제출 #80294

#제출 시각아이디문제언어결과실행 시간메모리
80294giorgikob커다란 상품 (IOI17_prize)C++14
20 / 100
93 ms612 KiB
#include "prize.h" #include<bits/stdc++.h> #define F first #define S second using namespace std; pair<int,int>p,p1; vector<int>v,v1; int ans=0; void go(int L,int R) { if(L>R)return; if(L==R) { v=ask(L); if(v[0]+v[1]==0) { ans=L; return; } } else { v=ask(L); if(v[0]+v[1]==0) { ans=L; return; } v1=ask(R); if(v1[0]+v1[1]==0) { ans=R; return; } if(v[0]==v1[0] || v[1]==v1[1])return; int mid=(L+R)/2; go(L+1,mid); go(mid+1,R-1); } } int find_best(int n) { go(0,n-1); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...