# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
634100 | Jovan26 | Catfish Farm (IOI22_fish) | C++17 | 0 ms | 0 KiB |
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<bits/stdc++.h>
using namespace std;
long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w){
long long rez = 0;
bool s1 = true;
bool s2 = true;
ifor(int i=0;i<x.size();i++){
if(x[i]%2==1) s1 = false;
if(x[i]>1) s2 = false;
}
if(s1)
for(int i=0;i<w.size();i++) rez+=w[i];
if(s2){
long long m1 = 0;
long long m2 = 0;
for(int i=0;i<w.size();i++){
if(x[i]==0) m1+=w[i];
else m2+=w[i];
}
rez=max(m1,m2);
}
return rez;
}