Submission #494802

#TimeUsernameProblemLanguageResultExecution timeMemory
494802blueDischarging (NOI20_discharging)C++17
13 / 100
1064 ms25540 KiB
#include <iostream> #include <vector> using namespace std; using ll = long long; using vll = vector<ll>; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N; cin >> N; vll t(1+N); t[0] = 0; for(int i = 1; i <= N; i++) cin >> t[i]; vll dp(1+N, 1'000'000'000'000'000'000LL); dp[0] = 0; for(int i = 1; i <= N; i++) { for(int j = i-1; j >= 0; j--) { dp[i] = min(dp[i], dp[j] + t[i] * (N - j)); } } cout << dp[N] << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...