結果
問題 |
No.2777 Wild Flush
|
ユーザー |
|
提出日時 | 2024-07-10 15:18:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 708 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 26,220 KB |
最終ジャッジ日時 | 2024-07-10 15:18:27 |
合計ジャッジ時間 | 4,586 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 24 |
ソースコード
N,K=map(int,input().split()) A=list(map(int,input().split())) cnt=0 B=[] for a in A: if a==0: cnt+=1 else: B.append(a) if cnt==N: if N>=K: print("Yes") else: print("No") exit() from collections import Counter S=Counter(B) #Counterクラスでリストの各要素の出現回数を数える #print(S[0]) print("Yes" if max(list(S.values()))+cnt>=K else "No")