結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  kaoetaya | 
| 提出日時 | 2016-11-08 02:14:34 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 131 ms / 5,000 ms | 
| コード長 | 701 bytes | 
| コンパイル時間 | 3,561 ms | 
| コンパイル使用メモリ | 77,932 KB | 
| 実行使用メモリ | 54,160 KB | 
| 最終ジャッジ日時 | 2024-11-25 04:35:04 | 
| 合計ジャッジ時間 | 4,999 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import java.util.Scanner;
import java.util.Arrays;
public class pre {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int a,b,c,d;
		String s;
		int[] num = new int[10];
		Arrays.fill(num,9);
		
		for(int i=0;i<n;i++){
			a = sc.nextInt();
			b = sc.nextInt();
			c = sc.nextInt();
			d = sc.nextInt();
			s = sc.next();
			
			if(s.equals("YES")){
				num[a]++;
				num[b]++;
				num[c]++;
				num[d]++;
			}
			else if(s.equals("NO")){
				num[a]--;
				num[b]--;
				num[c]--;
				num[d]--;
			}
		}
		
		int max = 0;
		
		for(int i=0;i<10;i++){
			if(num[max] < num[i])
				max = i;
		}
		
		System.out.println(max);
    }
}
            
            
            
        