結果

問題 No.91 赤、緑、青の石
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-07-03 02:09:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 205 ms / 5,000 ms
コード長 391 bytes
コンパイル時間 3,165 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 56,608 KB
最終ジャッジ日時 2023-09-06 12:38:56
合計ジャッジ時間 9,283 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 183 ms
56,244 KB
testcase_01 AC 172 ms
55,968 KB
testcase_02 AC 156 ms
56,100 KB
testcase_03 AC 166 ms
56,204 KB
testcase_04 AC 154 ms
55,916 KB
testcase_05 AC 171 ms
56,372 KB
testcase_06 AC 146 ms
56,284 KB
testcase_07 AC 120 ms
56,056 KB
testcase_08 AC 119 ms
56,088 KB
testcase_09 AC 120 ms
55,992 KB
testcase_10 AC 120 ms
55,908 KB
testcase_11 AC 151 ms
56,560 KB
testcase_12 AC 172 ms
55,808 KB
testcase_13 AC 191 ms
56,520 KB
testcase_14 AC 164 ms
55,912 KB
testcase_15 AC 184 ms
55,864 KB
testcase_16 AC 120 ms
56,004 KB
testcase_17 AC 121 ms
55,784 KB
testcase_18 AC 121 ms
55,992 KB
testcase_19 AC 120 ms
56,140 KB
testcase_20 AC 122 ms
55,764 KB
testcase_21 AC 119 ms
56,244 KB
testcase_22 AC 120 ms
55,788 KB
testcase_23 AC 120 ms
56,608 KB
testcase_24 AC 120 ms
56,240 KB
testcase_25 AC 205 ms
56,408 KB
testcase_26 AC 196 ms
56,200 KB
testcase_27 AC 118 ms
55,624 KB
testcase_28 AC 140 ms
56,116 KB
testcase_29 AC 148 ms
56,204 KB
testcase_30 AC 158 ms
56,060 KB
testcase_31 AC 193 ms
56,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No091{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int r = sc.nextInt();
		int g = sc.nextInt();
		int b = sc.nextInt();
		int[] rgb = new int[]{r, g, b};

		while(true){
			Arrays.sort(rgb);
			if(rgb[2]-rgb[0] <= 2){
				break;
			}else{
				rgb[0] += 1;
				rgb[2] -= 2;
			}
		}
		System.out.println(rgb[0]);
	}
}
0