# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331681 | 2020-11-29T13:51:23 Z | Victor | Colors (BOI20_colors) | C++17 | 1 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; #define ii pair<int, int> #define iii pair<int, ii> #define vi vector<int> #define vii vector<ii> #define ll long long #define INF 1000000000 int main() { ll low = 1, high, curr, next, n; int response; scanf("%lld", &n); high = n; curr = (n + 3) / 4; printf("? %lld\n", curr); fflush(NULL); scanf("%d", &response); while (low != high) { next = curr + (low + high) / 2; if (next > n) next = curr - (low + high) / 2; printf("? %lld\n", next); fflush(NULL); scanf("%d", &response); if (response) high = abs(next - curr); else low = abs(next - curr) + 1; curr = next; } printf("%lld\n", high); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 | Halted | 0 ms | 0 KB | - |