結果

問題 No.516 赤と青の風船
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-07 02:45:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 2,998 ms
コンパイル使用メモリ 72,948 KB
実行使用メモリ 49,420 KB
最終ジャッジ日時 2023-08-10 18:33:59
合計ジャッジ時間 4,105 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,204 KB
testcase_01 AC 42 ms
49,420 KB
testcase_02 AC 41 ms
47,292 KB
testcase_03 AC 42 ms
49,056 KB
testcase_04 AC 42 ms
49,420 KB
testcase_05 AC 42 ms
49,296 KB
testcase_06 AC 42 ms
49,336 KB
testcase_07 AC 43 ms
49,200 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