#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];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
22 ms |
3148 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '710089120' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '2', found: '34' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1364 KB |
1st lines differ - on the 1st token, expected: '10082010', found: '10483420' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '35' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '35' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '35' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1364 KB |
1st lines differ - on the 1st token, expected: '10082010', found: '10483420' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
22 ms |
3148 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '710089120' |
2 |
Halted |
0 ms |
0 KB |
- |