結果

問題 No.91 赤、緑、青の石
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-07 10:43:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 227 ms / 5,000 ms
コード長 1,102 bytes
コンパイル時間 3,213 ms
コンパイル使用メモリ 75,820 KB
実行使用メモリ 58,544 KB
最終ジャッジ日時 2023-09-06 12:10:43
合計ジャッジ時間 9,508 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 201 ms
55,836 KB
testcase_01 AC 183 ms
56,128 KB
testcase_02 AC 164 ms
55,840 KB
testcase_03 AC 180 ms
55,960 KB
testcase_04 AC 158 ms
56,036 KB
testcase_05 AC 185 ms
56,356 KB
testcase_06 AC 160 ms
56,264 KB
testcase_07 AC 120 ms
55,688 KB
testcase_08 AC 121 ms
56,420 KB
testcase_09 AC 120 ms
56,088 KB
testcase_10 AC 121 ms
55,552 KB
testcase_11 AC 157 ms
55,740 KB
testcase_12 AC 188 ms
56,356 KB
testcase_13 AC 202 ms
55,716 KB
testcase_14 AC 173 ms
58,544 KB
testcase_15 AC 200 ms
56,072 KB
testcase_16 AC 121 ms
56,236 KB
testcase_17 AC 121 ms
56,268 KB
testcase_18 AC 122 ms
55,988 KB
testcase_19 AC 121 ms
56,484 KB
testcase_20 AC 121 ms
56,320 KB
testcase_21 AC 120 ms
56,628 KB
testcase_22 AC 121 ms
55,780 KB
testcase_23 AC 121 ms
55,968 KB
testcase_24 AC 120 ms
55,716 KB
testcase_25 AC 227 ms
55,784 KB
testcase_26 AC 218 ms
56,004 KB
testcase_27 AC 122 ms
56,152 KB
testcase_28 AC 147 ms
55,784 KB
testcase_29 AC 164 ms
55,816 KB
testcase_30 AC 175 ms
56,292 KB
testcase_31 AC 214 ms
56,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.91 赤、緑、青の石

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No91 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        int[] c = new int[3];
        for (int i=0; i<3; i++) c[i] = in.nextInt();
        sort(c);
        int ans = c[0];
        for (int i=2; i>=0; i--) c[i] -= c[0]; 

        while (c[2] >= 3) {
            c[2] -= 2;
            c[0] += 1;
            sort(c);
            if (c[0] > 0 && c[1] > 0) {
                ans += c[0];
                for (int i=2; i>=0; i--) c[i] -= c[0];
            }
        }

        out.println(ans);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0