# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83250 | farukkastamonuda | Bali Sculptures (APIO15_sculpture) | C++14 | 117 ms | 114408 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>
#define li 105
#define inf 1000000009
#define md 1000000007
#define lo long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define iii pair< pair<int,int> ,int >
using namespace std;
int n,a,b,sum[li],A[li],dp[li][li][li][25];
int dfs(int sira,int l,int r,int gs){
//printf("%d %d %d %d\n",sira,l,r,gs);
int cev=inf;
if(gs>b) return inf;
if(sira==n+1){
if(gs>=a)
return (sum[n]-sum[l-1]);
else return inf;
}
if(~dp[sira][l][r][gs]) return dp[sira][l][r][gs];
cev=min(cev,dfs(sira+1,l,r+1,gs));
if(sira<n)
cev=min(cev,dfs(sira+1,r+1,r+1,gs+1)|(sum[r]-sum[l-1]));
return dp[sira][l][r][gs]=cev;
}
int main(){
memset(dp,-1,sizeof(dp));
scanf("%d %d %d",&n,&a,&b);
Compilation message (stderr)
# | 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... |