Submission #729827

#TimeUsernameProblemLanguageResultExecution timeMemory
729827caganyanmazCatfish Farm (IOI22_fish)C++17
9 / 100
39 ms10444 KiB
#include <bits/stdc++.h> #define pb push_back #define int int64_t using namespace std; int max_weights(int32_t n, int32_t m, vector<int32_t> x, vector<int32_t> y, vector<int32_t> w) { vector<int> v(n); for (int i = 0; i < m; i++) v[x[i]] = w[i]; vector<vector<int>> dp(n, vector<int>(3)); for (int i = 1; i < n; i++) { dp[i][0] = max({dp[i-1][0], dp[i-1][1] + v[i-1], dp[i-1][2]}); dp[i][1] = max({dp[i-1][1], dp[i-1][2]}); dp[i][2] = max({dp[i-1][0] + v[i]}); } return max({dp[n-1][0], dp[n-1][1], dp[n-1][2]}); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...