結果
問題 | No.24 数当てゲーム |
ユーザー | ohagi_1182 |
提出日時 | 2017-10-21 15:29:32 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 135 ms / 5,000 ms |
コード長 | 636 bytes |
コンパイル時間 | 2,087 ms |
コンパイル使用メモリ | 74,356 KB |
実行使用メモリ | 41,832 KB |
最終ジャッジ日時 | 2024-05-01 09:14:18 |
合計ジャッジ時間 | 4,181 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 121 ms
40,396 KB |
testcase_01 | AC | 134 ms
41,456 KB |
testcase_02 | AC | 132 ms
41,536 KB |
testcase_03 | AC | 131 ms
41,832 KB |
testcase_04 | AC | 130 ms
41,600 KB |
testcase_05 | AC | 131 ms
41,296 KB |
testcase_06 | AC | 129 ms
41,492 KB |
testcase_07 | AC | 135 ms
41,732 KB |
testcase_08 | AC | 133 ms
41,340 KB |
testcase_09 | AC | 119 ms
40,132 KB |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] x = new int[10]; for(int i = 0 ; i < n ; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); String e = sc.next(); if(e.equals("YES")) { x[a]++; x[b]++; x[c]++; x[d]++; } else { x[a] -= 100; x[b] -= 100; x[c] -= 100; x[d] -= 100; } } int ans = -1; int point = -1; for(int i = 0 ; i < 10 ; i++) { if(x[i] > point) { ans = i; point = x[i]; } } System.out.println(ans); } }