# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211798 | quocnguyen1012 | Gap (APIO16_gap) | C++14 | 113 ms | 9336 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
set<ll> res;
int n;
void solve1(ll L, ll R) {
if((int)res.size()==n||L>R) return ;
ll a,b;
MinMax(L,R,&a,&b);
if(a==-1) return ;
res.insert(a);
res.insert(b);
solve1(a+1,b-1);
}
void add(ll L, ll R) {
if((int)res.size()==n||L>R) return ;
ll a,b;
MinMax(L,R,&a,&b);
if(a==-1) return ;
res.insert(a);
res.insert(b);
}
ll findGap(int T, int N)
{
n=N;
if(T==2) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |