제출 #1294667

#제출 시각아이디문제언어결과실행 시간메모리
1294667theiulius세계 지도 (IOI25_worldmap)C++17
0 / 100
4 ms5440 KiB
#include "worldmap.h" #include <bits/stdc++.h> #define pb push_back using namespace std; const int K = 205; // enough for Euler tour of N ≤ 100 vector<int> v[102]; int j = 0; vector<vector<int>> ans(K, vector<int>(K, 1)); bool used[102]; void dfs(int x, int last){ ans[0][j] = x; for (auto h : v[x]) { if (h != last) { j++; dfs(h, x); } } ans[0][j] = x; j++; } vector<vector<int>> create_map(int N, int M, vector<int> a, vector<int> b) { // reset globals for(int i=1;i<=N;i++){ v[i].clear(); used[i] = false; } j = 0; for (int k = 0; k < M; k++){ v[a[k]].pb(b[k]); v[b[k]].pb(a[k]); } dfs(1, 0); // copy row 0 to all rows for (int k = 1; k < K; k++){ for (int t = 0; t < K; t++){ ans[k][t] = ans[0][t]; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...