# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1152596 | yhkhoo | Sjeckanje (COCI21_sjeckanje) | C++20 | 522 ms | 756 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define fi first
#define se second
#define int long long
const int MAXN = 200;
int memo[MAXN][MAXN], a[MAXN];
int n, q;
int dp(int p, int c){
if(memo[p][c] != -1) return memo[p][c];
if(p == 0){
return 0;
}
int minx = LLONG_MAX, maxx = LLONG_MIN;
if(c == 0){
for(int i=0; i<=p; i++){
minx = min(minx, a[i]);
maxx = max(maxx, a[i]);
}
return (memo[p][c] = maxx - minx);
}
memo[p][c] = 0;
for(int i=p; i>=c; i--){
minx = min(minx, a[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |