Submission #1030339

#TimeUsernameProblemLanguageResultExecution timeMemory
103033912345678Colors (BOI20_colors)C++17
9 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; const int nx=100; int n, tmp, l, r, t, lst, x, dp[nx]; int query(int x) { cout<<"? "<<x<<endl; cin>>tmp; return tmp; } int main() { cin>>n; l=1, r=n+1; query(1); for (int i=1; i<n; i++) { if (i%2) r--, dp[r-l]=query(r); else l++, dp[r-l]=query(l); //cout<<"dis "<<r-l<<' '<<dp[r-l]<<'\n'; } for (int i=1; i<=n; i++) if (dp[i]) return cout<<"= "<<i, 0; cout<<"= "<<n; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...