結果

問題 No.91 赤、緑、青の石
ユーザー ふーらくたる
提出日時 2017-11-04 11:26:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 57,828 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-23 05:39:28
合計ジャッジ時間 2,286 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int R, G, B;
    cin >> R >> G >> B;

    int ans = 0;
    for (int i = 0; i < max({R, G, B}); i++) {
        int num = max(0, (R - i) / 2) + max(0, (G - i) / 2) + max(0, (B - i) / 2);
        num -= max(0, i - R) + max(0, i - G) + max(0, i - B);
        if (num >= 0) ans = i;
    }
    cout << ans << endl;
    return 0;
}
0