結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  koukonko | 
| 提出日時 | 2015-12-07 13:31:01 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 54 ms / 5,000 ms | 
| コード長 | 949 bytes | 
| コンパイル時間 | 2,260 ms | 
| コンパイル使用メモリ | 77,500 KB | 
| 実行使用メモリ | 36,892 KB | 
| 最終ジャッジ日時 | 2024-09-14 18:18:16 | 
| 合計ジャッジ時間 | 3,231 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
		int[] flag = new int[10];
		try {
			int count = Integer.parseInt(buff.readLine());
			for (; count > 0; --count) {
				String[] box = buff.readLine().split(" ");
				int[] num = new int[4];
				for (int i = 0; i < 4; ++i) {
					num[i] = Integer.parseInt(box[i]);
				}
				int add = -1;
				if (box[4].equals("YES")) {
					add = 1;
				}
				for (int i = 0; i < 4; ++i) {
					flag[num[i]] += add;
				}
			}
			int max = -10;
			for (int i = 0; i < 10; ++i) {
				if (max < flag[i]) {
					max = flag[i];
				}
			}
			for (int i = 0; i < 10; ++i) {
				if (flag[i] == max) {
					System.out.println(i);
					break;
				}
			}
		} catch (NumberFormatException e) {
		} catch (IOException e) {
		}
	}
}
            
            
            
        