# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1073107 |
2024-08-24T09:34:56 Z |
fv3 |
Catfish Farm (IOI22_fish) |
C++17 |
|
20 ms |
7004 KB |
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N, M;
vector<int> X, Y, W;
vector<ll> c, dp;
ll get_score(int l, int r)
{
if (l < 0) return 0;
if (l == r - 1)
return dp[l] - c[r] - c[l];
if (l == r - 2)
return dp[l] - c[l+1];
return dp[l];
}
ll max_weights(int N_, int M_, vector<int> X_, vector<int> Y_, vector<int> W_)
{
N = N_; M = M_;
X = X_; Y = Y_; W = W_;
c = vector<ll>(N+1);
dp = vector<ll>(N);
for (int i = 0; i < M; i++)
c[X[i]] = W[i];
dp[0] = c[1];
for (int i = 1; i < N; i++)
{
dp[i] = c[i-1] + c[i+1] + max({get_score(i-3, i), get_score(i-2, i), get_score(i-1, i)});
}
ll mx = 0;
for (int i = 0; i < N; i++)
mx = max(mx, dp[i]);
return mx;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
4696 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 |
0 ms |
348 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 |
1 ms |
1884 KB |
Output is correct |
2 |
Correct |
2 ms |
1884 KB |
Output is correct |
3 |
Correct |
11 ms |
4520 KB |
Output is correct |
4 |
Correct |
8 ms |
3932 KB |
Output is correct |
5 |
Correct |
20 ms |
6996 KB |
Output is correct |
6 |
Correct |
17 ms |
6492 KB |
Output is correct |
7 |
Correct |
18 ms |
6852 KB |
Output is correct |
8 |
Correct |
18 ms |
7004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 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 |
344 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 |
344 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 |
1 ms |
1884 KB |
Output is correct |
2 |
Correct |
2 ms |
1884 KB |
Output is correct |
3 |
Correct |
11 ms |
4520 KB |
Output is correct |
4 |
Correct |
8 ms |
3932 KB |
Output is correct |
5 |
Correct |
20 ms |
6996 KB |
Output is correct |
6 |
Correct |
17 ms |
6492 KB |
Output is correct |
7 |
Correct |
18 ms |
6852 KB |
Output is correct |
8 |
Correct |
18 ms |
7004 KB |
Output is correct |
9 |
Incorrect |
17 ms |
6748 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 |
16 ms |
4696 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453' |
2 |
Halted |
0 ms |
0 KB |
- |