AlgorithmOJ
Problem
Local Problems
All Problems
Problem Category
Status
Contest
Standard Contests
Replay Contests
Virtual Contests
Ranklist
More...
News
About
F.A.Q
Recent Contests
Coming Soon...
Login
Register
2026-11-01 11:44:59
Cycle Cocycle
Time Limit:
10000ms
Memory Limit:
32768KB
This problem will be judged on
HDU
. Original ID:
4827
64-bit integer IO format:
%I64d
Java class name:
Main
Prev
Submit
Status
Statistics
Next
Font Size:
Description
有一个n个点m条边的图,你要给每个点一个0或1的标号,使得每个点与偶数个相同标号的点之间有边。如果有多解输出任意一组。
Input
第一行为T,表示输入数据组数。
下面T组数据。每组数据中:
第一行,n,m。
下面m行,每行两个数x,y,表示一条边。
限制条件:
1<=T<=100
1<=n<=1000
1<=m<=10000
1<=x, y<=n
图中无重边无自环。
Output
对第i组数据,输出
Case #i:
然后输出一个长度为n的字符串,表示每个点的标号。
注:题目保证一定有解。
Sample Input
1 4 5 1 2 1 3 1 4 2 3 2 4
Sample Output
Case #1: 0001
Source
2014年百度之星程序设计大赛 - 初赛(第一轮)
Language:
C++
C++11
C++14
C
Java
Pascal
Python2
Python3
C#
Fortran
Perl
Ruby
Ada
SML
Visual C++
Visual C
CLang
CLang++
Theme:
Monokai
Solarized Light
Material
Share Code?
Yes
No
×
Login
Username:
Password:
Cookie:
Never
One Day
One Week
One Month
One Year
×
Register
Username:
Password:
Repeat Password:
Nickname:
School:
Email:
×
News Title
by