# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1025256 |
2024-07-16T18:32:51 Z |
_8_8_ |
Boat (APIO16_boat) |
C++17 |
|
0 ms |
0 KB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll findGap(int tc, int n){
ll L,R;
MinMax(0,(ll)1e18,&L,&R);
if(R - L + 1 == n) return 1;
ll s = (R - L + n) / (n + 1);
vector<ll> vals;
for(ll i = L;i <= R;i += s){
ll nx = min(R,i + s -1);
ll _l,_r;
MinMax(i,nx,&_l,&_r);
// cout << i << ' ' << nx << ' ' << _l << ' ' << _r << '\n';
if(_l!=-1 && _l <= nx){
vals.push_back(_l);
vals.push_back(_r);
}
}
assert((int)vals.size() >= 2);
ll ret = 0;
// for(ll o:vals){
// cout << o << ' ';
// }
// cout << '\n';
for(int i = 1;i < (int)vals.size();i++){
ret = max(ret,vals[i] - vals[i - 1]);
}
return ret;
}
Compilation message
boat.cpp:1:10: fatal error: gap.h: No such file or directory
1 | #include "gap.h"
| ^~~~~~~
compilation terminated.