結果

問題 No.180 美しいWhitespace (2)
ユーザー cielciel
提出日時 2015-04-06 01:14:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 168 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 16,176 KB
最終ジャッジ日時 2023-08-26 23:15:41
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,276 KB
testcase_01 AC 80 ms
15,084 KB
testcase_02 AC 81 ms
15,280 KB
testcase_03 AC 80 ms
15,344 KB
testcase_04 AC 81 ms
15,248 KB
testcase_05 AC 85 ms
15,156 KB
testcase_06 AC 85 ms
15,336 KB
testcase_07 AC 85 ms
15,424 KB
testcase_08 AC 88 ms
15,376 KB
testcase_09 AC 93 ms
15,924 KB
testcase_10 AC 93 ms
15,980 KB
testcase_11 AC 93 ms
16,156 KB
testcase_12 AC 91 ms
16,060 KB
testcase_13 AC 92 ms
15,948 KB
testcase_14 AC 92 ms
15,996 KB
testcase_15 AC 92 ms
15,992 KB
testcase_16 AC 94 ms
15,992 KB
testcase_17 AC 94 ms
15,936 KB
testcase_18 AC 94 ms
16,060 KB
testcase_19 AC 94 ms
16,036 KB
testcase_20 AC 80 ms
15,148 KB
testcase_21 AC 79 ms
15,244 KB
testcase_22 AC 79 ms
15,300 KB
testcase_23 AC 82 ms
15,280 KB
testcase_24 AC 82 ms
15,076 KB
testcase_25 AC 81 ms
15,128 KB
testcase_26 AC 81 ms
15,292 KB
testcase_27 AC 81 ms
15,248 KB
testcase_28 AC 82 ms
15,300 KB
testcase_29 AC 81 ms
15,352 KB
testcase_30 AC 93 ms
16,084 KB
testcase_31 AC 94 ms
15,980 KB
testcase_32 AC 92 ms
15,980 KB
testcase_33 AC 93 ms
16,036 KB
testcase_34 AC 92 ms
16,176 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

f=->(w){a,b=A.map{|a,b|a+b*w}.minmax;b-a}
A=$<.drop(1).map{|e|e.split.map &:to_i}
l=1
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