結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
![]() |
提出日時 | 2014-12-07 21:58:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 748 ms |
コンパイル使用メモリ | 65,932 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 17:39:06 |
合計ジャッジ時間 | 1,517 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 WA * 21 |
ソースコード
#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 * 2) / 5; cout << ans << endl; return 0; }