結果
| 問題 | 
                            No.516 赤と青の風船
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nisshimo
                         | 
                    
| 提出日時 | 2019-01-19 20:10:57 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 515 bytes | 
| コンパイル時間 | 357 ms | 
| コンパイル使用メモリ | 53,368 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-18 07:54:11 | 
| 合計ジャッジ時間 | 940 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 6 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |   scanf("%s", s_0);
      |   ~~~~~^~~~~~~~~~~
main.cpp:21:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |   scanf("%s", s_1);
      |   ~~~~~^~~~~~~~~~~
main.cpp:22:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |   scanf("%s", s_2);
      |   ~~~~~^~~~~~~~~~~
            
            ソースコード
#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");
  }
}
            
            
            
        
            
nisshimo