Submission #633920

#TimeUsernameProblemLanguageResultExecution timeMemory
633920fadi57Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;

const ll inf =1e18;
const ll mod=998244353;
ll findGap(ll T, ll N){
ll mn=0; ll mx=1e18;
MinMax( 0,  mx, &mn,  &mx);
ll st=mn;ll en=mx;
ll len=(mx-(mn+1))/(N-1);
ll last=mn;
vector<ll>v;
v.push_back(mn);
for(ll i=mn+1;i<mx;i+=len){
      MinMax( i,  i+len-1, &mn,  &mx);
    if(mn!=-1){
        v.push_back(mn);  v.push_back(mx);
    }
    
}
v.push_back(en);

ll ans=len;

for(int i=1;i<v.size();i++){
    ans=max(ans,v[i]-v[i-1]);
}
return ans;

}



Compilation message (stderr)

gap.cpp: In function 'll findGap(ll, ll)':
gap.cpp:27:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 | for(int i=1;i<v.size();i++){
      |             ~^~~~~~~~~
gap.cpp:11:4: warning: unused variable 'st' [-Wunused-variable]
   11 | ll st=mn;ll en=mx;
      |    ^~
gap.cpp:13:4: warning: unused variable 'last' [-Wunused-variable]
   13 | ll last=mn;
      |    ^~~~
/usr/bin/ld: /tmp/ccicWaTb.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status