# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
721376 |
2023-04-10T19:09:16 Z |
bLIC |
Catfish Farm (IOI22_fish) |
C++17 |
|
116 ms |
10132 KB |
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
ll sum[N]{};
for (int i = 0;i<M;i++){
sum[X[i]]+=W[i];
}
ll dp[N+1][2];
memset(dp, 0, sizeof(dp));
for (int i = 1;i<=N;i++){
dp[i][0] = max(dp[i-1][1], dp[i-1][0]);
dp[i][1] = dp[i-1][0]+sum[i-1];
}
return max(dp[N][0], dp[N][1]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
4456 KB |
Output is correct |
2 |
Correct |
35 ms |
5364 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
92 ms |
10072 KB |
Output is correct |
6 |
Correct |
116 ms |
10132 KB |
Output is correct |
# |
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 |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2604 KB |
Output is correct |
3 |
Incorrect |
17 ms |
3816 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 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 |
1 ms |
296 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 |
1 ms |
296 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 |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2604 KB |
Output is correct |
3 |
Incorrect |
17 ms |
3816 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
4456 KB |
Output is correct |
2 |
Correct |
35 ms |
5364 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
92 ms |
10072 KB |
Output is correct |
6 |
Correct |
116 ms |
10132 KB |
Output is correct |
7 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '2', found: '1' |
8 |
Halted |
0 ms |
0 KB |
- |