Tag: implementation
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 …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/227/A The picture vividly illustrates the problem statement. Given 3 Points A, B and C, you are required to find out the direction. Read …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/228/A The answer is to count the unique number of integers and substract from four. The SQL to the answer is: select 4 - …
Given two rectangles (as shown in the following figure), , are lower-left points while and are top-right points. We want to find out whether these two rectangles overlap each …