Category: brute force
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;
The problem is from codeforces: http://www.codeforces.com/problemset/problem/236/A This simple problem can be solved easily. I use C# to practice the use of Hashset. Bruteforce O(n) each character and count the …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/237/A If there are two or more people coming to buy at the same time, and there is no enough cashers, just simply increase …
October 22, 2012
algorithms, brute force, code, code library, implementation, interview questions, math, programming languages, python, recursive, tricks
Q: List and compare the methods to compute where a, b, n are positive integers. A: We have four methods. The first one is to naively compute the value …
October 14, 2012
algorithms, beginner, bit hacks, brute force, implementation, interview questions, math, programming languages, python, tricks
Q: n is a none-negative numbers, in order to let divides perfectly 7, characterise n. A: in binary representation is n ones. And 7 in binary is 111. The …