Submission #73541

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
735412018-08-28 12:02:17top34051Hotter Colder (IOI10_hottercolder)C++17
75 / 100
780 ms8312 KiB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
int n,rev;
int kuy(int x) {
if(!rev) return x;
return n-x+1;
}
int small(int l, int r, int a) {
Guess(kuy(l));
int res=Guess(kuy(r));
// printf("res = %d\n",res);
if (res==0) return (l+r)/2;
if (res==1) return r;
return l;
}
int solve(int l, int r, int a) {
// printf("solve [%d, %d] : %d [%d, %d]\n",kuy(l),kuy(r),a,l,r);
if(l==r) return l;
if(r-l+1<=3) return small(l,r,a);
if(a==l) {
int b = (l*2+r)/3;
int c = (l+2*r)/3;
int tmp1 = Guess(kuy(b)), tmp2 = Guess(kuy(c));
// printf("b = %d c = %d tmp = %d and %d (%d, %d)\n",kuy(b),kuy(c),tmp1,tmp2,b,c);
if(a!=b && tmp1==0) return (a+b)/2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...