結果

問題 No.91 赤、緑、青の石
ユーザー tsunabittsunabit
提出日時 2020-02-09 17:19:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 192 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 3,069 ms
コンパイル使用メモリ 72,496 KB
実行使用メモリ 58,396 KB
最終ジャッジ日時 2023-09-06 12:46:16
合計ジャッジ時間 9,087 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
56,412 KB
testcase_01 AC 170 ms
56,128 KB
testcase_02 AC 154 ms
56,120 KB
testcase_03 AC 158 ms
55,992 KB
testcase_04 AC 153 ms
56,400 KB
testcase_05 AC 169 ms
55,880 KB
testcase_06 AC 137 ms
56,348 KB
testcase_07 AC 116 ms
56,304 KB
testcase_08 AC 117 ms
55,908 KB
testcase_09 AC 117 ms
56,096 KB
testcase_10 AC 112 ms
55,484 KB
testcase_11 AC 140 ms
58,396 KB
testcase_12 AC 160 ms
56,092 KB
testcase_13 AC 176 ms
56,100 KB
testcase_14 AC 153 ms
56,336 KB
testcase_15 AC 169 ms
56,360 KB
testcase_16 AC 114 ms
56,420 KB
testcase_17 AC 114 ms
55,904 KB
testcase_18 AC 111 ms
55,872 KB
testcase_19 AC 113 ms
56,068 KB
testcase_20 AC 114 ms
55,944 KB
testcase_21 AC 113 ms
53,924 KB
testcase_22 AC 115 ms
56,364 KB
testcase_23 AC 113 ms
56,228 KB
testcase_24 AC 115 ms
55,880 KB
testcase_25 AC 188 ms
56,680 KB
testcase_26 AC 189 ms
56,244 KB
testcase_27 AC 112 ms
55,872 KB
testcase_28 AC 132 ms
56,356 KB
testcase_29 AC 146 ms
55,892 KB
testcase_30 AC 158 ms
56,084 KB
testcase_31 AC 192 ms
56,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No91 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] rgb = new int[3];
		for(int i = 0; i < rgb.length; i++) {
			rgb[i] = sc.nextInt();
		}
		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