結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  bigbear90560 | 
| 提出日時 | 2015-09-17 18:50:24 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 123 ms / 5,000 ms | 
| コード長 | 965 bytes | 
| コンパイル時間 | 2,989 ms | 
| コンパイル使用メモリ | 75,092 KB | 
| 実行使用メモリ | 41,432 KB | 
| 最終ジャッジ日時 | 2024-07-19 06:52:47 | 
| 合計ジャッジ時間 | 4,660 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import java.util.Scanner;
/**
 * No.24 数当てゲーム
 */
public class No024_NumberHitGame {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();	// 入力列数
        int[] judge = new int[10];
        for (int i=0; i<a; i++) {
        	int n1 = sc.nextInt();	// 数1
        	int n2 = sc.nextInt();	// 数2
        	int n3 = sc.nextInt();	// 数3
        	int n4 = sc.nextInt();	// 数4
            String s = sc.next();	// ジャッジ
            judge[n1] += "YES".equals(s) ? 1 : -1; 
            judge[n2] += "YES".equals(s) ? 1 : -1; 
            judge[n3] += "YES".equals(s) ? 1 : -1; 
            judge[n4] += "YES".equals(s) ? 1 : -1; 
        }
        int max = -1;
        int result = 0;
        for (int i=0; i<judge.length; i++) {
        	if (max < judge[i]) {
        		max = judge[i];
        		result = i;
        	}
        }
        System.out.println(result);
	}
}
            
            
            
        