Submission #119617

#TimeUsernameProblemLanguageResultExecution timeMemory
119617win11905Hotter Colder (IOI10_hottercolder)C++11
52 / 100
820 ms8188 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; int solve(int l, int r) { int sz = r-l+1; if(sz == 1) return l; if(sz == 2) { Guess(l); if(Guess(r) == 1) return r; else return l; } if(sz == 3) { Guess(l); int val = Guess(r); if(val == 1) return r; if(val == 0) return r-1; return l; } int a = l + sz/4; int b = l + 3*sz/4; Guess(a); int val = Guess(b); int m = a + b >> 1; if(val == 0) return m; if(val == 1) return solve(m+1, r); return solve(l, m); } int HC(int N){ return solve(1, N); }

Compilation message (stderr)

hottercolder.cpp: In function 'int solve(int, int)':
hottercolder.cpp:24:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    int m = a + b >> 1;
            ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...