結果

問題 No.306 さいたま2008
ユーザー simansiman
提出日時 2016-03-26 21:41:50
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-10-02 01:04:42
合計ジャッジ時間 3,007 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    x1, y1 = gets.chomp.split.map(&:to_i)
    x2, y2 = gets.chomp.split.map(&:to_i)

    if y1 > y2
      a = x1 + x2
      b = y1 - y2

      puts (x1 * Rational(b, a) + y2).to_f
    else
      a = x1 + x2
      b = y2 - y1

      puts (x1 * Rational(b, a) + y1).to_f
    end
  end
end

Yukicoder.new
0