Submission #1110779

# Submission time Handle Problem Language Result Execution time Memory
1110779 2024-11-10T13:19:01 Z TitanicXDzz Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
vector<long long> v;
long long findGap(int T, int n)
{

       long long s=-1;
       long long t=(long long)1e18+1;
       long long maxi=LLONG_MIN;
       MinMax(s+1,t-1,&s,&t);
       long long l=s;
       long long r=t;
       long long range=(t-s)/(n-1)+1;
       long long x;
       maxi=range-1;
       for(long long i=1;i<n;i++){
          MinMax(l+(i-1)*range,l+i*range-1,&s,&t);
          if(t==-1)
            continue;
          if(i!=1){
            maxi=max(maxi,s-x);
          }
          x=t;
        }
        return maxi;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:10:8: error: 'MinMax' was not declared in this scope
   10 |        MinMax(s+1,t-1,&s,&t);
      |        ^~~~~~
gap.cpp:12:18: warning: unused variable 'r' [-Wunused-variable]
   12 |        long long r=t;
      |                  ^