結果

問題 No.91 赤、緑、青の石
ユーザー data9824
提出日時 2015-05-13 18:37:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 269 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 58,584 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 06:48:20
合計ジャッジ時間 1,860 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int c[3];
	cin >> c[0] >> c[1] >> c[2];
	for (;;) {
		sort(c, c + 3);
		if (c[0] == c[2] || c[0] + 1 == c[2]) {
			break;
		}
		c[2] -= 2;
		c[0] += 1;
	}
	cout << c[0] << endl;
	return 0;
}
0