| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 483908 | beaconmc | Gap (APIO16_gap) | C++14 | 45 ms | 2252 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 <bits/stdc++.h>
#include "gap.h"
typedef long long ll;
#define FOR(i, x, y) for(ll i=(x); i<(y); i++)
#define MAX18 1000000000000000000
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,greater_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
ll findGap(int t, int n){
if (t==1){
vector<ll> sussy;
sussy.clear();
ll l=0; ll r=1000000000000000000;
ll lc=0; ll rc=0;
while (l<r){
MinMax(l,r,&lc,&rc);
if (lc!=-1){
sussy.push_back(lc);
if (lc!=rc) sussy.push_back(rc);
}
if (sussy.size() == n) break;
l = lc+1; r=rc-1;
}
sort(sussy.begin(), sussy.end());
ll maxi=0;
FOR(i, 0, n-1) maxi = max(maxi, sussy[i+1]-sussy[i]);
return maxi;
}
return 0;
}
/*
int main(){
}*/Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
