結果

問題 No.180 美しいWhitespace (2)
ユーザー gigurururugigurururu
提出日時 2015-04-05 23:54:55
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 216 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 11,172 KB
実行使用メモリ 16,052 KB
最終ジャッジ日時 2023-09-17 04:47:22
合計ジャッジ時間 4,878 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,240 KB
testcase_01 AC 80 ms
15,120 KB
testcase_02 AC 79 ms
15,088 KB
testcase_03 AC 79 ms
15,064 KB
testcase_04 AC 79 ms
15,064 KB
testcase_05 AC 82 ms
15,088 KB
testcase_06 AC 84 ms
15,300 KB
testcase_07 AC 86 ms
15,304 KB
testcase_08 AC 86 ms
15,316 KB
testcase_09 AC 90 ms
15,924 KB
testcase_10 AC 90 ms
15,832 KB
testcase_11 AC 92 ms
15,988 KB
testcase_12 AC 92 ms
16,052 KB
testcase_13 AC 91 ms
15,800 KB
testcase_14 AC 93 ms
15,956 KB
testcase_15 AC 93 ms
15,904 KB
testcase_16 AC 94 ms
16,032 KB
testcase_17 AC 93 ms
16,044 KB
testcase_18 AC 93 ms
15,868 KB
testcase_19 AC 93 ms
15,888 KB
testcase_20 AC 81 ms
15,128 KB
testcase_21 WA -
testcase_22 AC 80 ms
15,124 KB
testcase_23 AC 81 ms
15,152 KB
testcase_24 AC 82 ms
15,040 KB
testcase_25 AC 80 ms
15,124 KB
testcase_26 AC 80 ms
15,100 KB
testcase_27 AC 79 ms
15,116 KB
testcase_28 AC 81 ms
15,040 KB
testcase_29 AC 80 ms
15,068 KB
testcase_30 AC 91 ms
15,904 KB
testcase_31 AC 92 ms
15,852 KB
testcase_32 AC 92 ms
15,924 KB
testcase_33 WA -
testcase_34 AC 91 ms
15,880 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.to_i
T=(1..N).map{gets.split.map(&:to_i)}
def f(w)
  n,x=T.map{|a,b|a+b*w}.minmax
  x-n
end
l=0
r=1000000000
while l+2<r
  if f((l*2+r)/3) <= f((l+r*2)/3)
    r=(l+r*2)/3
  else
    l=(l*2+r)/3
  end
end
p l+1
0