Submission #922012

#TimeUsernameProblemLanguageResultExecution timeMemory
922012owoovoColors (BOI20_colors)C++14
0 / 100
0 ms436 KiB
#include <bits/stdc++.h> #pragma GCC opimize("unroll-loops,O3") #pragma GCC target("avx2") #define int long long #define F first #define S second using namespace std; vector<int> use; int query(int pos){ cout<<"? "<<pos<<endl; int a; cin>>a; return a; } signed main(){ int l=1,r; cin>>r; while(l!=r){ int m=(l+r)/2; use.push_back(m); l=m+1; } int b=1,mn=0,npos=0; for(auto x:use){ npos+=x*(2*b-1); cout<<npos<<"\n"; mn=min(mn,npos); b^=1; } mn=abs(mn)+1; query(mn); b=1; l=1; npos=mn; while(l!=r){ int m=(l+r-1)/2; npos+=m*(2*b-1); b^=1; if(query(npos)){ r=m; }else{ l=m+1; } } cout<<"= "<<l<<endl; return 0; }

Compilation message (stderr)

Colors.cpp:2: warning: ignoring '#pragma GCC opimize' [-Wunknown-pragmas]
    2 | #pragma GCC opimize("unroll-loops,O3")
      |
#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...