Tag: number theory
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 …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/230/B The input of the numbers exceed a 4-byte integer, therefore, a long type (int64) should be used in Java. I feel like I …
September 14, 2012
algorithms, batch script, beginner, brute force, github, implementation, programming languages, recursive, tools / utilities, tricks
I have used a lot the Fibonacci numbers as an example to illustrate the programming concepts and ideas. Today, I still use this to revisit the concepts of programming …
The problem is from codeforces http://codeforces.com/problemset/problem/221/B The problem statement is clear. The answer is to count the number of divisors that has at least one common digit with the …