Tag: math
Count how many squares are there in the following figure. Easy validation by Python using Bruteforce, checking every possible pair of points (lower-left, and upper right) #!/usr/bin/env python # …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/278/A The problem can be simplified as the following: in a double-direction link, given two nodes, compute the shortest distance between them. There are only …
Heron’s Formula is a method to compute the area of a triangle when you know its three sides, a, b, and c. The area S is then based on p where and can be easily implemented …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/268/C This problem is put at the third problem in the online contests. But it seems too easy for being in that place. The sample …
The problem is from codeforces: http://www.codeforces.com/contest/268/problem/B This is clearly a math counting problem. In easy description, the problem can be described as: how many numbers are there in this pattern, …