Submission #137398

#TimeUsernameProblemLanguageResultExecution timeMemory
137398wilwxkThe Big Prize (IOI17_prize)C++14
20 / 100
3 ms396 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; int bbi(int ini, int fim) { if(ini==fim) return ini-1; int mid=ini+fim; mid/=2; vector<int> aux=ask(mid-1); // printf("%d %d :: %d >> %d %d\n", ini, fim, mid, aux[0], aux[1]); if(aux[0]==aux[1]&&aux[0]==0) return mid-1; if(aux[0]) return bbi(ini, mid-1); else return bbi(mid+1, fim); } int find_best(int n) { // printf("asd %d\n", bbi(1, n)); return bbi(1, n); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...