| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369249 | leolin0214 | Catfish Farm (IOI22_fish) | C++20 | 40 ms | 9564 KiB |
#include "fish.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <array>
using namespace std;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
int n = N, m = M;
long long ans = 0;
vector<vector<long long>> a(2, vector<long long>(n));
for (int i=0; i<m; i++) a[X[i]][Y[i]] += W[i];
if (n == 2) return max(a[0][0] + a[0][1], a[1][0] + a[1][1]);
long long sum = accumulate(a[1].begin(), a[1].end(), 0ll);
ans = sum;
for (int i=0; i<n; i++) {
sum -= a[1][i];
sum += a[0][i];
ans = max(ans, sum);
}
return ans;
}
| # | 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... | ||||
