結果

問題 No.516 赤と青の風船
コンテスト
ユーザー nisshimo
提出日時 2019-01-19 20:10:57
言語 C++11
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 170µs
コード長 515 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 262 ms
コンパイル使用メモリ 68,836 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-16 17:17:01
合計ジャッジ時間 1,320 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>

void count_r_b(int* num_r_b, char s)
{
  if (s == 114 || s == 82)
  {
    num_r_b[0] += 1;
  }
  else
  {
    num_r_b[1] += 1;
  }
}


int main(void)
{
  int num_r_b[2];
  char s_0[4], s_1[4], s_2[4];
  scanf("%s", s_0);
  scanf("%s", s_1);
  scanf("%s", s_2);
  num_r_b[0]=0;
  num_r_b[1]=0;
  count_r_b(num_r_b, s_0[0]);
  count_r_b(num_r_b, s_1[0]);
  count_r_b(num_r_b, s_2[0]);
  if (num_r_b[0] > num_r_b[1])
  {
    printf("%s\n", "RED");
  }
  else
  {
    printf("%s\n", "BLUE");
  }
}
0