結果

問題 No.516 赤と青の風船
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-07 02:45:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 3,266 ms
コンパイル使用メモリ 75,340 KB
実行使用メモリ 50,308 KB
最終ジャッジ日時 2024-04-28 11:59:23
合計ジャッジ時間 3,717 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
49,876 KB
testcase_01 AC 49 ms
50,084 KB
testcase_02 AC 48 ms
50,308 KB
testcase_03 AC 47 ms
49,936 KB
testcase_04 AC 48 ms
49,736 KB
testcase_05 AC 48 ms
50,084 KB
testcase_06 AC 49 ms
49,720 KB
testcase_07 AC 47 ms
50,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No516{
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] str = new String[3];
			setColor(br, str);
			getColor(str);
			System.out.println(getColor(str));
			
		} catch (IOException e) {
			e.getStackTrace();
		}
	}
	
	public static void setColor(BufferedReader br, String[] s) throws IOException {
			for(int i=0; i<3; i++)
				s[i] = br.readLine();
	}
	
	public static String getColor(String[] s){
		int RED = 0;
		int BLUE = 0;
		for(int i=0; i<s.length; i++){
			if(s[i].equals("RED")) RED++;
			else BLUE++;
		}
		if(RED > BLUE) return "RED";
		else return "BLUE";
	}
	
}
0