結果

問題 No.516 赤と青の風船
ユーザー kazapyon27kazapyon27
提出日時 2017-06-25 16:54:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 3,464 ms
コンパイル使用メモリ 75,296 KB
実行使用メモリ 50,348 KB
最終ジャッジ日時 2024-04-15 01:33:16
合計ジャッジ時間 4,477 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
50,288 KB
testcase_01 AC 54 ms
49,932 KB
testcase_02 AC 54 ms
50,348 KB
testcase_03 AC 55 ms
50,000 KB
testcase_04 AC 54 ms
50,112 KB
testcase_05 AC 54 ms
49,848 KB
testcase_06 AC 55 ms
50,292 KB
testcase_07 AC 57 ms
50,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.516 赤と青の風船*/
import java.io.*;
public class No516 {
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			String [] H_balloon = new String[3];
			byte red=0,blue=0;
			for(int i=0;i<3;i++){
				H_balloon[i]=input.readLine();
			}
			for(int i=0;red<2&&blue<2;i++){
				if(H_balloon[i].equals("RED")){
					red++;
				}else{
					blue++;
				}
			}
			if(red>blue){
				System.out.println("RED");
			}else{
				System.out.println("BLUE");
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0