Submission #1096276

#TimeUsernameProblemLanguageResultExecution timeMemory
1096276laureColors (BOI20_colors)C++14
9 / 100
1 ms448 KiB
#include<bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; int p=1,c=n,x; cout<<"? 1"<<endl; cin>>x; cout<<"? "<<n<<endl; cin>>x; if(x)c--; for(int i=2;i<=(n/2);i++) { cout<<"? "<<i<<endl; cin>>x; if(x)c--; else break; cout<<"? "<<n-i+1<<endl; cin>>x; if(x)c--; else break; } if(n%2!=0&&c==2) { cout<<"? "<<n/2+1<<endl; cin>>x; if(x)c--; } cout<<"= "<<c<<endl; }

Compilation message (stderr)

Colors.cpp: In function 'int main()':
Colors.cpp:11:9: warning: unused variable 'p' [-Wunused-variable]
   11 |     int p=1,c=n,x;
      |         ^
#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...