# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1252594 | bzzzzzzzzzz | World Map (IOI25_worldmap) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "worldmap.h"
using namespace std;
using ll = long long;
const int SIZE = 41;
vector<int> o;
vector<int> used(SIZE, 0);
vector<vector<int>> g(SIZE);
void dfs(int v) {
o.push_back(v);
used[v] = 1;
for (auto i : g[v]) {
if (used[i] == 0) {
dfs(i);
o.push_back(v);
}
}
}
std::vector<std::vector<int>> create_map(int N, int M, std::vector<int> A, std::vector<int> B) {
for (int i = 0; i < M; i++) {
g[A[i]].push_back(B[i]);
g[B[i]].push_back(A[i]);
}
int n = (int)2 * (N - 1) + 1;
vector<vector<int>> ans(n, vector<int> (n, 0));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i < N) {
ans[i][j] = i + 1;
} else {
ans[i][j] = 2 * N - i - 1;
}
}
}
return ans;
}
int main() {
vector<int> A = {1, 2};
vector<int> B = {2, 3};
vector<vector<int>> c = create_map((int)A.size() + 1, (int)A.size(), A, B);
for (auto i : c) {
for (auto j : i) {
cout << j;
}
cout << '\n';
}
}