Submission #599317

# Submission time Handle Problem Language Result Execution time Memory
599317 2022-07-19T12:36:44 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) break;
        tp ^= 1;
    }
    cout << y-x+1 << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Token parameter [name=cmd] equals to "3", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Token parameter [name=cmd] equals to "3", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Token parameter [name=cmd] equals to "3", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Token parameter [name=cmd] equals to "3", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Token parameter [name=cmd] equals to "3", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -