제출 #391809

#제출 시각아이디문제언어결과실행 시간메모리
391809Pichon5Split the Attractions (IOI19_split)C++17
0 / 100
1 ms296 KiB
#include "split.h" #include<bits/stdc++.h> #define lcm(a,b) (a/__gcd(a,b))*b #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long int #define vi vector<int> #define vll vector<ll> #define pb push_back #define F first #define S second #define mp make_pair using namespace std; vector<vi>G; vi res; int cant=0; int B; void dfs(int nodo){ res[nodo]=2; cant++; for(auto it : G[nodo]){ if(res[nodo]==2)continue; if(cant<B)dfs(it); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { int m=p.size(); G.assign(n,vi()); for(int i=0;i<m;i++){ G[p[i]].pb(q[i]); G[q[i]].pb(p[i]); } //b es que propago res.assign(n,3); dfs(0); for(int i=0;i<n;i++){ if(res[i]==3){ res[i]=1; break; } } return res; }
#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...