Submission #237501

#TimeUsernameProblemLanguageResultExecution timeMemory
237501thtsshz_bgwrswhGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize("Ofast") #include<stdio.h> #include<vector> #include<algorithm> #include "gap.h" using namespace std; vector<long long> num; long long findGap(int T,int N){ if(t==1){ long long maxv=1000000000000000000,minv=0,ans,ans2; while(maxv>=minv){ MinMax(minv,maxv,ans,ans2); if(ans==-1||ans2==-1) break; if(ans==ans2){ num.emplace_back(ans); break; } num.emplace_back(ans); num.emplace_back(ans2); maxv=ans2-1; minv=ans+1; } sort(num.begin(),num.end()); long long ans=0; for(i=1;i<num.size();i++) ans=max(ans,num[i]-num[i-1]); return ans; } else{ } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:5: error: 't' was not declared in this scope
  if(t==1){
     ^
gap.cpp:12:29: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
    MinMax(minv,maxv,ans,ans2);
                             ^
In file included from gap.cpp:5:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:12:29: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
    MinMax(minv,maxv,ans,ans2);
                             ^
In file included from gap.cpp:5:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:25:13: error: redeclaration of 'long long int ans'
   long long ans=0;
             ^~~
gap.cpp:10:45: note: 'long long int ans' previously declared here
   long long maxv=1000000000000000000,minv=0,ans,ans2;
                                             ^~~
gap.cpp:26:7: error: 'i' was not declared in this scope
   for(i=1;i<num.size();i++)
       ^
gap.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^