結果
問題 | No.516 赤と青の風船 |
ユーザー |
![]() |
提出日時 | 2017-06-25 16:54:51 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 3,235 ms |
コンパイル使用メモリ | 73,652 KB |
実行使用メモリ | 36,904 KB |
最終ジャッジ日時 | 2024-10-04 08:57:00 |
合計ジャッジ時間 | 3,539 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
/*No.516 赤と青の風船*/import java.io.*;public class No516 {public static void main(String[] args) {try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){String [] H_balloon = new String[3];byte red=0,blue=0;for(int i=0;i<3;i++){H_balloon[i]=input.readLine();}for(int i=0;red<2&&blue<2;i++){if(H_balloon[i].equals("RED")){red++;}else{blue++;}}if(red>blue){System.out.println("RED");}else{System.out.println("BLUE");}}catch(Exception e){e.printStackTrace();}}}