結果
| 問題 | No.516 赤と青の風船 |
| コンテスト | |
| ユーザー |
toto
|
| 提出日時 | 2025-04-01 16:45:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 342 bytes |
| 記録 | |
| コンパイル時間 | 517 ms |
| コンパイル使用メモリ | 27,392 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-01 16:45:40 |
| 合計ジャッジ時間 | 1,269 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",str);
| ~~~~~^~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
char str[4];
int red = 0;
int blue = 0;
for(int i = 0;i < 3;i ++){
scanf("%s",str);
if(str[0] == 'R'){
red ++;
}else if(str[0] == 'B'){
blue++;
}
}
if(blue < red){
printf("RED");
}else{
printf("BLUE");
}
}
toto