#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][0]-ps[i][0]+ps[i][1];
ans=max(ans,k);
}
ans=max(ans,ps[N+5][0]);
ans=max(ans,ps[N+5][1]);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
17752 KB |
Output is correct |
2 |
Correct |
15 ms |
18404 KB |
Output is correct |
3 |
Correct |
3 ms |
15964 KB |
Output is correct |
4 |
Correct |
2 ms |
15964 KB |
Output is correct |
5 |
Incorrect |
46 ms |
22912 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '102014006755076' |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
15960 KB |
1st lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
15964 KB |
Output is correct |
2 |
Correct |
2 ms |
16012 KB |
Output is correct |
3 |
Incorrect |
9 ms |
17212 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '13439726536713' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
15960 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
15960 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
15960 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
15964 KB |
Output is correct |
2 |
Correct |
2 ms |
16012 KB |
Output is correct |
3 |
Incorrect |
9 ms |
17212 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '13439726536713' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
17752 KB |
Output is correct |
2 |
Correct |
15 ms |
18404 KB |
Output is correct |
3 |
Correct |
3 ms |
15964 KB |
Output is correct |
4 |
Correct |
2 ms |
15964 KB |
Output is correct |
5 |
Incorrect |
46 ms |
22912 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '102014006755076' |
6 |
Halted |
0 ms |
0 KB |
- |