Tag: algorithm
The problem is from codeforces: http://codeforces.com/contest/265/problem/A This is a pure simulation problem, no difficulty at all. If the current instruction matches the colour on the current stone, move one position …
This problem is from codeforces: http://www.codeforces.com/problemset/problem/263/D This is a graph-related problem but it took me days to get it right. First i made a mistake in using Python language, see …
The problem is from codeforces: http://codeforces.com/contest/263/problem/B Sort the squares by sizes then we will easily derive the answer. If there is a point in the smallest square, it must be …
The problem is from codeforces: http://codeforces.com/contest/263/problem/A It looks complex but in fact it is not. There is only one ‘1’ element in this fixed-5X5 matrix. The shortest path to the …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/262/B Two hints used to solve this problem are greedy and sorted numbers. The greedy approach turns negative numbers one by one in non-decreasing order …