結果

問題 No.236 鴛鴦茶
コンテスト
ユーザー dazy
提出日時 2017-03-08 00:26:27
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 56 ms / 2,000 ms
+ 506µs
コード長 520 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,201 ms
コンパイル使用メモリ 84,032 KB
実行使用メモリ 43,100 KB
最終ジャッジ日時 2026-08-01 00:13:51
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        double ans = 0;

        int A = scan.nextInt();
        int B = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        double r = ((double) B)/A;
        double x = ((double) X);
        double y = X * r;

        if (Y < y) {
            y = Y;
            x = Y * (1/r);
        }

        ans = x + y;

       System.out.println(ans);
    }
}
0