Submission #569158

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5691582022-05-26 20:09:22sidonRailway Trip 2 (JOI22_ho_t4)C++17
100 / 100
668 ms41872 KiB
#include <bits/stdc++.h>
using namespace std;
const int Z = 1e5, B = 17;
int N, K, M;
struct ST {
int a[2*Z] {}, minQry = 0;
void update(int i, int v) {
i += N;
for(a[i] = max(a[i], minQry ? Z-v : v); i /= 2; )
a[i] = max(a[2*i], a[2*i+1]);
}
int query(int l, int r) {
int x {};
for(l += N, r += N + 1; l < r; l /= 2, r /= 2) {
if(l & 1) x = max(x, a[l++]);
if(r & 1) x = max(x, a[--r]);
}
return minQry ? Z-x : x;
}
int operator[](int i) {
return minQry ? Z - a[i + N] : a[i + N];
}
} s[2][B];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> N >> K >> M;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...