Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nabb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
Internet Problem Solving Contest
(ipsc.ksp.sk)
1 points
by
nabb
11y ago
|
0 comments
2.
▲
by
nabb
12y ago
Also working on pairs of consecutive fibonacci numbers (f_n, f_(n+1)) instead of the matrix [[f_(n+1) f_n] [f_n f_(n-1)]] makes this much simpler. def fib(n): def fib2(n): # returns (f_n, f_(n+1)) if n == 0: retu
3.
▲
by
nabb
14y ago
An easy way to do the second is to consider the sum and the sum of squares. This gets you a-b and a^2-b^2. Recall that the latter is (a-b)(a+b) and the answer follows immediately.
4.
▲
by
nabb
15y ago
I'd add TopCoder and Codeforces to the list: http://community.topcoder.com/tc http://codeforces.com/ Both of these sites run a few algorithm competitions every month.
5.
▲
by
nabb
15y ago
The introduction was alright, but I'm not sure that the hold buffer needs to be introduced straight away. Using the hold buffer can get complicated pretty quickly, and it isn't something that you'll frequently have to do. The example the au
6.
▲
by
nabb
15y ago
tail can be done in ruby can be quite succinctly with the $< (ARGF) variable: ruby -e'$><<$<.map.last(10)' For the rest of the ruby one-liners in the page the author references, most can be done more easily with s