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 <bits/stdc++.h>
using namespace std;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
// first subtask
bool s1 = true, s2=true;
for (int i=0;i<M;i++) {
if (X[i] % 2 != 0) s1=false;
if (X[i] > 1) s2=false;
}
if (s1) {
long long sm = 0;
for (int i=0;i<M;i++) sm += W[i];
return sm;
}
if (s2) {
long long sm1=0,sm2=0;
for (int i=0;i<M;i++) {
if (X[i] == 0) sm1 += W[i];
else sm2 += W[i];
}
return max(sm1, sm2);
}
return 0;
}
# | 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... |