結果

問題 No.24 数当てゲーム
ユーザー machoniumpmachoniump
提出日時 2023-09-18 22:21:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 8,260 KB
最終ジャッジ日時 2023-09-18 22:21:05
合計ジャッジ時間 1,043 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,872 KB
testcase_02 AC 15 ms
8,192 KB
testcase_03 AC 16 ms
8,260 KB
testcase_04 AC 16 ms
8,128 KB
testcase_05 AC 15 ms
8,200 KB
testcase_06 AC 15 ms
8,252 KB
testcase_07 AC 15 ms
8,128 KB
testcase_08 AC 16 ms
8,108 KB
testcase_09 AC 16 ms
8,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

yes=[0]*10
no=[0]*10
Y=0
N=0
n=int(input())

for i in range(n):
    a=list(map(str,input().split()))
    if a[-1]=="NO":
        N+=1
        for j in a[:-1]:
            no[int(j)]+=1
    else:
        Y+=1
        for j in a[:-1]:
            yes[int(j)]+=1
if Y==0:
    print(no.index(0))
elif N==0:
    print(yes.index(2))
else:
    for i in range(10):
        if yes[i]==Y and no[i]==0:
            print(i)
            exit()
0