結果
| 問題 | No.516 赤と青の風船 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-26 05:31:21 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 370 bytes |
| 記録 | |
| コンパイル時間 | 598 ms |
| コンパイル使用メモリ | 88,704 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-05 05:05:34 |
| 合計ジャッジ時間 | 1,250 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:41: warning: 'r' may be used uninitialized [-Wmaybe-uninitialized]
17 | cin >> s, (s[0] == 'R') ? r++ : b++;
| ~~~~~~~~~~~~~~^~~~~~~~~~~
main.cpp:14:13: note: 'r' was declared here
14 | int r, b;
| ^
main.cpp:17:41: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
17 | cin >> s, (s[0] == 'R') ? r++ : b++;
| ~~~~~~~~~~~~~~^~~~~~~~~~~
main.cpp:14:16: note: 'b' was declared here
14 | int r, b;
| ^
ソースコード
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long lint;
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
int main()
{
int r, b;
string s;
for (int i = 0; i < 3; i++)
cin >> s, (s[0] == 'R') ? r++ : b++;
cout << (r < b ? "BLUE" : "RED") << endl;
return 0;
}