結果

問題 No.91 赤、緑、青の石
ユーザー kotatsugamekotatsugame
提出日時 2017-01-01 02:29:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 68,952 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-09 14:43:04
合計ジャッジ時間 1,401 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 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 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<algorithm>
using namespace std;

int main() {
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	int s=0;
	while(1)
	{
		s+=a[0];
		a[2]-=a[0];a[1]-=a[0];
		if(a[1]+1<a[2])
		{
			a[0]=(a[2]-a[1])/2;
			a[2]-=a[0]*2;
		}
		else
		{
			a[0]=(a[1]+a[2])/4;
			a[1]-=a[0];a[2]-=a[0];
		}
		sort(a,a+3);
		if(a[0]==0&&a[1]<3&&a[2]<3)break;
	}
	cout<<s<<endl;
	return 0;
}
0