結果

問題 No.91 赤、緑、青の石
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-30 18:20:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 206 ms / 5,000 ms
コード長 457 bytes
コンパイル時間 1,819 ms
コンパイル使用メモリ 71,684 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-09-06 12:40:21
合計ジャッジ時間 8,757 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 194 ms
56,168 KB
testcase_01 AC 183 ms
55,568 KB
testcase_02 AC 167 ms
56,092 KB
testcase_03 AC 184 ms
55,880 KB
testcase_04 AC 165 ms
55,792 KB
testcase_05 AC 182 ms
56,116 KB
testcase_06 AC 159 ms
56,016 KB
testcase_07 AC 130 ms
55,540 KB
testcase_08 AC 130 ms
55,740 KB
testcase_09 AC 130 ms
54,288 KB
testcase_10 AC 130 ms
55,700 KB
testcase_11 AC 163 ms
55,932 KB
testcase_12 AC 185 ms
55,848 KB
testcase_13 AC 200 ms
55,568 KB
testcase_14 AC 179 ms
55,600 KB
testcase_15 AC 172 ms
56,016 KB
testcase_16 AC 111 ms
55,696 KB
testcase_17 AC 104 ms
55,700 KB
testcase_18 AC 110 ms
55,952 KB
testcase_19 AC 111 ms
55,776 KB
testcase_20 AC 112 ms
55,740 KB
testcase_21 AC 111 ms
55,508 KB
testcase_22 AC 113 ms
56,188 KB
testcase_23 AC 116 ms
55,864 KB
testcase_24 AC 114 ms
55,836 KB
testcase_25 AC 187 ms
55,836 KB
testcase_26 AC 206 ms
55,964 KB
testcase_27 AC 112 ms
56,000 KB
testcase_28 AC 134 ms
56,276 KB
testcase_29 AC 137 ms
55,552 KB
testcase_30 AC 148 ms
55,928 KB
testcase_31 AC 187 ms
56,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int r=scanner.nextInt();
		int b=scanner.nextInt();
		int g=scanner.nextInt();
		int x[]=new int[3];
		x[0]=r;
		x[1]=b;
		x[2]=g;
		Arrays.sort(x);
		while(true) {
		if(x[2]-x[0]<3)break;
		x[0]++;
		x[2]-=2;
		Arrays.sort(x);
		}
		System.out.println(x[0]);
	}
}
0