Submission #416546

#TimeUsernameProblemLanguageResultExecution timeMemory
416546LouayFarahHoliday (IOI14_holiday)C++14
0 / 100
21 ms8680 KiB
#include "bits/stdc++.h" #include "holiday.h" using namespace std; #define ll long long int vector<ll> dp; ll solve(ll i, int d, int n, int attraction[]) { if(d<=0) return 0; if(i==n) return 0; if(dp[i]!=-1) return dp[i]; return dp[i] = max(solve(i+1, d-1, n, attraction), solve(i+1, d-2, n, attraction) + attraction[i]); } long long int findMaxAttraction(int n, int start, int d, int attraction[]) { dp.assign(d+1, -1); ll res = solve(start, d, n, attraction); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...