結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2021-08-22 22:30:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-06 22:00:51 |
合計ジャッジ時間 | 1,235 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
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())