結果

問題 No.516 赤と青の風船
ユーザー kichirb3kichirb3
提出日時 2018-02-27 09:37:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 662 bytes
コンパイル時間 862 ms
コンパイル使用メモリ 69,636 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-18 12:45:32
合計ジャッジ時間 1,280 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.516 赤と青の風船
// https://yukicoder.me/problems/no/516
//
#include <iostream>
#include <vector>
#include <string>
using namespace std;

string solve(vector<string> &balloons);


int main() {
    const int num_of_balloons = 3;

    vector<string> balloons(num_of_balloons);
    for (auto i = 0; i < num_of_balloons; i++) {
        cin >> balloons[i];
    }
    string ans = solve(balloons);
    cout << ans << endl;
}

string solve(vector<string> &balloons) {
    int red = 0;
    int blue = 0;

    for (auto b: balloons) {
        if (b == "RED")
            red++;
        else
            blue++;
    }
    return (red > blue? "RED": "BLUE");
}
0