結果

問題 No.91 赤、緑、青の石
ユーザー samplelpmassamplelpmas
提出日時 2017-05-04 02:56:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 205 ms / 5,000 ms
コード長 522 bytes
コンパイル時間 1,946 ms
コンパイル使用メモリ 72,688 KB
実行使用メモリ 56,528 KB
最終ジャッジ日時 2023-09-06 12:29:50
合計ジャッジ時間 7,995 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
56,468 KB
testcase_01 AC 171 ms
56,372 KB
testcase_02 AC 156 ms
56,368 KB
testcase_03 AC 170 ms
55,884 KB
testcase_04 AC 153 ms
56,200 KB
testcase_05 AC 174 ms
56,420 KB
testcase_06 AC 148 ms
56,060 KB
testcase_07 AC 119 ms
56,232 KB
testcase_08 AC 121 ms
56,012 KB
testcase_09 AC 121 ms
56,208 KB
testcase_10 AC 121 ms
56,440 KB
testcase_11 AC 150 ms
56,272 KB
testcase_12 AC 170 ms
55,672 KB
testcase_13 AC 188 ms
56,244 KB
testcase_14 AC 164 ms
55,960 KB
testcase_15 AC 185 ms
56,076 KB
testcase_16 AC 120 ms
56,016 KB
testcase_17 AC 119 ms
54,028 KB
testcase_18 AC 119 ms
55,768 KB
testcase_19 AC 122 ms
56,176 KB
testcase_20 AC 118 ms
55,920 KB
testcase_21 AC 120 ms
55,580 KB
testcase_22 AC 119 ms
56,244 KB
testcase_23 AC 120 ms
56,412 KB
testcase_24 AC 120 ms
54,460 KB
testcase_25 AC 205 ms
56,248 KB
testcase_26 AC 198 ms
55,988 KB
testcase_27 AC 120 ms
55,576 KB
testcase_28 AC 141 ms
56,528 KB
testcase_29 AC 150 ms
56,380 KB
testcase_30 AC 158 ms
56,308 KB
testcase_31 AC 191 ms
55,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[] num = new int[3];

        for (int i = 0; i < 3; i++) {
            num[i] = sc.nextInt();
        }

        while (true) {

            Arrays.sort(num);

            if (num[0] + 3 > num[2]) {
                break;
            }

            num[0] += 1;
            num[2] -= 2;

        }

        System.out.println(num[0]);

    }

}
0