結果

問題 No.91 赤、緑、青の石
ユーザー shinwisteria
提出日時 2017-04-02 19:59:34
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 3,286 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2024-07-08 00:13:55
合計ジャッジ時間 9,651 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 13 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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