結果
問題 |
No.306 さいたま2008
|
ユーザー |
![]() |
提出日時 | 2016-03-26 21:44:45 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 504 bytes |
コンパイル時間 | 51 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-02 01:04:49 |
合計ジャッジ時間 | 3,059 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 5 |
コンパイルメッセージ
Syntax OK
ソースコード
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 if x1 > x2 puts (x2 * Rational(b, a) + y2).to_f else puts (x1 * Rational(b, a) + y2).to_f end else a = x1 + x2 b = y2 - y1 if x1 > x2 puts (x2 * Rational(b, a) + y1).to_f else puts (x1 * Rational(b, a) + y1).to_f end end end end Yukicoder.new