Submission #623674

#TimeUsernameProblemLanguageResultExecution timeMemory
623674sword060Gap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; long long findGap(int q,int x){ if(q==2){ long long l=0,r=1e18,ans=0; MinMax(l,r,&l,&r); if(x==2)return r-l;    long long xd=l,dist=0,lol=(r-l+x-2)/(x-1); while(xd<=r){ long long c1,c2; MinMax(xd+1,xd+1+lol,&c1,&c2);      if(c1==-1){        dist+=lol+1;      }else{         ans=max(ans,dist+c1);         ans=max(ans,c2-c1);         dist=0;         xd=c1;       }    } return ans; }else{ vector<long long>a; long long c=0,v=1e18,zz=x; while(zz&&c<=v){ long long l,r; MinMax(c,v,&l,&r); if(l==-1)break; a.push_back(l);if(l!=r)a.push_back(r); c=l+1;v=r-1;zz-=2; } sort(a.begin(),a.end()); long long ret=0; for(int i=0;i<(int)a.size()-1;i++)ret=max(ret,a[i+1]-a[i]); return ret; } return 0; }

Compilation message (stderr)

gap.cpp:9:2: error: extended character   is not valid in an identifier
    9 |     long long xd=l,dist=0,lol=(r-l+x-2)/(x-1);
      |  ^
gap.cpp:9:5: error: extended character   is not valid in an identifier
    9 |     long long xd=l,dist=0,lol=(r-l+x-2)/(x-1);
      |    ^
gap.cpp:13:2: error: extended character   is not valid in an identifier
   13 |       if(c1==-1){
      |  ^
gap.cpp:13:5: error: extended character   is not valid in an identifier
   13 |       if(c1==-1){
      |    ^
gap.cpp:13:8: error: extended character   is not valid in an identifier
   13 |       if(c1==-1){
      |      ^
gap.cpp:14:2: error: extended character   is not valid in an identifier
   14 |         dist+=lol+1;
      |  ^
gap.cpp:14:5: error: extended character   is not valid in an identifier
   14 |         dist+=lol+1;
      |    ^
gap.cpp:14:8: error: extended character   is not valid in an identifier
   14 |         dist+=lol+1;
      |      ^
gap.cpp:14:11: error: extended character   is not valid in an identifier
   14 |         dist+=lol+1;
      |        ^
gap.cpp:15:2: error: extended character   is not valid in an identifier
   15 |       }else{
      |  ^
gap.cpp:15:5: error: extended character   is not valid in an identifier
   15 |       }else{
      |    ^
gap.cpp:15:8: error: extended character   is not valid in an identifier
   15 |       }else{
      |      ^
gap.cpp:16:2: error: extended character   is not valid in an identifier
   16 |          ans=max(ans,dist+c1);
      |  ^
gap.cpp:16:5: error: extended character   is not valid in an identifier
   16 |          ans=max(ans,dist+c1);
      |    ^
gap.cpp:16:8: error: extended character   is not valid in an identifier
   16 |          ans=max(ans,dist+c1);
      |      ^
gap.cpp:16:11: error: extended character   is not valid in an identifier
   16 |          ans=max(ans,dist+c1);
      |        ^
gap.cpp:17:2: error: extended character   is not valid in an identifier
   17 |          ans=max(ans,c2-c1);
      |  ^
gap.cpp:17:5: error: extended character   is not valid in an identifier
   17 |          ans=max(ans,c2-c1);
      |    ^
gap.cpp:17:8: error: extended character   is not valid in an identifier
   17 |          ans=max(ans,c2-c1);
      |      ^
gap.cpp:17:11: error: extended character   is not valid in an identifier
   17 |          ans=max(ans,c2-c1);
      |        ^
gap.cpp:18:2: error: extended character   is not valid in an identifier
   18 |          dist=0;
      |  ^
gap.cpp:18:5: error: extended character   is not valid in an identifier
   18 |          dist=0;
      |    ^
gap.cpp:18:8: error: extended character   is not valid in an identifier
   18 |          dist=0;
      |      ^
gap.cpp:18:11: error: extended character   is not valid in an identifier
   18 |          dist=0;
      |        ^
gap.cpp:19:2: error: extended character   is not valid in an identifier
   19 |          xd=c1;
      |  ^
gap.cpp:19:5: error: extended character   is not valid in an identifier
   19 |          xd=c1;
      |    ^
gap.cpp:19:8: error: extended character   is not valid in an identifier
   19 |          xd=c1;
      |      ^
gap.cpp:19:11: error: extended character   is not valid in an identifier
   19 |          xd=c1;
      |        ^
gap.cpp:20:2: error: extended character   is not valid in an identifier
   20 |        }
      |  ^
gap.cpp:20:5: error: extended character   is not valid in an identifier
   20 |        }
      |    ^
gap.cpp:20:8: error: extended character   is not valid in an identifier
   20 |        }
      |      ^
gap.cpp:21:2: error: extended character   is not valid in an identifier
   21 |     }
      |  ^
gap.cpp:21:5: error: extended character   is not valid in an identifier
   21 |     }
      |    ^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:2: error: '\U000000a0' was not declared in this scope
    9 |     long long xd=l,dist=0,lol=(r-l+x-2)/(x-1);
      |  ^
gap.cpp:10:11: error: 'xd' was not declared in this scope; did you mean 'x'?
   10 |     while(xd<=r){
      |           ^~
      |           x
gap.cpp:12:24: error: 'lol' was not declared in this scope; did you mean 'logl'?
   12 |       MinMax(xd+1,xd+1+lol,&c1,&c2);
      |                        ^~~
      |                        logl
gap.cpp:13:4: error: expected ';' before '\U000000a0'
   13 |       if(c1==-1){
      |   ^~
      |   ;
gap.cpp:15:11: error: 'else' without a previous 'if'
   15 |       }else{
      |        ^~~~
gap.cpp:16:4: error: expected ';' before '\U000000a0'
   16 |          ans=max(ans,dist+c1);
      |   ^~
      |   ;
gap.cpp:17:4: error: expected ';' before '\U000000a0'
   17 |          ans=max(ans,c2-c1);
      |   ^~
      |   ;
gap.cpp:18:4: error: expected ';' before '\U000000a0'
   18 |          dist=0;
      |   ^~
      |   ;
gap.cpp:19:4: error: expected ';' before '\U000000a0'
   19 |          xd=c1;
      |   ^~
      |   ;
gap.cpp:20:4: error: expected ';' before '\U000000a0'
   20 |        }
      |   ^~
      |   ;
gap.cpp:21:4: error: expected ';' before '\U000000a0'
   21 |     }
      |   ^~
      |   ;