結果

問題 No.24 数当てゲーム
ユーザー zyxwzyxw
提出日時 2020-10-11 10:27:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-09-27 22:48:33
合計ジャッジ時間 963 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 14 ms
7,876 KB
testcase_03 AC 15 ms
7,740 KB
testcase_04 AC 14 ms
7,748 KB
testcase_05 AC 14 ms
7,980 KB
testcase_06 AC 14 ms
7,908 KB
testcase_07 AC 14 ms
7,816 KB
testcase_08 AC 14 ms
7,816 KB
testcase_09 AC 14 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
data=[input().split() for i in range(n)]
d=[int(s) for s in list("0123456789")]
d_2=[]
x=0
for i in range(n):
    if data[i][4]=="NO":
        for j in range(4):
            d[int(data[i][j])]=-1
    else:
        x+=1
        for j in range(4):
             d_2.append(int(data[i][j]))
D=[]
for i in range(10):
    if d[i]>=0:
        D.append(d[i])
if len(D)==1:
    print(D[0])
else:
    for i in D:
        if d_2.count(i)==x:
            print(i)
            break
0