bzoj2079[poi2010]guilds*

Source: Internet
Author: User

Bzoj2079[poi2010]guilds

Test instructions

To dye a graph, it is required that each figure must be infected with a certain color at the same time as the point of another color connected to the edge, ask can meet the requirements. n≤200000.

Exercises

Direct conclusion: Unless there is a little connection with other points, it will certainly meet the requirements.

Code:

1#include <cstdio>2#include <cstring>3#include <algorithm>4#include <queue>5 #defineInc (I,J,K) for (int i=j;i<=k;i++)6 #defineMAXN 2000107 using namespacestd;8 9InlineintRead () {Ten     CharCh=getchar ();intf=1, x=0; One      while(ch<'0'|| Ch>'9'){if(ch=='-') f=-1; Ch=GetChar ();} A      while(ch>='0'&&ch<='9') x=x*Ten+ch-'0', ch=GetChar (); -     returnf*x; - } the BOOLF[MAXN];intn,m; - intMain () { -N=read (); M=read (); Inc (I,1, m) {intX=read (), Y=read (); f[x]=f[y]=1;} -Inc (I,1, N)if(!f[i]) {Puts ("NIE");GotoEnd;} Puts"TAK"); +Endreturn 0; -}

20161107

bzoj2079[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: info-contact@alibabacloud.com 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.