結果

問題 No.516 赤と青の風船
ユーザー syuki791syuki791
提出日時 2017-07-09 15:57:04
言語 Java19
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 2,692 ms
コンパイル使用メモリ 71,200 KB
実行使用メモリ 55,944 KB
最終ジャッジ日時 2023-07-29 03:40:32
合計ジャッジ時間 4,557 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,408 KB
testcase_01 AC 121 ms
55,944 KB
testcase_02 AC 118 ms
55,640 KB
testcase_03 AC 120 ms
55,424 KB
testcase_04 AC 120 ms
55,516 KB
testcase_05 AC 120 ms
55,564 KB
testcase_06 AC 119 ms
55,832 KB
testcase_07 AC 116 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	
	String[] str = new String[3];
	str[0]= s.nextLine();
	str[1]= s.nextLine();
	str[2]= s.nextLine();
	int red = 0;
	int blue = 0;
	
	for(int i =0;i<3;i++){
		if(str[i].equals("RED")){
			red++;
		}else{
			blue++;
		}
	}
	if(red>blue){
		System.out.println("RED");
	}else{
		System.out.println("BLUE");
	}
	
	
	}
}
0