結果

問題 No.516 赤と青の風船
ユーザー yamax3232yamax3232
提出日時 2018-03-16 13:54:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 1,929 ms
コンパイル使用メモリ 71,384 KB
実行使用メモリ 57,748 KB
最終ジャッジ日時 2023-08-23 11:47:09
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,932 KB
testcase_01 AC 120 ms
56,100 KB
testcase_02 WA -
testcase_03 AC 121 ms
55,728 KB
testcase_04 WA -
testcase_05 AC 122 ms
55,936 KB
testcase_06 AC 122 ms
56,324 KB
testcase_07 AC 121 ms
55,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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++;
					break;
				}if(s.charAt(i)=='B'&&
						s.charAt(i+1)=='L'&&
						s.charAt(i+2)=='U'&&
						s.charAt(i+3)=='E'){
					b++;
					break;
				}
			}
		}
		if(r<b){
			System.out.println("BLUE");
		}else{
			System.out.println("RED");
		}
	}

}
0