結果

問題 No.91 赤、緑、青の石
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-19 12:13:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 71,924 KB
実行使用メモリ 56,204 KB
最終ジャッジ日時 2023-09-18 00:47:00
合計ジャッジ時間 8,941 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 191 ms
55,912 KB
testcase_01 AC 176 ms
55,780 KB
testcase_02 AC 163 ms
55,496 KB
testcase_03 AC 178 ms
56,184 KB
testcase_04 AC 164 ms
55,928 KB
testcase_05 AC 180 ms
55,476 KB
testcase_06 WA -
testcase_07 AC 128 ms
55,884 KB
testcase_08 AC 128 ms
55,860 KB
testcase_09 AC 128 ms
55,944 KB
testcase_10 AC 130 ms
55,460 KB
testcase_11 AC 157 ms
55,472 KB
testcase_12 AC 182 ms
55,924 KB
testcase_13 AC 195 ms
55,888 KB
testcase_14 AC 173 ms
55,952 KB
testcase_15 AC 193 ms
55,736 KB
testcase_16 AC 129 ms
55,660 KB
testcase_17 AC 129 ms
55,712 KB
testcase_18 AC 128 ms
55,524 KB
testcase_19 AC 131 ms
55,672 KB
testcase_20 AC 129 ms
56,204 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 129 ms
53,564 KB
testcase_24 AC 130 ms
55,696 KB
testcase_25 AC 213 ms
55,692 KB
testcase_26 AC 207 ms
55,696 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 166 ms
55,736 KB
testcase_31 AC 200 ms
55,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i]=koko.nextInt();
        }
        Arrays.sort(a);
        int number=a[0];
        for(int i=0; i<3; i++){
            a[i]=a[i]-number;
        }
        while(a[2]>=3&&a[1]>=1){
            a[2]=a[2]-3;
            a[1]=a[1]-1;
            number++;
            Arrays.sort(a);
        }
        System.out.println(number);
    }
}
0