Submission #599327

# Submission time Handle Problem Language Result Execution time Memory
599327 2022-07-19T12:42:23 Z OttoTheDino Colors (BOI20_colors) C++17
0 / 100
1 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) break;
            tp ^= 1;
        }
        cout << "= " <<y-x+1 << endl;
     
        return 0;
    }
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -