Submission #73390

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
733902018-08-28 08:12:06SmsSThe Big Prize (IOI17_prize)C++17
20 / 100
118 ms648 KiB
#include<bits/stdc++.h>
using namespace std;
#define for2(a,b,c) for(int a = b; a < c; a++)
#include "prize.h"
const bool test = 0;
int mn;
int cnt = 0;
set<int> st;
int solve(int l,int r,vector<int> L,vector<int> R){
if(l >= r) return -1;
if(l == r-1) return -1;
if(L[1]-R[1] == 0) return -1;
int mid = (l+r)/2;
vector<int> MIDL,MIDR;
int midl;
int midr;
midl = midr = mid;
midr++;
bool dn = 0;
int cnt = L[1]-R[1];
while(midl != l){
MIDL = ask(midl);
cnt++;
if(MIDL[0]+MIDL[1] == 0) return midl;
if(MIDL[0]+MIDL[1] != mn){
cnt--;
if(cnt <= 0 || !MIDL[0]){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:92:22: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return solve(l,r,L,R);
                      ^
prize.cpp:92:22: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...