結果
問題 | No.516 赤と青の風船 |
ユーザー | yamax3232 |
提出日時 | 2018-03-16 13:55:18 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 2,107 ms |
コンパイル使用メモリ | 70,872 KB |
実行使用メモリ | 39,516 KB |
最終ジャッジ日時 | 2023-08-23 11:47:13 |
合計ジャッジ時間 | 3,803 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 115 ms
38,832 KB |
testcase_01 | AC | 116 ms
39,088 KB |
testcase_02 | WA | - |
testcase_03 | AC | 114 ms
39,256 KB |
testcase_04 | WA | - |
testcase_05 | AC | 115 ms
38,700 KB |
testcase_06 | AC | 114 ms
39,140 KB |
testcase_07 | AC | 115 ms
39,516 KB |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner kb=new Scanner(System.in); String s=kb.nextLine(); int r=0,b=0; for(int i=0;i<s.length();i++){ if(i+3<s.length()){ if(s.charAt(i)=='R'&& s.charAt(i+1)=='E'&& s.charAt(i+2)=='D'){ r++; }if(s.charAt(i)=='B'&& s.charAt(i+1)=='L'&& s.charAt(i+2)=='U'&& s.charAt(i+3)=='E'){ b++; } } } if(r<b){ System.out.println("BLUE"); }else{ System.out.println("RED"); } } }