Submission #793074

#TimeUsernameProblemLanguageResultExecution timeMemory
793074algorithm16Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include<iostream> using namespace std; typedef long long int llint; llint findGap(int T, int N) { llint mn,mx; /*cout << 1 << " " << 1e18 << "\n"; cin >> mn >> mx;*/ MinMax(1,(llint)1e18,mn*,mx*); llint x=mn,y=mx,rr=mx-mn,r=(mx-mn)/(N-1)+((mx-mn)%(N-1)!=0); while(x!=y) { /*cout << x << " " << x+r << "\n"; cin >> mn >> mx;*/ MinMax(x,x+r,mn*,mx*); if(mn!=mx) { x=mx; continue; } int lo=r,hi=rr; while(lo<hi) { int mid=(lo+hi)/2; /*cout << x << " " << x+mid << "\n"; cin >> mn >> mx;*/ MinMax(x,x+mid,mn*,mx*); if(mx!=mn) hi=mid; else lo=mid+1; } r=lo; x+=r; } return r; } /*int main() { cout << findGap(1,5); return 0; }*/

Compilation message (stderr)

gap.cpp: In function 'llint findGap(int, int)':
gap.cpp:10:26: error: expected primary-expression before ',' token
   10 |  MinMax(1,(llint)1e18,mn*,mx*);
      |                          ^
gap.cpp:10:30: error: expected primary-expression before ')' token
   10 |  MinMax(1,(llint)1e18,mn*,mx*);
      |                              ^
gap.cpp:15:19: error: expected primary-expression before ',' token
   15 |   MinMax(x,x+r,mn*,mx*);
      |                   ^
gap.cpp:15:23: error: expected primary-expression before ')' token
   15 |   MinMax(x,x+r,mn*,mx*);
      |                       ^
gap.cpp:25:22: error: expected primary-expression before ',' token
   25 |    MinMax(x,x+mid,mn*,mx*);
      |                      ^
gap.cpp:25:26: error: expected primary-expression before ')' token
   25 |    MinMax(x,x+mid,mn*,mx*);
      |                          ^