Submission #970289

#TimeUsernameProblemLanguageResultExecution timeMemory
970289maxFedorchukColors (BOI20_colors)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long zap(long long zn) { cout<<"? "<<zn<<endl; cout.flush(); int rt; cin>>rt; return rt; } void ans(long long zn) { cout<<"= "<<zn<<endl; cout.flush(); } int main() { cin.tie(0); ios_base::sync_with_stdio(0); long long n; cin>>n; long long start=0,zr=0,l=1,r=n,o=-1; while(l<r) { l=(l+r-1)/2; zr+=o*l; start=max(start,1ll-zr); l++; o*=-1; } zap(start); l=1,r=n,o=-1; while(l<r) { long long mid=(l+r-1)/2; start+=mid*o; if(zap(start)) { r=mid; } else { l=mid+1; } } ans(l); return; }

Compilation message (stderr)

Colors.cpp: In function 'int main()':
Colors.cpp:60:2: error: return-statement with no value, in function returning 'int' [-fpermissive]
   60 |  return;
      |  ^~~~~~