# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
625845 | kkkkkkkk | 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)
{
bool 1st=true;
for (int i=0;i<m;i++)
if (w[i]%2==1)
{
1st=false;
break;
}
if (1st)
{
long long vk=0;
for (int i=0;i<m;i++)
vk+=w[i];
}
else
{
long long kaj_nula=0,kaj_eden=0;
for (int i=0;i<m;i++)
{
if (x[i]==0)
kaj_nula+=w[i];
else
kaj_eden+=w[i];
}
vk=max(kaj_nula,kaj_eden);
}
return vk;
}