#include "fish.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
typedef long long int ll;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,std::vector<int> W) {
ll ans =0;
ans=0;
ll b[300005][2];
memset(b,0,sizeof(b));
for(int i =0;i<M;i++)
{
b[Y[i]][X[i]]+=W[i];
}
for(int i =1;i<N-1;i++)
{
b[i][0]+=b[i-1][0];
b[i][1]+=b[i-1][1];
}
ans=max(b[N-1][0],b[N-1][1]);
if(N==2)
{
return ans;
}
for(int i =0;i<N;i++)
{
ll cnt=b[N-1][1]-b[i][1];
ans=max(ans,cnt+b[i][0]);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
6824 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '40312711037206' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 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 |
3 ms |
4948 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4948 KB |
1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
1st lines differ - on the 1st token, expected: '3', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
1st lines differ - on the 1st token, expected: '3', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
1st lines differ - on the 1st token, expected: '3', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Incorrect |
3 ms |
4948 KB |
1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
6824 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '40312711037206' |
2 |
Halted |
0 ms |
0 KB |
- |