結果

問題 No.91 赤、緑、青の石
ユーザー ぴろずぴろず
提出日時 2014-12-07 19:22:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 3,052 ms
コンパイル使用メモリ 70,928 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2023-09-02 09:20:08
合計ジャッジ時間 8,679 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
55,740 KB
testcase_01 AC 153 ms
56,024 KB
testcase_02 AC 152 ms
55,920 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 147 ms
55,696 KB
testcase_07 AC 141 ms
55,924 KB
testcase_08 AC 144 ms
55,476 KB
testcase_09 WA -
testcase_10 AC 141 ms
55,684 KB
testcase_11 AC 149 ms
55,896 KB
testcase_12 AC 157 ms
55,760 KB
testcase_13 AC 154 ms
55,504 KB
testcase_14 AC 155 ms
55,764 KB
testcase_15 AC 154 ms
55,852 KB
testcase_16 AC 141 ms
55,916 KB
testcase_17 AC 141 ms
55,860 KB
testcase_18 AC 143 ms
55,932 KB
testcase_19 AC 143 ms
55,900 KB
testcase_20 AC 142 ms
55,900 KB
testcase_21 AC 143 ms
56,016 KB
testcase_22 AC 142 ms
56,056 KB
testcase_23 AC 145 ms
55,892 KB
testcase_24 AC 141 ms
55,888 KB
testcase_25 AC 157 ms
55,928 KB
testcase_26 WA -
testcase_27 AC 132 ms
55,836 KB
testcase_28 AC 145 ms
55,816 KB
testcase_29 AC 147 ms
56,068 KB
testcase_30 AC 140 ms
55,912 KB
testcase_31 AC 148 ms
55,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no091;

import java.util.Scanner;

public class Main {
	public static final int MAX = 10000000;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int r = sc.nextInt();
		int g = sc.nextInt();
		int b = sc.nextInt();
		for(int i=MAX;i>=0;i--) {
			int sum = r + g + b;
			int need = 0;
			need += r < i ? r + (i-r) * 2 : i;
			need += g < i ? g + (i-g) * 2 : i;
			need += b < i ? b + (i-b) * 2 : i;
			//System.out.println(i + "," + need);
			if (sum >= need) {
				System.out.println(i);
				break;
			}
		}
	}

}
0