結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2014-11-20 00:41:05 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 116 ms / 5,000 ms | 
| コード長 | 762 bytes | 
| コンパイル時間 | 3,829 ms | 
| コンパイル使用メモリ | 80,216 KB | 
| 実行使用メモリ | 41,820 KB | 
| 最終ジャッジ日時 | 2025-01-02 19:22:59 | 
| 合計ジャッジ時間 | 5,037 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class Yukicoder24 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a, b, c, d, max = -100, index = 0;
		
		int[] num = new int[10];
		Arrays.fill(num, 0);
			
		for (int i = 0; i < n; i++) {
			a = sc.nextInt();
			b = sc.nextInt();
			c = sc.nextInt();
			d = sc.nextInt();
			if (sc.next().equals("NO")) {
				num[a] = -100;
				num[b] = -100;
				num[c] = -100;
				num[d] = -100;
			} else {
				num[a]++;
				num[b]++;
				num[c]++;
				num[d]++;
			}
		}
		
		for (int i = 0; i < 10; i++) {
			if (max < num[i]) {
				max = num[i];
				index = i;
			}
		}
		
		System.out.println(index);
	}
}
            
            
            
        