Submission #599346

# Submission time Handle Problem Language Result Execution time Memory
599346 2022-07-19T12:50:13 Z OttoTheDino Colors (BOI20_colors) C++17
0 / 100
0 ms 208 KB
#include<bits/stdc++.h>
using namespace std;

#define rep(i,s,e)                          for (int i = s; i <= e; ++i)
#define rrep(i,s,e)                         for (int i = s; i >= e; --i)
#define fi                                  first
#define se                                  second
#define pb                                  push_back
typedef vector<int> vi;
typedef pair<int,int> ii;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n; cin >> n;
    int x = 1, y = n+1, tp = 1;
    while (y>x) {
        if (tp) {
            cout << "? " << x << endl;
            y--;
        }
        else {
            cout << "? " << y << endl;
            x++;
        }
        int res; cin >> res;
        if (res==0 && x>1) break;
        tp ^= 1;
    }
    cout << "= " <<y-x+1 << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -