結果
問題 | No.516 赤と青の風船 |
ユーザー |
|
提出日時 | 2017-07-09 15:57:04 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 1,881 ms |
コンパイル使用メモリ | 73,636 KB |
実行使用メモリ | 41,080 KB |
最終ジャッジ日時 | 2024-10-07 04:32:10 |
合計ジャッジ時間 | 3,373 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
ソースコード
import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner s = new Scanner(System.in);String[] str = new String[3];str[0]= s.nextLine();str[1]= s.nextLine();str[2]= s.nextLine();int red = 0;int blue = 0;for(int i =0;i<3;i++){if(str[i].equals("RED")){red++;}else{blue++;}}if(red>blue){System.out.println("RED");}else{System.out.println("BLUE");}}}