Submission #1250245

#TimeUsernameProblemLanguageResultExecution timeMemory
1250245haiphong5g0세계 지도 (IOI25_worldmap)C++20
0 / 100
1 ms328 KiB
#include "worldmap.h" #include <bits/stdc++.h> #define task "TEST" #define task2 "A" #define pl pair<ll, ll> #define pf push_front #define pb push_back #define pob pop_back #define pof pop_front #define mp make_pair #define fi first #define se second #define FOR(i, a, b, c) for (int i=a; i<=b; i+=c) #define FORE(i, a, b, c) for (int i=a; i>=b; i+=c) using namespace std; using ll = long long; using ull = unsigned long long; const int Mod = 998244353; const int maxn = 1e3; const ll Inf = 1e16; vector<int> adj[maxn+1]; vector<vector<int>> res; vector<int> L; int ck[maxn+1]; void Resize(ll v) { FOR(i, 1, v, 1) res.resize(v); } void DFS(ll v) { L.pb(v); ck[v] = true; for (auto p : adj[v]) { if (ck[p]) continue; DFS(p); } } vector<vector<int>> create_map(int n, int m, vector<int> A, vector<int> B) { Resize(3*n); DFS(1); int row = 0; for (auto p : L) { res[row].resize(3*n, p); res[row+2].resize(3*n, p); for (auto q : adj[p]) { res[row+1].pb(q); res[row+1].pb(p); } res[row+1].resize(3*n, p); } return res; }
#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...