# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
816867 | finn__ | Catfish Farm (IOI22_fish) | C++17 | 26 ms | 4268 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 "fish.h"
#include <bits/stdc++.h>
using namespace std;
constexpr size_t N = 3000;
struct state
{
int64_t zero;
};
long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w)
{
// subtask 1
{
bool all_even = 1;
for (size_t i = 0; i < n; ++i)
all_even &= !(x[i] & 1);
if (all_even)
return accumulate(w.begin(), w.end(), 0);
}
// subtask 2
{
bool le1 = 1;
for (size_t i = 0; i < n; ++i)
le1 &= x[i] <= 1;
if (le1)
{
int64_t u = 0, v = 0;
for (size_t i = 0; i < n; ++i)
(x[i] ? v : u) += w[i];
return max(u, v);
}
}
}
Compilation message (stderr)
# | 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... |