Submission #623698

#TimeUsernameProblemLanguageResultExecution timeMemory
623698sword060Gap (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;    MinMax(l,r,&l,&r); if(x==2)return r-l; long long xd=l,lol=(r-l+x-2)/(x-1),ans=lol,c1,c2; while(xd+lol<r){      MinMax(xd,xd+lol,&c1,&c2); if(c1!=-1)ans=max(ans,c1-xd),xd=c2; xd+=lol+1; }    MinMax(xd,r,&c1,&c2); if(c1!=-1)ans=max(ans,c1-xd); 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:7:2: error: extended character   is not valid in an identifier
    7 |     MinMax(l,r,&l,&r);
      |  ^
gap.cpp:7:5: error: extended character   is not valid in an identifier
    7 |     MinMax(l,r,&l,&r);
      |    ^
gap.cpp:11:2: error: extended character   is not valid in an identifier
   11 |       MinMax(xd,xd+lol,&c1,&c2);
      |  ^
gap.cpp:11:5: error: extended character   is not valid in an identifier
   11 |       MinMax(xd,xd+lol,&c1,&c2);
      |    ^
gap.cpp:11:8: error: extended character   is not valid in an identifier
   11 |       MinMax(xd,xd+lol,&c1,&c2);
      |      ^
gap.cpp:15:2: error: extended character   is not valid in an identifier
   15 |     MinMax(xd,r,&c1,&c2);
      |  ^
gap.cpp:15:5: error: extended character   is not valid in an identifier
   15 |     MinMax(xd,r,&c1,&c2);
      |    ^
gap.cpp:23:2: error: extended character   is not valid in an identifier
   23 |       MinMax(c,v,&l,&r);
      |  ^
gap.cpp:23:5: error: extended character   is not valid in an identifier
   23 |       MinMax(c,v,&l,&r);
      |    ^
gap.cpp:23:8: error: extended character   is not valid in an identifier
   23 |       MinMax(c,v,&l,&r);
      |      ^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:7:2: error: '\U000000a0' was not declared in this scope
    7 |     MinMax(l,r,&l,&r);
      |  ^
gap.cpp:11:4: error: expected ';' before '\U000000a0'
   11 |       MinMax(xd,xd+lol,&c1,&c2);
      |   ^~
      |   ;
gap.cpp:15:4: error: expected ';' before '\U000000a0MinMax'
   15 |     MinMax(xd,r,&c1,&c2);
      |   ^~~~~~~~
      |   ;
gap.cpp:23:2: error: '\U000000a0' was not declared in this scope
   23 |       MinMax(c,v,&l,&r);
      |  ^