結果
問題 | No.516 赤と青の風船 |
ユーザー |
|
提出日時 | 2021-02-21 15:36:07 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 111 ms / 2,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 2,738 ms |
コンパイル使用メモリ | 74,424 KB |
実行使用メモリ | 41,216 KB |
最終ジャッジ日時 | 2024-09-19 13:41:07 |
合計ジャッジ時間 | 4,336 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = ""; int countR = 0; int countB = 0; for ( int i = 0; i < 3; i++ ){ s = sc.next(); if ( s.equals("RED")) countR++; else if ( s.equals("BLUE")) countB++; } if( countB > countR) System.out.println("BLUE"); else System.out.println("RED"); sc.close(); } }