結果

問題 No.91 赤、緑、青の石
ユーザー hotpepsi
提出日時 2014-12-07 22:12:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 66,692 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-11 17:40:02
合計ジャッジ時間 1,627 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 11 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])
{
	string s;
	int r, g, b;
	getline(cin, s);
	stringstream ss(s);
	ss >> r >> g >> b;
	int ans = min(r, min(g, b));
	int a[3] = { r - ans, g - ans, b - ans };
	sort(a, a + 3);
	int c = min(a[1], (a[2] - a[1]) / 2);
	ans += c;
	ans += (a[2] - c * 3) / 5;
	cout << ans << endl;
	return 0;
}
0