传送门 这是一道英语题,首先要读懂题目: $\text{Alex believes that his trip will be interesting only if he will not use any road twice in a row.}$ 这句话意思是不会连续走一条路,但是同一条路是可以走多次的 所以对于一个边双联通分量,是可以全部走一遍并可以从联通分量里的任意一个点离开的 所以就可以直接缩点,然后就变成树上问题 发现对于树上的点,如果它的大小为 $1$ 并且它的儿子都没法返回 ,…
链接: https://codeforces.com/contest/1220/problem/E 题意: Alex decided to go on a touristic trip over the country. For simplicity let's assume that the country has n cities and m bidirectional roads connecting them. Alex lives in city s and initially loc…
题面 可以发现一个边双必然是可以随意走的,所以我们就把原图求割边然后把边双缩成一个点,然后就是一个树上dp了. #include<bits/stdc++.h> #define ll long long using namespace std; const int N=200005; #define pb push_back inline int read(){ int x=0; char ch=getchar(); for(;!isdigit(ch);ch=getchar()); for(;i…
渭城朝雨浥轻尘,客舍青青柳色新. 劝君更尽一杯酒,西出阳关无故人.--王维 A. Ichihime and Triangle 网址:https://codeforces.com/contest/1337/problem/A Ichihime is the current priestess of the Mahjong Soul Temple. She claims to be human, despite her cat ears. These days the temple is holdi…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…