結果

問題 No.24 数当てゲーム
ユーザー shinwisteriashinwisteria
提出日時 2018-03-04 17:00:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 536 bytes
コンパイル時間 4,375 ms
コンパイル使用メモリ 72,276 KB
実行使用メモリ 56,620 KB
最終ジャッジ日時 2023-09-22 10:46:11
合計ジャッジ時間 5,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,636 KB
testcase_01 AC 126 ms
55,676 KB
testcase_02 AC 120 ms
56,620 KB
testcase_03 AC 121 ms
55,672 KB
testcase_04 AC 119 ms
56,548 KB
testcase_05 AC 120 ms
55,444 KB
testcase_06 AC 120 ms
55,824 KB
testcase_07 AC 120 ms
55,700 KB
testcase_08 AC 119 ms
55,804 KB
testcase_09 AC 121 ms
55,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con24 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] t = new int[10];
		int N = s.nextInt();
		for(int i = 0;i < N;i++){
			int a = s.nextInt() , b = s.nextInt() , c = s.nextInt() , d = s.nextInt() , add = -1;
			if(s.next().equals("YES")){
				add = 1;
			}
			t[a] += add;
			t[b] += add;
			t[c] += add;
			t[d] += add;
		}
		N = 0;
		for(int i = 0;i < 10;i++){
			if(t[i] >= t[N]){
				N = i;
			}
		}
		System.out.println(N);
	}

}
0