This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "fish.h"
#include <vector>
using namespace std;
int fish[2][100100];
long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
for(int i = 0; i < M; i++)
fish[X[i]][Y[i]+1]=W[i];
for(int i = 0; i < 2; i++)
for(int j = 1; j <= N; j++)
fish[i][j]+=fish[i][j-1];
if(N>2) {
int ans = 0;
for(int i = 0; i <= N; i++)
ans = max(ans, fish[1][100000]-fish[1][i]+fish[0][i]);
return ans;
} else {
return max(fish[0][100000], fish[1][100000]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |