結果

問題 No.24 数当てゲーム
ユーザー MaboyMaboy
提出日時 2017-05-01 20:11:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 7,860 KB
最終ジャッジ日時 2023-10-12 02:11:07
合計ジャッジ時間 1,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,856 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 16 ms
7,860 KB
testcase_04 AC 16 ms
7,812 KB
testcase_05 AC 16 ms
7,744 KB
testcase_06 AC 16 ms
7,772 KB
testcase_07 AC 16 ms
7,764 KB
testcase_08 AC 16 ms
7,760 KB
testcase_09 AC 16 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = []
s1 = set()
s2 = set()
for i in range(n):
    l += [input().split()]
    if l[i][-1] == "NO":
        s1 |= set(l[i])
    else:
        if len(s2) == 0:
            s2 = set(l[i])
        else:
            s3 = s2 | set(l[i])
            s2 &= set(l[i])
            s1 |= set([x for x in s3 if x not in s2])
if len(s2) > 1:
    s2.remove("YES")
a=""
for i in s2:
    if i not in s1:
        a = i
if a == "":
    for i in range(10):
        if str(i) not in s1:
            a = i
print(a)
0