# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858138 | mircea_007 | Peru (RMI20_peru) | C++17 | 322 ms | 57884 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 "peru.h"
#include <set>
#include <deque>
#define magic_sauce inline __attribute__((always_inline))
using ll = long long;
const ll INF = 1e18;
const int MOD = 1e9 + 7;
magic_sauce ll min( ll a, ll b ){ return a < b ? a : b; }
magic_sauce ll max( ll a, ll b ){ return a > b ? a : b; }
int ans_hash( int n, ll v[] ){
int ret = 0;
for( int i = 0 ; i < n ; i++ )
ret = (ret * 23LL + v[i]) % MOD;
return ret;
}
/*
ans[i] = min{ ans[max{ i - k, prev_bigger( x ) }] + x | x=v[i]..+INF }
// echivalent:
ans[i] = min{ ans[j] + max{ v[j+1..i] } | j=i-k..i-1 }
// folosim stiva de maxime partiale
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |