結果

問題 No.180 美しいWhitespace (2)
ユーザー ciel
提出日時 2015-04-06 01:27:40
言語 Ruby
(3.4.1)
結果
AC  
実行時間 108 ms / 5,000 ms
コード長 162 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-12-26 14:55:29
合計ジャッジ時間 4,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: `:' after local variable or literal is interpreted as binary operator
Main.rb:4: warning: even though it seems like symbol literal
Main.rb:5: warning: `&' interpreted as argument prefix
Syntax OK

ソースコード

diff #

f=->(w){a,b=A.map{|a,b|a+b*w}.minmax;b-a}
A=$<.drop(l=1).map{|e|e.split.map &:to_i}
r=1<<30
f[x=(l*2+r)/3]<=f[y=(l+r*2)/3]?r=y :l=x while l+2<r
p (l..r).min_by &f
0