結果

問題 No.91 赤、緑、青の石
ユーザー Guest
提出日時 2018-03-19 23:29:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 58,792 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 07:13:28
合計ジャッジ時間 1,787 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)

int main() {
	int stone[3], ans = 0, x;
	REP(i,3)
		cin >> stone[i];
	sort(stone, stone + 3);
	while (stone[0]>=0) {
		x = stone[0];
		ans += x;
		REP(i,3)
			stone[i] -= x;
		stone[2] -= 2;
		stone[0]++;
		sort(stone, stone + 3);
	}
	cout << ans << endl;
}
0