#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 time |
Memory |
Grader output |
1 |
Incorrect |
29 ms |
7756 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
6484 KB |
Output is correct |
2 |
Correct |
9 ms |
6484 KB |
Output is correct |
3 |
Correct |
20 ms |
7216 KB |
Output is correct |
4 |
Correct |
18 ms |
8012 KB |
Output is correct |
5 |
Correct |
35 ms |
10420 KB |
Output is correct |
6 |
Correct |
39 ms |
9788 KB |
Output is correct |
7 |
Correct |
38 ms |
10412 KB |
Output is correct |
8 |
Correct |
33 ms |
10444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
6484 KB |
Output is correct |
2 |
Correct |
9 ms |
6484 KB |
Output is correct |
3 |
Correct |
20 ms |
7216 KB |
Output is correct |
4 |
Correct |
18 ms |
8012 KB |
Output is correct |
5 |
Correct |
35 ms |
10420 KB |
Output is correct |
6 |
Correct |
39 ms |
9788 KB |
Output is correct |
7 |
Correct |
38 ms |
10412 KB |
Output is correct |
8 |
Correct |
33 ms |
10444 KB |
Output is correct |
9 |
Incorrect |
39 ms |
10248 KB |
1st lines differ - on the 1st token, expected: '99999', found: '66666' |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
29 ms |
7756 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453' |
2 |
Halted |
0 ms |
0 KB |
- |