結果

問題 No.804 野菜が苦手
ユーザー nohopennohopen
提出日時 2019-06-29 18:46:06
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 4,189 ms
コンパイル使用メモリ 85,132 KB
実行使用メモリ 58,392 KB
最終ジャッジ日時 2023-09-14 23:17:49
合計ジャッジ時間 6,126 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 122 ms
56,196 KB
testcase_02 AC 124 ms
55,848 KB
testcase_03 AC 122 ms
56,184 KB
testcase_04 AC 121 ms
56,424 KB
testcase_05 AC 122 ms
55,572 KB
testcase_06 AC 121 ms
55,936 KB
testcase_07 AC 121 ms
55,924 KB
testcase_08 WA -
testcase_09 AC 123 ms
55,784 KB
testcase_10 AC 128 ms
56,348 KB
testcase_11 AC 119 ms
54,296 KB
testcase_12 AC 121 ms
56,344 KB
testcase_13 AC 122 ms
56,340 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 124 ms
56,180 KB
testcase_17 AC 120 ms
54,036 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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] - i[1] );
    Optional<Integer> min = list.stream().min((a, b) -> a.compareTo(b));
    System.out.println(min.get());
  }
}
0