Submission #293756

#TimeUsernameProblemLanguageResultExecution timeMemory
293756staniewzkiWerewolf (IOI18_werewolf)C++17
0 / 100
597 ms524292 KiB
#include<bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) #include "werewolf.h" vector<int> check_validity(int n, vector<int> x, vector<int> y, vector<int> s, vector<int> e, vector<int> l, vector<int> r) { int m = size(x), q = size(s); vector<vector<int>> adj(n); REP(i, m) { adj[x[i]].emplace_back(y[i]); adj[y[i]].emplace_back(x[i]); } vector<int> ans(q); REP(i, q) { vector<int> vis(n); function<void(int, int, int, int)> dfs; dfs = [&](int v, int a, int b, int t) { for(int u : adj[v]) if(a <= u && u <= b && (vis[u] & t) == 0) dfs(u, a, b, t); }; dfs(s[i], l[i], n, 1); dfs(s[i], 0, r[i], 2); REP(j, n) ans[i] |= vis[j] == 3; } 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...