Submission #1227607

#TimeUsernameProblemLanguageResultExecution timeMemory
1227607cpdreamerGap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
long long findGap(int T, int N) { ll l,r; MinMax (0,1e18,&l,&r ); ll lb=l; ll curr=l; ll ans=0; ll n=(ll)N; ll bnd=((r-l)/(n-1))+1; while (curr<=r) { ll mn,mx; MinMax(curr,curr +bnd-1,&mn,&mx); if (curr==lb) { if (mn!=mx) { lb=mx; curr+=bnd; } else curr+=bnd; } else { if (mn==-1) { curr+=bnd; } else { ans=max(ans,mn-lb); lb=mx; curr+=bnd; } } } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:2:5: error: 'll' was not declared in this scope
    2 |     ll l,r;
      |     ^~
gap.cpp:3:21: error: 'l' was not declared in this scope
    3 |     MinMax (0,1e18,&l,&r );
      |                     ^
gap.cpp:3:24: error: 'r' was not declared in this scope
    3 |     MinMax (0,1e18,&l,&r );
      |                        ^
gap.cpp:3:5: error: 'MinMax' was not declared in this scope
    3 |     MinMax (0,1e18,&l,&r );
      |     ^~~~~~
gap.cpp:4:7: error: expected ';' before 'lb'
    4 |     ll lb=l;
      |       ^~~
      |       ;
gap.cpp:5:7: error: expected ';' before 'curr'
    5 |     ll curr=l;
      |       ^~~~~
      |       ;
gap.cpp:6:7: error: expected ';' before 'ans'
    6 |     ll ans=0;
      |       ^~~~
      |       ;
gap.cpp:7:7: error: expected ';' before 'n'
    7 |     ll n=(ll)N;
      |       ^~
      |       ;
gap.cpp:8:7: error: expected ';' before 'bnd'
    8 |     ll bnd=((r-l)/(n-1))+1;
      |       ^~~~
      |       ;
gap.cpp:9:12: error: 'curr' was not declared in this scope
    9 |     while (curr<=r) {
      |            ^~~~
gap.cpp:10:11: error: expected ';' before 'mn'
   10 |         ll mn,mx;
      |           ^~~
      |           ;
gap.cpp:11:27: error: 'bnd' was not declared in this scope
   11 |         MinMax(curr,curr +bnd-1,&mn,&mx);
      |                           ^~~
gap.cpp:11:34: error: 'mn' was not declared in this scope
   11 |         MinMax(curr,curr +bnd-1,&mn,&mx);
      |                                  ^~
gap.cpp:11:38: error: 'mx' was not declared in this scope
   11 |         MinMax(curr,curr +bnd-1,&mn,&mx);
      |                                      ^~
gap.cpp:12:19: error: 'lb' was not declared in this scope
   12 |         if (curr==lb) {
      |                   ^~
gap.cpp:25:17: error: 'ans' was not declared in this scope
   25 |                 ans=max(ans,mn-lb);
      |                 ^~~
gap.cpp:25:21: error: 'max' was not declared in this scope
   25 |                 ans=max(ans,mn-lb);
      |                     ^~~
gap.cpp:31:12: error: 'ans' was not declared in this scope
   31 |     return ans;
      |            ^~~