| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1276611 | glupan | Colors (BOI20_colors) | C++20 | 1 ms | 332 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int MAX_N = 1e5 + 5;
void solve() {
int n; cin >> n;
cout << "? 1" << endl;
int tmp; cin >> tmp;
int l=n,r=2;
for(int i=1; i<n; i++) {
if(i%2) {
cout << "? " << l << endl;
int ans; cin >> ans;
l--;
if(!ans) {
cout << "= " << l-(r-3) << endl;
return;
}
} else {
cout << "? " << r << endl;
int ans; cin >> ans;
r++;
if(!ans) {
cout << "= " << l-(r-3) << endl;
return;
}
}
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int tc=1;
while(tc--)
solve();
} | # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
