May 20, 2012
algorithms, beginner, code, codeforces, data structure, implementation, programming languages, python, string, technical
The problem is from codeforces: http://www.codeforces.com/problemset/problem/158/C Using a stack will help solve this problem. Luckly, python supports stack structure by using list. The append() and pop() are used to …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/4/A The problem is so easy that you might even falls into the trap (you might think judging if it is even or odd). …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/102/B The input can be very large, you might wonder to use long arithmetic via arrays. However, it might be easier than you think. …
Computing PI can be dated back long long time ago, where without the help of computer, mathematicans can only compute several digts i.e. 15 in months. Later, in 20 …
The method of Monte Carlo (MC) relies on repeated random sampling. It is often used in computing simulations. For example, to compute the PI value, one can generate as many …
May 19, 2012
beginner, brute force, code, code library, codeforces, implementation, math, programming languages, python, tricks
The problem is from codeforces http://www.codeforces.com/problemset/problem/82/A This is interesting because it seems like those guys thing: acting strange. This problem can be transformed into the following: 12345 1122334455 11112222333344445555 …