# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413297 | 2021-05-28T13:01:45 Z | Ruxandra985 | Colors (BOI20_colors) | C++14 | 1 ms | 200 KB |
#include <bits/stdc++.h> using namespace std; int main() { //FILE *fin = fopen ("a.in" , "r"); long long n , c , now , x , sol = 0 , eq , p2 , st , dr , mid , dir; //fscanf (fin,"%lld%lld",&n,&c); cin >> n; cout << "? 1" << endl; cin >> x; now = 1; st = 1; dr = n - 1; dir = 0; while (st <= dr){ mid = (st + dr)/2; now += mid; cout << "? " << now << endl; cin >> x; now = 1; cout << "? 1" << endl; cin >> x; if (x) dr = mid - 1; else st = mid + 1; } cout << "= " << st << endl; /* eq = -1; sol = n; for (p2 = 62 ; p2 >= 0 ; p2--){ if ((1LL << p2) <= n){ /// vezi daca merge p2, daca merge add la C, altfel nu if (now + sol - (1LL << p2) <= n){ cout << "? " << now + sol - (1LL << p2); cin >> x; cout << endl; now = now + sol - (1LL << p2); if (x) sol -= (1LL << p2); } else if (now - sol + (1LL << p2) > 0){ cout << "? " << now - sol + (1LL << p2); cin >> x; cout << endl; now = now - sol + (1LL << p2); if (x) sol -= (1LL << p2); } else cout << "nu"; } } cout << "= " << sol - 1 << endl;*/ return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Hair color 1 was used multiple times |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Hair color 1 was used multiple times |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Hair color 1 was used multiple times |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Hair color 1 was used multiple times |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Hair color 1 was used multiple times |
2 | Halted | 0 ms | 0 KB | - |