Submission #105836

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1058362019-04-15 10:29:04Pro_ktmrRailway Trip (JOI17_railway_trip)C++14
20 / 100
498 ms8940 KiB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
struct SegmentTree{
private:
int N;
vector<int> node;
public:
void init(int n){
N = 1;
while(N < n) N *= 2;
N = N*2-1;
node.clear();
for(int i=0; i<N; i++) node.push_back(0);
}
void update(int a, int x){
int k = a + (N-1)/2;
node[k] = x;
while(k > 0){
k = (k-1) / 2;
node[k] = max(node[2*k+1], node[2*k+2]);
}
}
int findL(int a, int b, int x, int k=0, int l=0, int r=-1){
if(r == -1) r = (N+1)/2;
if(r <= a || b <= l) return INT_MAX;
if(r-l == 1 && node[k] > x) return k - (N-1)/2;
else if(r-l == 1) return INT_MAX;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...