Submission #341916

# Submission time Handle Problem Language Result Execution time Memory
341916 2020-12-31T13:08:25 Z a_player Colors (BOI20_colors) C++14
0 / 100
1 ms 364 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int query(ll a){
  cout<<"? "<<a<<endl;
  int b;
 cin>>b;
 return b;
}
void answer(ll a){
  cout<<"= "<<a<<endl;
  exit(0);
}
int main(){
  int N;
  cin>>N;
  if(N>64)return 0;
  int ans=query(1);
   ans=query(N);
  if(ans==0)answer(N);
  int last=N-1;
  for(int i=2,j=N-1;last>1;i++,j--){
    query(i);
    if(ans==0)answer(last);
    last--;
    query(j);
    if(ans==0)answer(last);
    last--;
  }
  answer(last);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Integer parameter [name=k] equals to 0, violates the range [1, 7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Integer parameter [name=k] equals to 0, violates the range [1, 7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Integer parameter [name=k] equals to 0, violates the range [1, 7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Integer parameter [name=k] equals to 0, violates the range [1, 7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Integer parameter [name=k] equals to 0, violates the range [1, 7]
2 Halted 0 ms 0 KB -