# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1260725 | riddles | World Map (IOI25_worldmap) | C++20 | 0 ms | 0 KiB |
#include "worldmap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef map<ll, ll> mp;
typedef pair<ll, ll> pll;
typedef queue<ll> qi;
typedef vector<ll> vi;
typedef vector <vi> vvi;
typedef vector <pll> vpl;
typedef vector <string> vs;
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define f first
#define s second
#define pb push_back
#define all(x) begin(x), end(x)
int n, m;
vector<int> a, b;
vector<vector<int>> ans;
vector<vector<int>> con;
vector<int> etour;
/*void dfs(int u, int p) {
etour.pb(u);
for (int i: con[u]) {
if (i!=p) {
dfs(i, u);
etour.pb(u);
}
}
}*/
vector<vector<int>> create_map(int N, int M, vector<int> A, vector<int> B) {
n=N;
m=M;
a=A;
b=B;
con=vector<vector<int>> (n);
for(ll i=0; i<m; i++){
a[i]--, b[i]--;
con[a[i]].pb(b[i]);
con[b[i]].pb(a[i]);
}
vector<int> tour;
auto dfs = [&](auto& self, int x, int pre) -> void {
tour.push_back(x);
for (int i : G[x]) {
if (i != pre) {
self(self, i, x);
tour.push_back(x);
}
}
};
dfs(dfs, 0, -1);
ans=vector<vector<int>> (2*n-1, vector<int>(2*n-1, 1));
for(ll i=0; i<2*n-1; i++) for(ll j=0; j<2*n-1; j++) ans[i][j]=tour[j]+1;
return ans;
}