# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1075775 |
2024-08-26T09:07:34 Z |
alexdd |
Gap (APIO16_gap) |
C++17 |
|
0 ms |
0 KB |
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e18;
pair<int,int> qry(int le, int ri)
{
pair<int,int> aux;
MinMax(le,ri,&aux.first,&aux.second);
return aux;
}
long long findGap(int32_t T, int32_t N)
{
if(n<=10)
return 1;
int rez=1;
pair<int,int> tot = qry(0,INF);
int cur=tot.first;
while(cur+rez+1 < tot.second)
{
pair<int,int> aux = qry(cur+1,cur+rez);
if(aux.first!=-1)
{
cur = aux.second;
continue;
}
int c=rez;
while(1)
{
c=c*2;
aux = qry(cur+1,cur+c);
if(aux.first!=-1)
{
rez = max(rez, aux.first - cur);
cur = aux.second;
break;
}
}
}
return rez;
}
Compilation message
gap.cpp: In function 'long long int findGap(int32_t, int32_t)':
gap.cpp:14:8: error: 'n' was not declared in this scope
14 | if(n<=10)
| ^