Bzoj 2079: [Poi2010]guilds

Source: Internet
Author: User


Ask if there is a two staining scheme for each point that has a connection to the point where he does not have the color.


Concluding questions.

Except for one point, any graph can be stained by two.

/**************************************************************    problem:2079    user:beiyu    language:c + +    result:accepted    time:1284 ms    memory:2068 kb****************************************************** /#include <bits/stdc++.h>using namespace std; const int N = 2E5+50; int N,m;int D[n]; inline int in (int x=0,char Ch=getchar ()) {while (ch> ' 9 ' | | ch< ' 0 ') Ch=getchar ();    while (ch>= ' 0 ' && ch<= ' 9 ') x=x*10+ch-' 0 ', Ch=getchar (); return x; }int Main () {    n=in (), M=in ();    for (int i=1,u,v;i<=m;i++) u=in (), V=in (), (u!=v?d[u]++,d[v]++:0);    for (int i=1;i<=n;i++) if (!d[i]) return puts ("NIE");    Return puts ("TAK"), 0;}

Bzoj 2079: [Poi2010]guilds

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.