# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1114677 | SalihSahin | Povjerenstvo (COI22_povjerenstvo) | C++14 | 212 ms | 160540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N = 5e5 + 5;
vector<int> adj[N*2], adjrev[N], vis(N), comp(N), col(N);
vector<int> nodes;
vector<vector<int> > group[2];
void dfs(int node){
vis[node] = 1;
for(auto itr: adj[node]){
if(!vis[itr]){
dfs(itr);
}
}
nodes.pb(node);
}
void dfs2(int node, int compcnt, int color){
vis[node] = 1;
comp[node] = compcnt;
col[node] = color;
group[col[node]][compcnt].pb(node);
for(auto itr: adjrev[node]){
if(!vis[itr]){
dfs2(itr, compcnt, (color^1));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |