結果
問題 |
No.516 赤と青の風船
|
ユーザー |
|
提出日時 | 2022-02-09 15:32:10 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 129 ms / 2,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 2,395 ms |
コンパイル使用メモリ | 74,928 KB |
実行使用メモリ | 41,332 KB |
最終ジャッジ日時 | 2024-06-24 18:35:53 |
合計ジャッジ時間 | 4,463 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
import java.util.Scanner; 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++) { String s = sc.next(); if (s.equals("RED")) { red += 1; } else { blue += 1; } } if (red > blue) { System.out.println("RED"); } else { System.out.println("BLUE"); } sc.close(); } }