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