結果
問題 | No.236 鴛鴦茶 |
ユーザー |
|
提出日時 | 2017-04-21 10:50:42 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 134 ms / 2,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 2,554 ms |
コンパイル使用メモリ | 74,336 KB |
実行使用メモリ | 41,372 KB |
最終ジャッジ日時 | 2024-06-28 13:11:28 |
合計ジャッジ時間 | 6,207 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = Integer.parseInt(sc.next()); int B = Integer.parseInt(sc.next()); int X = Integer.parseInt(sc.next()); int Y = Integer.parseInt(sc.next()); System.out.println((A+B)*min((double)X/A, (double)Y/B)); } private static double min(double A, double B) { if (A < B) { return A; } if (A > B) { return B; } return A; } }