結果

問題 No.516 赤と青の風船
ユーザー cb_4150cb_4150
提出日時 2017-08-16 00:52:45
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 294 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 55,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 12:39:09
合計ジャッジ時間 794 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:9: warning: ‘bluc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |         if (redc > bluc) {
      |         ^~
main.cpp:12:9: warning: ‘redc’ may be used uninitialized in this function [-Wmaybe-uninitialized]

ソースコード

diff #

#include <iostream>
#include <string>

int main() {
	std::string str;
	int redc, bluc;
	while (std::cin >> str) {
		if (str ==  "RED") redc++;
		if (str == "BLUE") bluc++;
	}

	if (redc > bluc) {
		std::cout << "RED" << std::endl;
	}
	else {
		std::cout << "BLUE" << std::endl;
	}

	return 0;
}
0