結果
問題 | No.516 赤と青の風船 |
ユーザー |
|
提出日時 | 2018-01-25 12:53:16 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 6,335 ms |
コンパイル使用メモリ | 72,976 KB |
実行使用メモリ | 36,784 KB |
最終ジャッジ日時 | 2024-12-26 15:34:06 |
合計ジャッジ時間 | 6,766 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
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))) {String[] input = new String[3];int cntRed = 0;int cntBlue = 0;for (int i = 0; i < input.length; i++) {input[i] = br.readLine();if (input[i].equals("BLUE")) {cntBlue++;} else {cntRed++;}}System.out.println(cntRed < cntBlue ? "BLUE" : "RED");} catch (IOException e) {e.printStackTrace();}}}