Entries from 2016-05-01 to 1 day
Problem - D - Codeforces Edges are all weighted 1, so we can apply BFS for single source shortest path, for each node as source. This allows us to get all pairwise distances in O( n ^ 2 ). Since we are to find the maximum distance of path …
http://codeforces.com/contest/667/problem/C Misunderstood the problem, thought some valid suffix must be some substring of the prefix and failed... Seems like everyone else had no problem understanding that it actually only wanted us to co…