제출 #293762

#제출 시각아이디문제언어결과실행 시간메모리
293762staniewzki늑대인간 (IOI18_werewolf)C++17
15 / 100
4058 ms39360 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) { vis[v] |= 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(e[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...