Submission #680535

# Submission time Handle Problem Language Result Execution time Memory
680535 2023-01-11T05:47:12 Z jhwest2 Colors (BOI20_colors) C++17
0 / 100
0 ms 208 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n; cin >> n;

    int L = 1, R = n;
    while (L < R) {
        int M = (L + R) / 2;

        cout << "? " << 1 << endl;
        bool r; cin >> r;

        cout << "? " << 1 + M << endl;
        cin >> r;

        if (r)
            R = M;
        else
            L = M + 1;
    }
    cout << "= " << L;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -