結果

問題 No.91 赤、緑、青の石
ユーザー ぴろずぴろず
提出日時 2014-12-07 20:18:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 4,082 ms
コンパイル使用メモリ 72,152 KB
実行使用メモリ 57,500 KB
最終ジャッジ日時 2023-09-02 09:42:14
合計ジャッジ時間 8,974 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 124 ms
56,000 KB
testcase_08 AC 127 ms
55,920 KB
testcase_09 AC 127 ms
55,868 KB
testcase_10 AC 127 ms
55,508 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 125 ms
55,460 KB
testcase_17 AC 126 ms
55,664 KB
testcase_18 AC 126 ms
55,476 KB
testcase_19 AC 125 ms
55,764 KB
testcase_20 AC 127 ms
55,468 KB
testcase_21 AC 127 ms
55,648 KB
testcase_22 AC 125 ms
55,728 KB
testcase_23 AC 125 ms
55,532 KB
testcase_24 AC 124 ms
55,756 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package no091;

import java.util.Arrays;
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[] m = new int[3];
		for(int i=0;i<3;i++) {
			m[i] = sc.nextInt();
		}
		for(int i=100;i>=0;i--) {
			int[] n = Arrays.copyOf(m, 3);
			int need = 0;
			for(int j=0;j<3;j++) {
				if (n[j] < i) {
					need += i - n[j];
					n[j] = 0;
				}else{
					n[j] -= i;
				}
			}
			//System.out.println(i + "," + need + "," + Arrays.toString(n));
			int amari = 0;
			for(int j=0;j<3;j++) {
				amari += n[j] / 2;
			}
			if (amari >= need) {
				System.out.println(i);
				break;
			}
		}
	}

}
0