https://codeforc.es/contest/1176/problem/E 久了不写bfs了.一开始用dfs写,的确用dfs是很有问题的,一些奇怪的情况就会导致多染一些色. 注意无向图的边要开双倍. #include<bits/stdc++.h> using namespace std; typedef long long ll; int n, m; struct Edge { int u, v; int next; Edge() {} Edge(int u, int v, int…
D. Vladik and Favorite Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output This is an interactive problem. Vladik has favorite game, in which he plays all his free time. Game field could…
题目链接:https://vjudge.net/contest/226823#problem/C You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through t…
B. Cover Points time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n points on the plane, (x1,y1),(x2,y2),-,(xn,yn). You need to place an isosceles triangle with two sides on the coordin…
E. Two Labyrinths Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/E Description A labyrinth is the rectangular grid, each of the cells of which is either free or wall, and it's possible to move only between free…
D. Igor In the Museum Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/D Description Igor is in the museum and he wants to see as many pictures as possible. Museum can be represented as a rectangular field of n ×…
F. FloodTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/F Description We all know that King Triton doesn't like us and therefore shipwrecks, hurricanes and tsunami do happen. But being bored with the same routine…
D. Phillip and Trains Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/586/problem/D Description The mobile application store has a new game called "Subway Roller". The protagonist of the game Philip is located in one en…
C. Ice Cave time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to…