結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 13 ms
5,376 KB
testcase_04 AC 7 ms
5,376 KB
testcase_05 AC 13 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 9 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 28 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 24 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]=1;
			a[2]-=2;
		}
		sort(a,a+3);
		if(a[0]==0&&a[1]<3&&a[2]<3)break;
	}
	cout<<s<<endl;
	return 0;
}
0