Tag: greedy
The problem is from codeforces: http://codeforces.com/problemset/problem/298/B The note given in the problem description pretty much explains the problem clearly. In every moment, the ship can choose to stay put or …
January 24, 2013
algorithms, beginner, brute force, codeforces, greedy algorithm, implementation, math, programming languages, python, search, simulation, tricks
The problem is from codeforces: http://www.codeforces.com/contest/265/problem/B This problem is not difficult, but it took me nearly 1:30 hr to get it right during the contest. I thought at first, the …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/245/E The minimal number of people can be obtained by greedy approach, assuming that at each possible cases, the same people entered and left …
In , the basic 0/1 knapsack is discussed. For each item, you can choose to put or not to put into the knapsack. Therefore, for the number of items, …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/239/A It is a simple math problem: finding the numbers x that satisify where y, k, and n are given;