結果

問題 No.516 赤と青の風船
ユーザー jimanojimano
提出日時 2018-01-25 12:56:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 2,880 ms
コンパイル使用メモリ 71,484 KB
実行使用メモリ 49,328 KB
最終ジャッジ日時 2023-08-27 05:50:11
合計ジャッジ時間 3,877 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,112 KB
testcase_01 AC 43 ms
49,200 KB
testcase_02 AC 43 ms
49,328 KB
testcase_03 AC 43 ms
49,264 KB
testcase_04 AC 43 ms
49,000 KB
testcase_05 AC 44 ms
49,172 KB
testcase_06 AC 43 ms
49,196 KB
testcase_07 AC 44 ms
49,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

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

public class No0516 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int cntRed = 0;
			int cntBlue = 0;
			for (int i = 0; i < 3; i++) {
				if (br.readLine().equals("BLUE")) {
					cntBlue++;
				} else {
					cntRed++;
				}
			}
			System.out.println(cntRed < cntBlue ? "BLUE" : "RED");

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0