# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918924 | esomer | Bitaro's travel (JOI23_travel) | C++17 | 313 ms | 40248 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;
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];
# | 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... |