problem: (E) Ice cream coloring Solution In C/C++ Archive

Codeforces Round #411 (Div. 2), problem: (E) Ice cream coloring Solution In C/C++

Codeforces Round #411 (Div. 2), problem: (E) Ice cream coloring Solution In C/C++

#include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<set> using namespace std; const int MX=600111; int n,m; int pool,*c,s; int hed,nxt,t,ec,vis,vism,no; set<int>cur; inline void ade(int u,int v){ ec++;nxt=hed;t=v;hed=ec; } void dfs(int k){ vis=1; for(int *i=c;i!=c;i++)if(vism)cur.erase(no); for(int *i=c;i!=c;i++)if(!vism){ no=*(cur.lower_bound(1)); cur.erase(no); …