結果

問題 No.516 赤と青の風船
ユーザー misk703
提出日時 2018-05-09 14:50:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 3,611 ms
コンパイル使用メモリ 74,764 KB
実行使用メモリ 41,360 KB
最終ジャッジ日時 2024-06-28 02:43:26
合計ジャッジ時間 4,923 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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