| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1370051 | retr0foxx | Catfish Farm (IOI22_fish) | C++20 | 20 ms | 5656 KiB |
#include "fish.h"
#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
#define MAXN 300000
int N, M;
std::vector<signed> X, Y, W;
int LR[2][MAXN+5];
long long max_weights(signed _N, signed _M, std::vector<signed> _X, std::vector<signed> _Y,
std::vector<signed> _W) {
N = _N; M = _M;
X = std::move(_X);
Y = std::move(_Y);
W = std::move(_W);
for (int i = 0; i < N; ++i)
{
LR[X[i]][Y[i]] = 1;
}
for (int i = 0; i < 2; ++i)
for (int j = 1; j < N; ++j)
LR[i][j] += LR[i][j-1];
if (N > 2)
{
int best = LR[1][N-1];
for (int i = 0; i < N; ++i)
{
best = std::max(best, LR[1][N-1] - LR[1][i] + LR[0][i]);
}
return best;
}
else
{
return std::max(LR[0][N-1], LR[1][N-1]);
}
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
