Submission #1085964

# Submission time Handle Problem Language Result Execution time Memory
1085964 2024-09-09T07:53:14 Z not_amir Colors (BOI20_colors) C++14
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

int solve(int n, int c, int add){
  if(n == 1)
    return 1 + add;
  int diff = n/2 + add;
  int q = (c - diff > 0)?c-diff:c+diff;
  cout << "? " << q << endl;
  int ans;
  cin >> ans;
  if(ans)
    return solve(n/2, q, add);
  else
    return solve(n/2, q, add + n/2);
}

int main(){
//   ios_base::sync_with_stdio(false);
//   cin.tie(NULL);
  int n;
  cin >> n;
  cout << "? " << 6 << endl;
  cout << solve(n, 6, 0);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Token parameter [name=cmd] equals to "5", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Token parameter [name=cmd] equals to "5", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Token parameter [name=cmd] equals to "5", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Token parameter [name=cmd] equals to "5", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Token parameter [name=cmd] equals to "5", doesn't correspond to pattern "[?=]"
2 Halted 0 ms 0 KB -