Tag: math
This problem is from codeforces: http://www.codeforces.com/problemset/problem/268/A This is a simple math problem. Almost every solution needs to store the colours of home and away. Counting the occurrences that the home colour …
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://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://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 …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/262/A #!/usr/bin/env python n, k = map(int, raw_input().split()) s = raw_input().split() ans = 0 for x in s: ans += 1 if x.count('4') + x.count('7') …