結果

問題 No.91 赤、緑、青の石
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 19:59:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 3,340 ms
コンパイル使用メモリ 72,780 KB
実行使用メモリ 56,432 KB
最終ジャッジ日時 2023-09-22 07:44:18
合計ジャッジ時間 9,931 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
55,988 KB
testcase_01 WA -
testcase_02 AC 160 ms
56,296 KB
testcase_03 AC 173 ms
55,772 KB
testcase_04 AC 157 ms
56,156 KB
testcase_05 AC 173 ms
55,704 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 122 ms
56,068 KB
testcase_10 WA -
testcase_11 AC 152 ms
56,040 KB
testcase_12 AC 174 ms
55,468 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 121 ms
56,004 KB
testcase_17 WA -
testcase_18 AC 121 ms
55,776 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 205 ms
55,756 KB
testcase_27 WA -
testcase_28 AC 145 ms
55,536 KB
testcase_29 AC 155 ms
56,432 KB
testcase_30 WA -
testcase_31 AC 197 ms
56,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
public class RGB {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s= new Scanner(System.in);
		int[] rgb = new int[3];
		for(int i = 0;i < 3;i++){
			rgb[i] = s.nextInt();
		}
		s.close();
		int count = 0;
		Arrays.sort(rgb);
		while(rgb[0] != 0 || rgb[2] >= 3){
			count += rgb[0];
			rgb[1] -= rgb[0];
			rgb[2] -= (rgb[0]+2);
			rgb[0] = 1;
			Arrays.sort(rgb);
			
		}
		System.out.println(count);

	}

}
0