結果

問題 No.516 赤と青の風船
ユーザー misk703misk703
提出日時 2018-05-09 14:50:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 4,407 ms
コンパイル使用メモリ 72,072 KB
実行使用メモリ 56,140 KB
最終ジャッジ日時 2023-09-10 11:20:08
合計ジャッジ時間 5,531 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,800 KB
testcase_01 AC 122 ms
55,776 KB
testcase_02 AC 122 ms
55,572 KB
testcase_03 AC 123 ms
55,572 KB
testcase_04 AC 122 ms
55,756 KB
testcase_05 AC 123 ms
55,764 KB
testcase_06 AC 124 ms
55,808 KB
testcase_07 AC 124 ms
56,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Husen {

    public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
	int cntB = 0;
	int cntR = 0;
	for(int i=0;i<3;i++){
	    String s = scanner.nextLine();
	    if(s.equals("BLUE")){
		cntB++;
	    }else{
		cntR++;
	    }
	}

	if(cntB > cntR){
	    System.out.println("BLUE");
	}else{
	    System.out.println("RED");
	}

    }

}
0