結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-05-15 17:58:08 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 662 bytes | 
| コンパイル時間 | 3,575 ms | 
| コンパイル使用メモリ | 75,452 KB | 
| 実行使用メモリ | 56,412 KB | 
| 最終ジャッジ日時 | 2024-09-13 03:08:44 | 
| 合計ジャッジ時間 | 5,591 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 8 WA * 2 | 
ソースコード
import java.util.Scanner;
public class No24 {
	public static void main(String[] args) {
		//数当てゲーム
		
		int[] num = new int[10];
		Scanner s = new Scanner(System.in);
		int N = Integer.parseInt(s.nextLine());
		String[] abcd = new String[N];
		
		for(int i = 0;i < N;i++) {
			abcd[i] = s.nextLine();
		}
		s.close();
		
		for(String str : abcd) {
			int d;
			if(str.contains("NO")) {
				d = -1;
			}else {
				d = 1;
			}
			for(int i = 0;i < 4;i++) {
				num[Integer.parseInt(str.split(" ")[i])] += d;
			}
		}
		
		int max = 1;
		for(int i = 1;i < 10;i++) {
			if(num[i] > num[max]) {
				max = i;
			}
		}
		
		System.out.println(max);
	}
}
            
            
            
        