题意:给你n点m边的图,然后让你确定每条边的方向,使得入度=出度的点最多 . 度数为偶数的点均能满足入度 = 出度. 证明:度数为奇数的点有偶数个,奇度点两两配对连无向边,则新图存在欧拉回路,则可使新图所有点入度 = 出度. #include <bits/stdc++.h> using namespace std; #define X first #define Y second typedef long long ll; ; int d[N], head[N], tot; int to[N*…
1137. Bus Routes Time limit: 1.0 secondMemory limit: 64 MB Several bus routes were in the city of Fishburg. None of the routes shared the same section of road, though common stops and intersections were possible. Fishburg old residents stated that it…
One-Way Reform time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one…
FZU 2112 Tickets Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice Description You have won a collection of tickets on luxury cruisers. Each ticket can be used only once, but can be used in either direction betwee…