#bzoj2530. Party
Party
题目描述
请输出该图的任意一个大小为N/3的团。 一个团的定义为节点的一个子集,该子集中的点两两有直接连边。 输入: 第一行是两个整数N,M。 接下来有M行,每行两个整数A,B,表示A和B有连边。保证无重边。 输出: N/3个整数,表示你找到的团。 数据范围:
3<=N<=3000,[3/2 n(2/3 n -1)]/2<=M<=[n(n-1)/2]
输入格式
In the first line of the standard input two integers, n and M(3<=N<=3000,[3/2 n(2/3 n -1)]/2<=M<=[n(n-1)/2]), are given, separated by a single space. These denote the number of Byteasar's friends and the number of pairs of his friends who know each other, respectively. Byteasar's friends are numbered from 1 to <v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"></v:f> <v:f eqn="sum @0 1 0"></v:f> <v:f eqn="sum 0 0 @1"></v:f> <v:f eqn="prod @2 1 2"></v:f> <v:f eqn="prod @3 21600 pixelWidth"></v:f> <v:f eqn="prod @3 21600 pixelHeight"></v:f> <v:f eqn="sum @0 0 1"></v:f> <v:f eqn="prod @6 1 2"></v:f> <v:f eqn="prod @7 21600 pixelWidth"></v:f> <v:f eqn="sum @8 21600 0"></v:f> <v:f eqn="prod @7 21600 pixelHeight"></v:f> <v:f eqn="sum @10 21600 0"></v:f> </v:formulas> <v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path> <o:lock aspectratio="t" v:ext="edit"></o:lock> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 6.75pt; height: 5.25pt; mso-wrap-style: square; mso-position-horizontal-relative: page; mso-position-vertical-relative: page"> <v:imagedata o:href="http://main.edu.pl/en/images/OI18/imp-en-tex.9.png" src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image001.gif"></v:imagedata> </v:shape>. Each of the following <v:shape id="_x0000_i1026" type="#_x0000_t75" style="width: 10.5pt; height: 5.25pt; mso-wrap-style: square; mso-position-horizontal-relative: page; mso-position-vertical-relative: page"> <v:imagedata o:href="http://main.edu.pl/en/images/OI18/imp-en-tex.10.png" src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image002.gif"></v:imagedata> </v:shape>lines holds two integers separated by a single space. The numbers in line no.i+1(for i=1,2,...,m) are Ai and Bi(1<=Ai<Bi<=N), separated by a single space, which denote that the persons Ai and Bi now each other. Every pair of numbers appears at most once on the input. <o:p></o:p>
输出格式
6 10
2 5
1 4
1 5
2 4
1 3
4 5
4 6
3 5
3 4
3 6
2 4
数据范围与约定
Explanation of the example: Byteasar's friends numbered 1, 3, 4, 5 know one another. However, any pair of Byteasar's friends who know each other, like 2 and 4 for instance, constitutes a correct solution, i.e., such a pair needs not be part of aforementioned quadruple.
请不要提交!