# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41059 | 2018-02-12T08:02:36 Z | didwlvv | Hotter Colder (IOI10_hottercolder) | C++14 | 774 ms | 21896 KB |
#include "grader.h" #include<cstdio> #include<cmath> int HC(int N) { Guess(N); int cnt = 1; int le = 1; int ri = N; int g = N; bool f = true; while (le < ri) { //printf("%d\n", cnt++); int mid = (le + ri) / 2; if (mid == g) { if(f)return le; else return ri; } int ok = Guess(mid); if (f) { if (ok == 1) { if (mid != 1) { int ook = Guess(mid - 1); g = mid - 1; if (ook == 1) { ri = mid - 1; } else if (ook == -1) { le = mid; f = 0; } } } else if (ok == -1) { g = mid; le = mid + (ri - mid) / 2; } else { le++; } } else { if (ok == 1) { if (mid != N) { int ook = Guess(mid + 1); g = mid + 1; if (ook == 1) { le = mid + 1; } else if (ook == -1) { ri = mid; f = 1; } } } else if (ok == -1) { g = mid; ri = mid + (mid - le) / 2; } else { ri--; } } } return le; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 32 ms | 3060 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 32 ms | 3064 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 34 ms | 3064 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 774 ms | 21896 KB | Output isn't correct - alpha = 0.000000000000 |