Submission #918924

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9189242024-01-30 20:32:53esomerBitaro's travel (JOI23_travel)C++17
100 / 100
313 ms40248 KiB
#include <bits/stdc++.h>
using namespace std;
int msb[200001];
int getMax(int l, int r, vector<vector<int>>& dp){
int k = msb[r - l + 1];
return max(dp[k][r], dp[k][l + (1 << k) - 1]);
}
int getMin(int l, int r, vector<vector<int>>& dp){
int k = msb[r - l + 1];
return min(dp[k][r], dp[k][l + (1 << k) - 1]);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vector<int> X(n);
for(auto &i : X) cin >> i;
vector<vector<int>> goLeft(20, vector<int> (n, 2e9+1));
vector<vector<int>> goRight(20, vector<int> (n, -2e9-1));
for(int k = 0; k < 20; k++){
for(int i = 0; i < n; i++){
if(k == 0){
if(i == 0 || i == n - 1) continue;
goLeft[k][i] = 2 * X[i] - X[i-1];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...