結果

問題 No.91 赤、緑、青の石
ユーザー ふーらくたるふーらくたる
提出日時 2017-11-04 11:26:16
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 56,796 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 14:55:07
合計ジャッジ時間 1,881 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
5,248 KB
testcase_01 AC 19 ms
5,248 KB
testcase_02 AC 28 ms
5,376 KB
testcase_03 AC 22 ms
5,376 KB
testcase_04 AC 25 ms
5,376 KB
testcase_05 AC 23 ms
5,376 KB
testcase_06 AC 17 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 25 ms
5,376 KB
testcase_12 AC 27 ms
5,376 KB
testcase_13 AC 19 ms
5,376 KB
testcase_14 AC 24 ms
5,376 KB
testcase_15 AC 28 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 30 ms
5,376 KB
testcase_26 AC 29 ms
5,376 KB
testcase_27 AC 30 ms
5,376 KB
testcase_28 AC 26 ms
5,376 KB
testcase_29 AC 18 ms
5,376 KB
testcase_30 AC 30 ms
5,376 KB
testcase_31 AC 29 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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