結果

問題 No.516 赤と青の風船
ユーザー tentententen
提出日時 2020-11-12 08:21:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 71,808 KB
実行使用メモリ 55,840 KB
最終ジャッジ日時 2023-09-30 01:04:30
合計ジャッジ時間 3,824 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,560 KB
testcase_01 AC 122 ms
55,660 KB
testcase_02 AC 121 ms
55,636 KB
testcase_03 AC 121 ms
55,660 KB
testcase_04 AC 120 ms
55,628 KB
testcase_05 AC 123 ms
55,772 KB
testcase_06 AC 124 ms
55,808 KB
testcase_07 AC 121 ms
55,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int red = 0;
        int blue = 0;
        for (int i = 0; i < 3; i++) {
            if (sc.next().charAt(0) == 'R') {
                red++;
            } else {
                blue++;
            }
        }
        if (red > blue) {
            System.out.println("RED");
        } else {
            System.out.println("BLUE");
        }
    }
}
0