| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1362141 | leolin0214 | 9월 (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;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
