Educational Codeforces Round 56 (Rated for Div. 2) D. Beautiful Graph 【規律 && DFS】
傳送門:http://codeforces.com/contest/1093/problem/D
D. Beautiful Graph
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputYou are given an undirected unweighted graph consisting of
You have to write a number on each vertex of the graph. Each number should be 11, 22 or 33. The graph becomes beautiful if for each edge the sum of numbers on vertices connected by this edge is odd.
Calculate the number of possible ways to write numbers