結果

問題 No.91 赤、緑、青の石
ユーザー dgd1724dgd1724
提出日時 2016-10-27 07:22:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 162,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-03 06:17:38
合計ジャッジ時間 3,222 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
5,248 KB
testcase_01 AC 13 ms
5,248 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 10 ms
5,376 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 10 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 12 ms
5,376 KB
testcase_13 AC 24 ms
5,376 KB
testcase_14 AC 7 ms
5,376 KB
testcase_15 AC 20 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 23 ms
5,376 KB
testcase_26 AC 20 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 4 ms
5,376 KB
testcase_31 AC 17 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	std::vector<int> A(3);
	std::cin >> A[0] >> A[1] >> A[2];

	int ans = 0;

	while (1) {
		std::sort(A.begin(), A.end());
		ans += A[0];
		for (int i = 2; i >= 0; i--) { A[i] -= A[0]; }
		if (A[2] <= 2) { break; }
		while (A[2] > 2 && A[2] >= A[1] & A[2] > A[0]) {
			A[2] -= 2;
			A[0]++;
		}
	}

	std::cout << ans << std::endl;

}

0