結果

問題 No.91 赤、緑、青の石
ユーザー ant2357
提出日時 2016-05-06 22:21:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 461 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 96,684 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 06:57:32
合計ジャッジ時間 2,384 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#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