C. Valera and Elections The city Valera lives in is going to hold elections to the city Parliament. The city has n districts and n - 1 bidirectional roads. We know that from any district there is a path along the roads to any other district. Let's…
A. Passage 枚举两个点,看看删掉之后剩下的图是否是二分图. #include <bits/stdc++.h> using namespace std ; const int MAXN = 205 ; vector < int > G[MAXN] ; int vis[MAXN] , col[MAXN] ; int n ; int dfs ( int u ) { for ( int i = 0 ; i < G[u].size () ; ++ i ) { int v =…
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Going from u to v or from v to u? Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14778 Accepted: 3911 Description In order to make their sons brave, Jiajia and Wind take t…
Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, and ask one of their little sons go from one to the o…