結果

問題 No.24 数当てゲーム
ユーザー superzugansuperzugan
提出日時 2021-08-22 22:30:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 658 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-24 13:44:06
合計ジャッジ時間 998 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,880 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 28 ms
10,880 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 26 ms
10,752 KB
testcase_08 AC 24 ms
10,752 KB
testcase_09 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
lst_yes=[0]*10
lst_no=[0]*10

for i in range(n):
    a,b,c,d,r=input().split()
    a,b,c,d,r=int(a),int(b),int(c),int(d),str(r)
    if r=="NO":
        lst_no[a]=lst_no[b]=lst_no[c]=lst_no[d]=1
    if r=="YES":
        lst_yes[a]+=1
        lst_yes[b]+=1
        lst_yes[c]+=1
        lst_yes[d]+=1
# print(lst_yes)
# print(lst_no)
def han():
    if lst_no.count(0)==1:return lst_no.index(0)
    ans_lst=[]
    ans1_lst=[]
    ans=0
    for i in range(10):
        if lst_no[i]==0:ans_lst.append(i)
    for j in ans_lst:
        ans=max(ans,lst_yes[j])
    for k in range(10):
        if lst_yes[k]==ans and lst_no[k]==0:return k

print(han())
0