# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1084364 | hahahaha | Event Hopping 2 (JOI21_event2) | C++17 | 115 ms | 24592 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>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
const int mxN = (int)2e5+10;
const int mxLg = 20;
int n, k;
vector<int> v;
int L[mxN], R[mxN];
int jmp[mxLg][mxN*2];
set<pair<int,int>> S;
int get(int l, int r){
int tot = 0;
for(int i = mxLg-1; i>=0; i--)
if(jmp[i][l]<=r) l=jmp[i][l], tot+=(1<<i);
return tot;
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n >> k;
for(int i = 1; i <= n; i++)
cin >> L[i] >> R[i], v.pb(L[i]), v.pb(R[i]);
sort(all(v)); v.erase(unique(all(v)),end(v));
for(int i = 0; i <= sz(v); i++) jmp[0][i]=sz(v);
for(int i = 1; i <= n; i++){
L[i] = lower_bound(all(v),L[i])-begin(v);
R[i] = lower_bound(all(v),R[i])-begin(v);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |