結果

問題 No.804 野菜が苦手
ユーザー nohopennohopen
提出日時 2019-06-29 18:58:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 2,554 ms
コンパイル使用メモリ 86,552 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-09-14 23:17:39
合計ジャッジ時間 6,442 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,840 KB
testcase_01 AC 130 ms
55,732 KB
testcase_02 AC 131 ms
55,944 KB
testcase_03 AC 129 ms
55,888 KB
testcase_04 AC 130 ms
55,592 KB
testcase_05 AC 130 ms
55,880 KB
testcase_06 AC 131 ms
56,040 KB
testcase_07 AC 130 ms
56,112 KB
testcase_08 AC 130 ms
56,192 KB
testcase_09 AC 131 ms
55,712 KB
testcase_10 AC 131 ms
56,016 KB
testcase_11 AC 132 ms
55,972 KB
testcase_12 AC 133 ms
55,740 KB
testcase_13 AC 134 ms
55,784 KB
testcase_14 AC 132 ms
55,832 KB
testcase_15 AC 135 ms
55,924 KB
testcase_16 AC 136 ms
55,816 KB
testcase_17 AC 132 ms
55,824 KB
testcase_18 AC 134 ms
56,008 KB
testcase_19 AC 130 ms
54,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;
import java.util.stream.IntStream;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] sa = sc.nextLine().split(" ");
    int[] i = Stream.of(sa).mapToInt(Integer::parseInt).toArray();
    List<Integer> list = new ArrayList<>();
    list.add(i[0]);
    list.add( i[1] / i[2] );
    list.add( i[3] / (1 + i[2]) );
    Optional<Integer> min = list.stream().min((a, b) -> a.compareTo(b));
    System.out.println(min.get());
  }
}
0