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"
#include "holiday.h"
using namespace std;
#define ll long long int
ll solve(ll i, int day, int n, int attraction[])
{
if(day<=0)
return 0;
if(i==n)
return 0;
return max(solve(i+1, day-1, n, attraction), solve(i+1, day-2, n, attraction) + attraction[i]);
}
long long int findMaxAttraction(int n, int start, int d, int attraction[])
{
return solve(0, d, n, attraction);
}
# | 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... |