結果

問題 No.516 赤と青の風船
ユーザー samplelpmassamplelpmas
提出日時 2017-06-04 00:08:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 2,217 ms
コンパイル使用メモリ 74,396 KB
実行使用メモリ 57,436 KB
最終ジャッジ日時 2023-10-22 03:09:57
合計ジャッジ時間 3,867 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
57,416 KB
testcase_01 AC 116 ms
56,236 KB
testcase_02 AC 124 ms
57,144 KB
testcase_03 AC 123 ms
57,436 KB
testcase_04 AC 108 ms
56,236 KB
testcase_05 AC 123 ms
57,432 KB
testcase_06 AC 125 ms
57,412 KB
testcase_07 AC 123 ms
57,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int redCount = 0;
        int blueCount = 0;

        for (int i = 0;i < 3; i++) {

            String color = sc.next();

            if (color.equals("RED")) {
                redCount++;
            } else if (color.equals("BLUE")) {
                blueCount++;
            }

        }

        System.out.println(redCount > blueCount ? "RED" : "BLUE");

    }

}
0