結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2015-12-19 13:14:09 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 52 ms / 5,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 2,159 ms |
コンパイル使用メモリ | 74,176 KB |
実行使用メモリ | 37,068 KB |
最終ジャッジ日時 | 2024-09-16 08:56:05 |
合計ジャッジ時間 | 3,260 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
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]++;elsecheck[m] = -1;}}for (int i = 0; i < check.length; i++) {if (max < check[i]) {max = check[i];ans = i;}}System.out.println(ans);}}