Submission #627366

#TimeUsernameProblemLanguageResultExecution timeMemory
627366c28dnv9q3Catfish Farm (IOI22_fish)C++17
0 / 100
25 ms3160 KiB
#include "fish.h" #include <vector> using namespace std; using ll = long long; ll max_weights( int N, int M, vector<int> X, vector<int> Y, vector<int> W ) { vector<int> v(N+5); for (int i = 0; i < M; i++) v[X[i]+5] += W[i]; vector<ll> dp(N+5); for (int i = 1; i < N; i++) { dp[i+5] = max( dp[i+5-1], max( dp[i+5-3] + v[i+5] + v[i-2+5], dp[i+5-4] + v[i+5] + v[i-3+5] ) ); } return dp[N+4]; }
#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...