結果

問題 No.24 数当てゲーム
ユーザー k_kadorak_kadora
提出日時 2015-05-19 03:13:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 660 bytes
コンパイル時間 3,060 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-09-20 10:09:17
合計ジャッジ時間 5,811 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
54,468 KB
testcase_01 AC 114 ms
56,048 KB
testcase_02 AC 119 ms
56,008 KB
testcase_03 AC 118 ms
56,352 KB
testcase_04 AC 118 ms
55,948 KB
testcase_05 AC 119 ms
56,036 KB
testcase_06 AC 118 ms
56,096 KB
testcase_07 AC 119 ms
55,784 KB
testcase_08 AC 122 ms
55,828 KB
testcase_09 AC 119 ms
55,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Detect{
	public static void main(String[] arg){
		int[] res = new int[10];
		for(int i = 0;i<10;i++){
			res[i] = 0;
		}
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[4];
		int re=0;
		int count = 0;
		String ans;
		for(int i = 0;i<n;i++){
			for(int j = 0;j<4;j++){
				a[j] = sc.nextInt();
			}
			ans = sc.next();
			if(ans.equals("YES")){
				for(int j=0;j<4;j++){
					res[a[j]] = res[a[j]]+1;
				}
				count++;
			}else{
				for(int j=0;j<4;j++){
					res[a[j]] = res[a[j]]-1;
				}
			}
		}
		for(int i = 0;i<10;i++){
			if(res[i] == count)re = i;
		}
		System.out.println(re);
	}
}
0