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 "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);
for (int i = 0; i < M; i++)
v[X[i]] += W[i];
vector<ll> dp(N+5);
for (int i = 0; i < N; i++) {
dp[i+5] = max(
dp[i+5-1],
dp[i+5-3] + v[i] + v[i-2]
);
}
return dp[N+4];
}
# | 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... |
# | 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... |