# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
383055 | Nayna | 수열 (APIO14_sequence) | C++17 | 752 ms | 24736 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>pii;
typedef pair<pii,pii>piii;
const int mxn = 1e4+5;
#define inf 1e16
#define all(v) v.begin(), v.end()
#define FAST ios_base::sync_with_stdio(0);cout.tie(0)
ll arr[mxn];
ll dp[mxn][205];
ll pre[mxn];
int dir[mxn][205];
int n, k;
ll solve(int pos, int x)
{
if(pos>n) {
return -inf;
}
if(x==k) return 0;
if(dp[pos][x]!=-1) return dp[pos][x];
ll sum = 0, ret = 0;
for(int i = pos; i < n; i++) {
sum+=arr[i];
ll tmp = max(ret, solve(i+1, x+1)+sum*pre[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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |