#include "fish.h"
#include<bits/stdc++.h>
using namespace std;
#include <vector>
#define ll long long
const int MN=1e6;
ll ps[MN][2];
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,std::vector<int> W) {
ll ans=0;
for(int i=0;i<M;i++){
ps[Y[i]][X[i]]+=W[i];
}
for(int i=1;i<MN-5;i++){
ps[i][0]+=ps[i-1][0];
ps[i][1]+=ps[i-1][1];
}
for(int i=0;i<=N;i++){
ll k=ps[N+5][1]-ps[i][1]+ps[i][0];
ans=max(ans,k);
}
ans=max(ans,ps[N+5][0]);
if(N>2)ans=max(ans,ps[N+5][1]);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
17756 KB |
Output is correct |
2 |
Correct |
16 ms |
18264 KB |
Output is correct |
3 |
Correct |
2 ms |
16028 KB |
Output is correct |
4 |
Correct |
2 ms |
15964 KB |
Output is correct |
5 |
Incorrect |
47 ms |
23124 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '102014006755076' |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
15964 KB |
Output is correct |
2 |
Correct |
26 ms |
19768 KB |
Output is correct |
3 |
Correct |
40 ms |
20724 KB |
Output is correct |
4 |
Correct |
15 ms |
17756 KB |
Output is correct |
5 |
Correct |
17 ms |
18268 KB |
Output is correct |
6 |
Incorrect |
2 ms |
15960 KB |
1st lines differ - on the 1st token, expected: '4044', found: '6066' |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
15964 KB |
Output is correct |
2 |
Correct |
2 ms |
15964 KB |
Output is correct |
3 |
Incorrect |
10 ms |
17220 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '13415186848574' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
15964 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 |
3 ms |
15964 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 |
3 ms |
15964 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 |
3 ms |
15964 KB |
Output is correct |
2 |
Correct |
2 ms |
15964 KB |
Output is correct |
3 |
Incorrect |
10 ms |
17220 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '13415186848574' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
17756 KB |
Output is correct |
2 |
Correct |
16 ms |
18264 KB |
Output is correct |
3 |
Correct |
2 ms |
16028 KB |
Output is correct |
4 |
Correct |
2 ms |
15964 KB |
Output is correct |
5 |
Incorrect |
47 ms |
23124 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '102014006755076' |
6 |
Halted |
0 ms |
0 KB |
- |