結果
問題 |
No.516 赤と青の風船
|
ユーザー |
![]() |
提出日時 | 2018-02-27 09:37:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 715 ms |
コンパイル使用メモリ | 70,580 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-27 17:51:23 |
合計ジャッジ時間 | 1,202 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
// 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"); }