結果

問題 No.516 赤と青の風船
ユーザー bellbell
提出日時 2021-02-21 15:36:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 2,515 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 57,480 KB
最終ジャッジ日時 2023-10-19 17:21:08
合計ジャッジ時間 4,303 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
57,196 KB
testcase_01 AC 126 ms
57,432 KB
testcase_02 AC 126 ms
57,464 KB
testcase_03 AC 126 ms
57,428 KB
testcase_04 AC 125 ms
57,480 KB
testcase_05 AC 122 ms
57,348 KB
testcase_06 AC 124 ms
57,308 KB
testcase_07 AC 124 ms
57,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

	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();
		}
	}
0