| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1330456 | SpyrosAliv | 메기 농장 (IOI22_fish) | C++20 | 50 ms | 11612 KiB |
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
vector<int> x, y, w;
ll max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
n = N;
m = M;
x = X;
y = Y;
w = W;
if (n == 2) {
ll ans1 = 0, ans2 = 0;
for (int i = 0; i < m; i++) {
if (x[i] == 0) ans1 += w[i];
else ans2 += w[i];
}
return max(ans1, ans2);
}
else {
vector<ll> maxPer(n, 0);
for (int i = 0; i < m; i++) {
maxPer[y[i]] = max(maxPer[y[i]], (ll)w[i]);
}
ll ans = 0;
for (int i = 0; i < n; i++) {
ans += maxPer[i];
}
return ans;
}
}
| # | 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... | ||||
