結果
問題 | No.24 数当てゲーム |
ユーザー | lrf141 |
提出日時 | 2016-12-01 13:54:53 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 940 bytes |
コンパイル時間 | 3,140 ms |
コンパイル使用メモリ | 72,428 KB |
実行使用メモリ | 56,368 KB |
最終ジャッジ日時 | 2023-08-18 11:16:37 |
合計ジャッジ時間 | 5,172 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
55,764 KB |
testcase_01 | AC | 119 ms
56,008 KB |
testcase_02 | AC | 118 ms
55,836 KB |
testcase_03 | AC | 119 ms
55,748 KB |
testcase_04 | AC | 116 ms
55,816 KB |
testcase_05 | AC | 114 ms
55,832 KB |
testcase_06 | AC | 112 ms
56,368 KB |
testcase_07 | AC | 133 ms
55,544 KB |
testcase_08 | AC | 115 ms
55,464 KB |
testcase_09 | AC | 117 ms
55,836 KB |
ソースコード
import java.util.*; public class no24{ public static void main(String... args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int res[] = new int[10]; int a,b,c,d,check=0; String flag; for(int i = 0; i < n; i++){ a = scan.nextInt(); b = scan.nextInt(); c = scan.nextInt(); d = scan.nextInt(); flag = scan.next(); if(flag.equals("YES")){ res[a]++; res[b]++; res[c]++; res[d]++; check++; }else{ res[a]--; res[b]--; res[c]--; res[d]--; } } for(int i = 0; i < 10; i++){ if(res[i] == check){ System.out.println(i); break; } } } }