# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960865 | 2024-04-11T06:52:55 Z | Trisanu_Das | Amusement Park (JOI17_amusement_park) | C++17 | 0 ms | 0 KB |
#include "Joi.h" #include <vector> #include <map> using namespace std; static vector<vector<int>> adj; static vector<int> ord; static map<int, int> bit; static vector<bool> seen; static void dfs(int at) { seen[at] = true; ord.push_back(at); for (int it : adj[at]) { if (seen[it]) continue; dfs(it); ord.push_back(at); } int b = (int)bit.size(); bit[at] = b % 60; } void Joi(int N, int M, int A[], int B[], long long X, int T) { adj.resize(N); seen.resize(N); for (int i = 0; i < M; i ++) { adj[A[i]].push_back(B[i]); adj[B[i]].push_back(A[i]); } dfs(0); ord.pop_back(); for(int i = 0; i < N; i++){ MessageBoard(i, (X >> bit[i]) & 1); } }