# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
467363 | phathnv | Pastiri (COI20_pastiri) | C++11 | 813 ms | 88272 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 500007;
int n, k, sheep[N], h[N], d[N], trace[N], numNode, nodeToVex[2 * N];
pair<int, int> best[2 * N];
vector<int> adj[N], child[2 * N];
bool vst[2 * N];
int main() {
scanf("%d %d", &n, &k);
for (int i = 1; i < n; i++) {
int u, v;
scanf("%d %d", &u, &v);
adj[u].push_back(v);
adj[v].push_back(u);
}
for (int i = 1; i <= k; i++)
scanf("%d", &sheep[i]);
queue<int> qu;
h[1] = 1;
qu.push(1);
while (!qu.empty()) {
int u = qu.front();
qu.pop();
for (int v : adj[u])
if (!h[v]) {
h[v] = h[u] + 1;
qu.push(v);
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |