結果
問題 | No.2777 Wild Flush |
ユーザー |
|
提出日時 | 2024-06-07 22:07:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 106,752 KB |
最終ジャッジ日時 | 2024-12-26 08:12:09 |
合計ジャッジ時間 | 4,257 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 24 |
ソースコード
from collections import defaultdictN,K=list(map(int,input().split()))A=list(map(int,input().split()))d=defaultdict(int)for a in A:d[a]+=1v=[]zero=0for k,x in d.items():if k==0:zero=xelse:v.append(x)v.sort()v.reverse()if len(v)==0:if zero>=K:print("Yes")else:print("No")else:if zero+v[0]>=K:print("Yes")else:print("No")