| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1353884 | JungPS | September (APIO24_september) | C++20 | 82 ms | 7796 KiB |
#include "september.h"
#include <bits/stdc++.h>
using namespace std;
int solve(int N, int M, vector<int> F, vector<vector<int>> S) {
using P = pair<int,int>;
vector<vector<int>> degree(M, vector<int>(N, 0));
for (int c = 0; c < M; ++c) {
for (int i = 1; i < N; ++i) {
++degree[c][F[i]];
}
}
vector<multiset<P, greater<P>>> st(M);
int cnt = 0;
for (int r = 0; r < N - 1; ++r) {
for (int c = 0; c < M; ++c) {
int u = S[c][r];
int p = F[u];
auto it = st[c].find({degree[c][p], p});
if (it != st[c].end()) {
st[c].erase(it);
st[c].insert({degree[c][p] - 1, p});
}
--degree[c][p];
st[c].insert({degree[c][u], u});
}
bool ok = true;
for (int c = 0; c < M; ++c) {
if (st[c].empty() || st[c].begin()->first != 0) {
ok = false;
break;
}
}
if (ok) {
for (int c = 0; c < M; ++c) st[c].clear();
++cnt;
}
}
return cnt;
}| # | 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... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
