Submission #1030347

# Submission time Handle Problem Language Result Execution time Memory
1030347 2024-07-22T03:02:09 Z thinknoexit Colors (BOI20_colors) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll now = 0;
bool ask(ll x) {
    now = x;
    cout << "? " << x << endl;
    cin >> x; return x;
}
void answer(ll x) {
    cout << "= " << x << endl;
    exit(0);
}
int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    ll n;
    cin >> n;
    ll l = 1, r = n;
    ask(1);
    while (l < r) {
        if (now == l) {
            if (ask(r)) l += 2;
            else answer(r - l + 1);
        }
        else {
            if (ask(l)) r -= 2;
            else answer(r - l + 1);
        }
    }
    answer(1);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong guess
2 Halted 0 ms 0 KB -