This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Why am I so dumb? :c
// chrono::system_clock::now().time_since_epoch().count()
#include<bits/stdc++.h>
#include "gap.h"
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int, int> pii;
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll INF = (ll)1e18;
ll subtask1(int n) {
ll l, r, ans = 0;
MinMax(0, INF, &l, &r);
int met = 2;
while (met < n) {
ll nl, nr;
MinMax(l + 1, r - 1, &nl, &nr);
ans = max(ans, nl - l);
ans = max(ans, r - nr);
l = nl;
r = nr;
met += 2;
}
ans = max(ans, r - l);
return ans;
}
ll subtask2(int n) {
return 0ll;
}
ll findGap(int T, int N) {
if (T == 1) {
return subtask1(N);
}
else {
return subtask2(N);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |