# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1052060 | vako_p | Colors (BOI20_colors) | C++14 | 1 ms | 596 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int mxN = 1e5 + 5;
ll n,dis[mxN];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll ans;
cin >> n;
ll l = 0, r = n,idx = 0;
while(r > l + 1){
ll mid = l + (r - l) / 2;
dis[idx++] = mid;
l = mid;
}
ll dis1 = 0;
for(int i = 1; i < idx; i += 2) dis1 += dis[i] - dis[i - 1];
ll curr = dis1 + 1,xx = 0;
cout << "? " << curr << endl;
cin >> ans;
l = 0, r = n;
while(r > l + 1){
ll mid = l + (r - l) / 2;
curr += mid * ((xx % 2 > 0) ? (-1) : (1));
cout << "? " << curr << endl;
# | 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... |