結果
| 問題 |
No.516 赤と青の風船
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-25 18:46:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 241 bytes |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 12:41:02 |
| 合計ジャッジ時間 | 686 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",s);
| ~~~~~^~~~~~~~
ソースコード
#include <cstdio>
int main(){
int red=0,blue=0;char s[5];
for(int i=0;i<3;i++){
scanf("%s",s);
if(s[0]=='R')red++;
else blue++;
}
if(red>blue)printf("RED\n");
else printf("BLUE\n");
return 0;
}