結果
問題 | No.24 数当てゲーム |
ユーザー | lrf141 |
提出日時 | 2016-12-01 13:54:53 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 125 ms / 5,000 ms |
コード長 | 940 bytes |
コンパイル時間 | 3,733 ms |
コンパイル使用メモリ | 74,556 KB |
実行使用メモリ | 41,460 KB |
最終ジャッジ日時 | 2024-05-05 16:37:45 |
合計ジャッジ時間 | 5,469 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
41,344 KB |
testcase_01 | AC | 119 ms
41,232 KB |
testcase_02 | AC | 106 ms
39,896 KB |
testcase_03 | AC | 113 ms
41,276 KB |
testcase_04 | AC | 117 ms
41,460 KB |
testcase_05 | AC | 96 ms
39,924 KB |
testcase_06 | AC | 108 ms
40,544 KB |
testcase_07 | AC | 107 ms
40,764 KB |
testcase_08 | AC | 110 ms
40,928 KB |
testcase_09 | AC | 125 ms
41,188 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; } } } }