| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362141 | leolin0214 | September (APIO24_september) | C++20 | 59 ms | 6256 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) {
int n = N, m = M;
int ans = 0;
int dif = 0, bad = 0;
vector<int> cnt(n), chd(n), rem(n);
for (int u=1; u<n; u++) chd[F[u]]++;
for (int j=0; j<n-1; j++) {
for (int i=0; i<m; i++) {
int x = S[i][j], f = F[x];
if (cnt[x] == 0) dif++;
cnt[x]++;
if (cnt[x] == m) dif--;
if (i == 0) {
rem[x] = 1;
chd[f]--;
if (chd[x] > 0) bad++;
if (rem[f]) if (chd[f] == 0) bad--;
}
}
if (dif == 0 && bad == 0) ans++;
}
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... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
