某岛

… : "…アッカリ~ン . .. . " .. .
September 12, 2012

若干 Ruby && Python 代码。。

介于写脚本语言的机会不多。。看来我有必要把最近写的几段代码记录下来。。

常用段子。。

require "scanf"
I =->{gets.split.map &:to_i}
RD =->{gets.to_i}

$stdin.reopen('art.in',"r")
$stdout.reopen('art.out',"w")
.. .
import re
I = lambda: map(int, raw_input().split())

print re.sub("[CAMBRIDGE]","",raw_input())
.. .

http://codeforces.com/contest/218/problem/A
http://codeforces.com/contest/218/submission/2145038

http://codeforces.com/contest/218/problem/B
http://codeforces.com/contest/222/submission/2128259

http://codeforces.com/contest/222/problem/A
http://codeforces.com/contest/222/submission/2128358

http://codeforces.com/contest/222/problem/B
http://codeforces.com/contest/222/submission/2151859
http://codeforces.com/contest/222/submission/2156716

Ruby 效率实在是硬伤啊。。( 。怎么破。。。
..( Ruby .. TLE …
..( Python 3000 ms +-
..( C++ 450 ms +- .. .

http://codeforces.com/contest/222/problem/D
http://codeforces.com/contest/222/submission/2128259

—-UPD —–
我似乎火星了。。
http://rubini.us/

http://www.codechef.com/problems/MAXGAME/
http://www.codechef.com/viewsolution/1250357
http://paste.ubuntu.com/1199044/

——————————————

IT面试题:有一个整数数组,请求出两两之差绝对值最小的值,记住,只要得出最小值即可,不需要求出是哪两个数。
http://paste.ubuntu.com/1199143/

[Python]统计一个文件夹里多少文件和文件大小的和。。