結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー ant2357
提出日時 2016-05-06 22:21:15
言語 C++14
(gcc 13.3.0 + boost 1.89.0)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 461 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 805 ms
コンパイル使用メモリ 97,308 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-07 12:25:54
合計ジャッジ時間 2,154 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>

using namespace std;

int main() {
	int R, G, B;
	vector<int> ans;

	cin >> R >> G >> B;

	ans.push_back(R);
	ans.push_back(G);
	ans.push_back(B);

	while (true) {
		sort(ans.begin(), ans.end());

		if (ans[0] + 3 > ans[2]) break;
		ans[0]++;
		ans[2] -= 2;
	}

	cout << ans[0] << endl;
	return 0;
}
0