結果

問題 No.91 赤、緑、青の石
ユーザー kotatsugame
提出日時 2017-01-01 02:28:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 393 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 68,596 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2024-12-16 04:48:56
合計ジャッジ時間 74,084 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 7 WA * 10 TLE * 11
権限があれば一括ダウンロードができます

ソースコード

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]<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