結果

問題 No.91 赤、緑、青の石
ユーザー scachescache
提出日時 2014-12-07 20:03:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 713 bytes
コンパイル時間 3,454 ms
コンパイル使用メモリ 74,468 KB
実行使用メモリ 58,684 KB
最終ジャッジ日時 2023-09-02 09:34:28
合計ジャッジ時間 8,800 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,784 KB
testcase_01 AC 120 ms
56,308 KB
testcase_02 AC 123 ms
56,180 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 121 ms
56,448 KB
testcase_08 AC 118 ms
56,016 KB
testcase_09 WA -
testcase_10 AC 121 ms
56,152 KB
testcase_11 AC 118 ms
56,152 KB
testcase_12 AC 119 ms
56,048 KB
testcase_13 AC 120 ms
56,052 KB
testcase_14 AC 122 ms
56,224 KB
testcase_15 AC 120 ms
55,904 KB
testcase_16 AC 122 ms
55,636 KB
testcase_17 AC 120 ms
56,304 KB
testcase_18 AC 121 ms
56,200 KB
testcase_19 AC 120 ms
56,356 KB
testcase_20 AC 120 ms
56,124 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 122 ms
56,096 KB
testcase_24 AC 120 ms
56,160 KB
testcase_25 AC 120 ms
55,976 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 120 ms
56,100 KB
testcase_31 AC 120 ms
56,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


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

public class Main91 {
	public static void main(String[] args) {
		Main91 p = new Main91();
	}

	public Main91() {
		Scanner sc = new Scanner(System.in);
		int[] c = new int[3];
		for(int i=0;i<3;i++)
			c[i] = sc.nextInt();
		solve(c);
	}

	private void solve(int[] c) {
		int res=0;
		int last =0;
		int cur =1;
		while(cur!=last){
			last =cur;
			cur = 0;
			Arrays.sort(c);
			res += c[0];
			for(int i=c.length-1;i>=0;i--)
				c[i] -= c[0];
			
			c[0] += (c[2]-c[1])/2;
			c[2] = c[2]-c[0]*2;
			for(int i=c.length-1;i>=0;i--)
				cur +=c[i];
		}
		res += (c[1]+c[2])/4;
		
		System.out.println(res);
	}

	

}
0