Submission #200675

#TimeUsernameProblemLanguageResultExecution timeMemory
200675BTheroGap (APIO16_gap)C++17
0 / 100
65 ms1204 KiB
// 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);   

    while (l != r) {
        ll nl, nr;
        MinMax(l + 1, r - 1, &nl, &nr);

        if (nl == -1) {
            ans = max(ans, r - l);
            break;
        }

        ans = max(ans, nl - l);
        ans = max(ans, r - nr);
        l = nl;
        r = nr;
    }

    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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...