# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145105 | emilem | Zagonetka (COI18_zagonetka) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <algorithm>
#include <iostream>
#include <vector>
#include <set>
using namespace std;
int n;
vector<bool> used;
vector<int> p;
vector< vector<int> > nei;
template<typename T>
ostream& operator<<(ostream& ostr, const vector<T>& a)
{
for (int i = 1; i < a.size(); ++i)
ostr << a[i] << ' ';
return ostr;
}
void Dfs(int v, vector<int>& a)
{
used[v] = true;
for (int i = 0; i < nei[v].size(); ++i)
{
int to = nei[v][i];
if (used[to])
continue;
Dfs(to, a);
}
a.push_back(v);
}