# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1256568 | pandaa73 | World Map (IOI25_worldmap) | C++20 | 0 ms | 0 KiB |
>
using namespace std;
#define lf "\n"
#define ff endl
#define _ << ' ' <<
#define all(x) begin(x),end(x)
#define rall(x) rbegin(x),rend(x)
#define infos(str) do { fprintf(stderr, str"\n"); } while(0)
#define infor(str, ...) do { fprintf(stderr, str, __VA_ARGS__); } while(0)
#define infof(str, ...) do { fprintf(stderr, str"\n", __VA_ARGS__); } while(0)
#ifndef DEBUG
#undef infos
#undef infor
#undef infof
#define infos(str)
#define infor(str, ...)
#define infof(str, ...)
#endif
using ll = long long;
constexpr int LOG = 20;
constexpr int MOD = 1e9+7;
constexpr int MAXN = 1e5+7;
std::vector<std::vector<int>> create_map(int N, int M,
std::vector<int> A, std::vector<int> B) {
vector<vector<int>> adj(N + 1);
for(int i = 0; i < M; ++i) {
adj[A[i]].push_back(B[i]);
adj[B[i]].push_back(A[i]);
}
vector<int> tour;
auto dfs = [&](int v, int f, auto &&dfs) -> void {
tour.push_back(v);
for(auto u: adj[v]) {
if(u == f) continue;
dfs(u, v, dfs);
tour.push_back(v);
}
};
return vector<vector<int>>(tour.size(), tour);
}