結果
| 問題 | No.2777 Wild Flush |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 22:07:38 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 362 bytes |
| 記録 | |
| コンパイル時間 | 464 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 107,264 KB |
| 最終ジャッジ日時 | 2026-06-01 05:25:36 |
| 合計ジャッジ時間 | 3,018 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 24 |
ソースコード
from collections import defaultdict
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
d=defaultdict(int)
for a in A:d[a]+=1
v=[]
zero=0
for k,x in d.items():
if k==0:zero=x
else: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")