#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll fishies[3002][3002];
ll dp[3002][2][3002];
inline ll ones(int col,int len){
return fishies[col][len];
}
ll max_weights(int N,int M,vector<int> X,vector<int> Y,vector<int> W) {
for(int i=0;i<M;i++)
fishies[X[i]+1][Y[i]+1]=W[i];
for(int i=1;i<=2;i++)
for(int j=1;j<=N+1;j++)
fishies[i][j]+=fishies[i][j-1];
if(N==2) return max(ones(1,N),ones(2,N));
ll K=ones(2,N),bst=0;
for(int i=1;i<=N;i++)
bst=max(bst,ones(1,i)-ones(2,i));
return K+bst;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
6232 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '1813034707026948134' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Incorrect |
28 ms |
8256 KB |
1st lines differ - on the 1st token, expected: '40604614618209', found: '1992935459344076353' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
4444 KB |
1st lines differ - on the 1st token, expected: '10082010', found: '977954970000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
2392 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
2392 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
2392 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
4444 KB |
1st lines differ - on the 1st token, expected: '10082010', found: '977954970000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
6232 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '1813034707026948134' |
2 |
Halted |
0 ms |
0 KB |
- |