# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
718860 | lam | 저장 (Saveit) (IOI10_saveit) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include "encoder.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n;
int par[maxn];
int d[36][maxn];
vector <int> adj[maxn];
void bfs(int rt, bool keep)
{
queue<int> q;
fill_n(d[rt],n,-1);
d[rt][rt] = 0;
q.push(rt);
if (keep) par[rt] = rt;
while (!q.empty())
{
int u=q.front(); q.pop();
for (int v:adj[u])
if (d[rt][v] == -1)
{
d[rt][v] = d[rt][u] + 1;
if (keep) par[v] = u;
q.push(v);
}
}
}