# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232366 | 2020-05-16T20:20:54 Z | crossing0ver | Hotter Colder (IOI10_hottercolder) | C++17 | 811 ms | 8296 KB |
#include<bits/stdc++.h> #include "grader.h" using namespace std; int HC(int N){ if (N == 1) return 1; int m = N/2; Guess(N); int ask,last = N; int l = 1, r = N; int x = m; ask = Guess(x); while (l != r) { if (ask == 0) { return (last + x)/2; } if (ask == 1) { if (last < x) l = max(l,(last + x)/2 + 1); else r = min(r,(x + last - 1)/2); } else { if (last < x) r = min(r,(last + x - 1)/2); else l = max(l,(x + last)/2 + 1); } if (l == r) return l; last = x; x = (l + r - last + 1)/2 - 1; if (x < l) x = (l + r)/2; if (x == last ) x++; ask = Guess(x); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 30 ms | 1280 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 30 ms | 1280 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 31 ms | 1280 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 811 ms | 8296 KB | Output is partially correct - alpha = 0.142857142857 |