제출 #599784

#제출 시각아이디문제언어결과실행 시간메모리
599784tpiang열쇠 (IOI21_keys)C++17
0 / 100
0 ms300 KiB
#include <bits/stdc++.h> using namespace std; vector<int> find_reachable(vector<int> r, vector<int> u, vector<int> v, vector<int> c) { int n = (int) r.size(); int m = (int) c.size(); vector<int> ans(n, 0); bool flag = false; for(int i = 0; i < n; i++){ if(r[i] != 0){ ans[i] = 1; flag = true; } } vector<vector<int>> g(n,vector<int>()); for(int i = 0; i < m; i++){ g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } for(int i = 0; i < n; i++){ if((int)g[i].size() == 0){ ans[i] = 1; flag = true; } } if(!flag){ ans.assign(n,1); } 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...