結果

問題 No.24 数当てゲーム
ユーザー R NR N
提出日時 2020-08-04 14:02:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 852 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 8,020 KB
最終ジャッジ日時 2023-10-12 16:22:53
合計ジャッジ時間 989 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8

n = int(input())

ans_list = [str(i) for i in range(10)]
taro_list = []
yes_list = []

for i in range(n):
    taro_list.append(input().split())

for j in range(n):
    if taro_list[j][4] == 'NO':
        for k in range(4):
            try:
                ans_list[ans_list.index(taro_list[j][k])] = '-'
            except ValueError:
                continue

    elif taro_list[j][4] == 'YES':
        for k in range(4):
            yes_list.append(taro_list[j][k])

print(ans_list)
print(yes_list)

if ans_list.count('-') == 9:
    ans = [i for i in ans_list if i != '-']
    print(ans[0])

elif ans_list.count('-') == 0:
    ans = [i for i in yes_list if yes_list.count(i) == 2]
    print(ans[0])

else:
    ans_choice = [i for i in ans_list if i != '-']
    ans = [i for i in ans_choice if yes_list.count(i) != 2]
    print(ans[0])
0