| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367931 | nathlol2 | September (APIO24_september) | C++20 | 1 ms | 344 KiB |
#include "september.h"
#include <bits/stdc++.h>
using namespace std;
int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) {
vector<int> deg(N);
for(int i = 1;i<N;i++){
deg[F[i]]++;
}
int ans = 0;
for(int i = 0;i<N - 1;i++){
if(deg[S[0][i]] == 0){
int u = S[0][i];
while(F[u] != 0 && --deg[F[u]] == 0){
u = F[u];
}
}
bool f = 1;
for(int j = 0;j<=i;j++) f &= (deg[S[0][j]] == 0);
if(f) ++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... | ||||
