結果

問題 No.24 数当てゲーム
コンテスト
ユーザー spacia
提出日時 2015-12-19 13:14:09
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 695 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,572 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 39,032 KB
最終ジャッジ日時 2026-04-05 13:58:06
合計ジャッジ時間 2,477 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.io.*;
import java.util.*;

class Main24 {
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int[] check = new int[10];
		int ans = -1, max = -1;
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			for (int j = 0; j < line.length - 1; j++) {
				int m = Integer.parseInt(line[j]);
				if (line[4].equals("YES"))
					check[m]++;
				else
					check[m] = -1;
			}
		}
		for (int i = 0; i < check.length; i++) {
			if (max < check[i]) {
				max = check[i];
				ans = i;
			}
		}
		
		System.out.println(ans);
	}
}
0