結果

問題 No.516 赤と青の風船
ユーザー Kamed
提出日時 2019-02-18 14:00:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 56,560 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 01:24:16
合計ジャッジ時間 896 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
int main()
{
	// 3.赤と青の風船_516|
	std::string barun = "";
	int a = 0, b = 0;
	for (int i = 0;i < 3; i++)
	{
		std::cin >> barun;
		if (barun == "RED")
		{
			a++;
		}
		else if (barun == "BLUE") 
		{
			b++;
		}
		else{}
		barun = "";
	}
	if (a > b)
	{
		std::cout << "RED" << std::endl;
	}
	else if (b > a)
	{
		std::cout << "BLUE" << std::endl;
	}
	else{}
	return 0;
}
0