結果

問題 No.91 赤、緑、青の石
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-27 20:07:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 389 ms / 5,000 ms
コード長 633 bytes
コンパイル時間 3,716 ms
コンパイル使用メモリ 76,944 KB
実行使用メモリ 60,016 KB
最終ジャッジ日時 2023-09-06 12:34:16
合計ジャッジ時間 13,074 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 363 ms
59,408 KB
testcase_01 AC 334 ms
59,488 KB
testcase_02 AC 291 ms
59,056 KB
testcase_03 AC 314 ms
59,344 KB
testcase_04 AC 315 ms
59,216 KB
testcase_05 AC 314 ms
59,072 KB
testcase_06 AC 299 ms
59,616 KB
testcase_07 AC 120 ms
56,232 KB
testcase_08 AC 119 ms
55,972 KB
testcase_09 AC 119 ms
54,068 KB
testcase_10 AC 121 ms
55,760 KB
testcase_11 AC 233 ms
58,740 KB
testcase_12 AC 304 ms
59,368 KB
testcase_13 AC 360 ms
59,584 KB
testcase_14 AC 298 ms
59,360 KB
testcase_15 AC 336 ms
59,300 KB
testcase_16 AC 121 ms
56,308 KB
testcase_17 AC 118 ms
55,900 KB
testcase_18 AC 119 ms
55,948 KB
testcase_19 AC 122 ms
55,760 KB
testcase_20 AC 117 ms
55,824 KB
testcase_21 AC 118 ms
56,000 KB
testcase_22 AC 119 ms
55,836 KB
testcase_23 AC 119 ms
56,228 KB
testcase_24 AC 123 ms
56,072 KB
testcase_25 AC 371 ms
59,316 KB
testcase_26 AC 389 ms
59,108 KB
testcase_27 AC 118 ms
55,820 KB
testcase_28 AC 244 ms
59,540 KB
testcase_29 AC 293 ms
60,016 KB
testcase_30 AC 270 ms
58,800 KB
testcase_31 AC 387 ms
59,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class No91 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        List<Integer> l = new ArrayList<Integer>() {{
            add(s.nextInt());
            add(s.nextInt());
            add(s.nextInt());
        }};
        l.sort(Comparator.naturalOrder());
        while (l.get(2) - l.get(0) > 2) {
            l.set(2, l.get(2) - 2);
            l.set(0, l.get(0) + 1);
            l.sort(Comparator.naturalOrder());
        }
        System.out.println(l.get(0));
    }
}
0