結果

問題 No.91 赤、緑、青の石
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-19 12:17:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 192 ms / 5,000 ms
コード長 644 bytes
コンパイル時間 1,891 ms
コンパイル使用メモリ 71,624 KB
実行使用メモリ 58,224 KB
最終ジャッジ日時 2023-09-06 12:10:54
合計ジャッジ時間 8,033 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
55,660 KB
testcase_01 AC 159 ms
56,396 KB
testcase_02 AC 144 ms
56,052 KB
testcase_03 AC 163 ms
56,396 KB
testcase_04 AC 153 ms
55,604 KB
testcase_05 AC 173 ms
56,212 KB
testcase_06 AC 141 ms
55,992 KB
testcase_07 AC 121 ms
56,200 KB
testcase_08 AC 121 ms
56,060 KB
testcase_09 AC 122 ms
55,828 KB
testcase_10 AC 120 ms
55,612 KB
testcase_11 AC 151 ms
56,416 KB
testcase_12 AC 173 ms
55,772 KB
testcase_13 AC 187 ms
55,832 KB
testcase_14 AC 165 ms
56,196 KB
testcase_15 AC 183 ms
56,380 KB
testcase_16 AC 118 ms
55,980 KB
testcase_17 AC 115 ms
56,248 KB
testcase_18 AC 118 ms
55,792 KB
testcase_19 AC 115 ms
56,532 KB
testcase_20 AC 112 ms
55,988 KB
testcase_21 AC 116 ms
56,208 KB
testcase_22 AC 116 ms
56,476 KB
testcase_23 AC 111 ms
55,676 KB
testcase_24 AC 118 ms
54,372 KB
testcase_25 AC 192 ms
58,224 KB
testcase_26 AC 185 ms
56,392 KB
testcase_27 AC 117 ms
56,536 KB
testcase_28 AC 121 ms
56,216 KB
testcase_29 AC 127 ms
55,884 KB
testcase_30 AC 155 ms
56,188 KB
testcase_31 AC 183 ms
56,412 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);
        }
        while(a[2]>=5){
            a[2]=a[2]-5;
            number++;
        }
        System.out.println(number);
    }
}
0