2008-05-01から1ヶ月間の記事一覧

Problem 16 (written in Ruby)

tomotaka-mbp:~ tomotaka$ irb >> (2**1000).to_s.scan(/./).map{|s|s.to_i}.inject(0){|r,s| r+=s} => 1366ワンライナー楽しす。Problem: http://odz.sakura.ne.jp/projecteuler/index.php?Problem%2016

Problem 15 (written in Ruby)

(21..40).to_a.inject(1){|r,s| r*=s } / (1..20).to_a.inject(1){|r,s| r*=s }Problem: http://odz.sakura.ne.jp/projecteuler/index.php?Problem%2015単純に40C20だった。brute-forceバージョン笑↓ X_MAX = 20 Y_MAX = 20$count = 0def search(x, y) if x …

Ubuntu 8.04が出ていた

Ubuntuのversion 8.04が出ていました。 備忘録も兼ねてメモ。日本語版ローカライズド(Desktop) Download http://www.ubuntulinux.jp/products/JA-Localized/downloadUbuntu Server 8.04 Download http://www.ubuntu.com/getubuntu/downloadさくらインターネ…

Problem 191 (written in Ruby) (途中経過?)

注: 未完です status = ""$count = 0$reject_pat1 = /AAA\z/ $reject_pat2 = /L.*L/def a_day(current_status, day, max) #print "Day=#{day} STATUS=#{current_status}" if $reject_pat2 =~ current_status || $reject_pat1 =~ current_status then #puts "…

Problem 193 (途中経過)

今アップされている一番番号のデカい問題にふと挑戦してみた。問題はこちら http://projecteuler.net/index.php?section=problems&id=193ガチの力ずく探索だとアホほど時間がかかるのでエラトステネスのふるい的なものを一定のセグメントごとに作るような実…