結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2015-07-07 22:02:32 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 112 ms / 5,000 ms |
コード長 | 709 bytes |
コンパイル時間 | 3,835 ms |
コンパイル使用メモリ | 77,604 KB |
実行使用メモリ | 41,280 KB |
最終ジャッジ日時 | 2024-07-08 01:31:32 |
合計ジャッジ時間 | 5,644 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.Arrays; import java.util.Scanner; public class No_024 { Scanner sc = new Scanner(System.in); void run() { int N = sc.nextInt(); int[] cnt = new int[10]; while (N-- > 0) { int[] n = { sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt() }; if (sc.next().equals("YES")) { for (int j = 0; j < 4; j++) { if (cnt[n[j]] != -1) cnt[n[j]]++; } } else { for (int j = 0; j < 4; j++) { cnt[n[j]] = -1; } } } int max = -100; int maxIndex = 0; for (int i = 0; i < 10; i++) { if (max < cnt[i]) { max = cnt[i]; maxIndex = i; } } System.out.println(maxIndex); } public static void main(String[] args) { new No_024().run(); } }