結果

問題 No.2777 Wild Flush
ユーザー _a_a
提出日時 2024-06-07 22:23:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 1,765 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,476 KB
最終ジャッジ日時 2024-12-26 08:32:19
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
11,648 KB
testcase_01 AC 37 ms
11,776 KB
testcase_02 AC 37 ms
11,904 KB
testcase_03 AC 35 ms
11,648 KB
testcase_04 AC 37 ms
11,648 KB
testcase_05 AC 36 ms
11,776 KB
testcase_06 AC 39 ms
11,904 KB
testcase_07 AC 34 ms
11,648 KB
testcase_08 AC 36 ms
11,648 KB
testcase_09 AC 67 ms
13,440 KB
testcase_10 AC 66 ms
13,312 KB
testcase_11 AC 66 ms
13,184 KB
testcase_12 AC 102 ms
28,476 KB
testcase_13 AC 103 ms
23,004 KB
testcase_14 AC 103 ms
23,128 KB
testcase_15 AC 108 ms
23,260 KB
testcase_16 AC 45 ms
13,056 KB
testcase_17 AC 102 ms
22,588 KB
testcase_18 AC 82 ms
19,156 KB
testcase_19 AC 90 ms
19,152 KB
testcase_20 AC 54 ms
14,972 KB
testcase_21 AC 52 ms
13,512 KB
testcase_22 AC 81 ms
19,240 KB
testcase_23 AC 77 ms
19,060 KB
testcase_24 AC 86 ms
21,240 KB
testcase_25 AC 103 ms
23,268 KB
testcase_26 AC 102 ms
22,232 KB
testcase_27 AC 69 ms
17,896 KB
testcase_28 AC 52 ms
13,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import os, sys
import math, decimal, queue, heapq, bisect, itertools, functools, collections, string
from bisect import bisect, bisect_left
from collections import defaultdict, OrderedDict, deque, Counter
from functools import cmp_to_key, lru_cache, reduce
from heapq import heapify, heappush, heappushpop, heappop, heapreplace, nlargest, nsmallest
from itertools import accumulate, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice, permutations, product, repeat, starmap, takewhile, tee, zip_longest
from math import gcd, factorial, isqrt, comb, perm, prod, inf
from queue import Queue, PriorityQueue, LifoQueue
from string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, octdigits

LOCAL = sys.argv[0] if '4a' in sys.argv[0] else None

P = lambda *p: [print(i, end='	') for i in p] if LOCAL else None
PI = lambda *p: print(' '.join(map(str, p))) or None
PII = lambda X: [PI(*row) for row in X]

sys.stdin = open(os.path.join(os.getcwd(), 'a1.txt'), 'r') if LOCAL else sys.stdin
I = lambda: [int(a) for l in sys.stdin for a in l.strip().split()]
S = lambda: [a for l in sys.stdin for a in l.strip().split()]
IM = lambda: [[int(a) for a in l.split()] for l in sys.stdin]
SM = lambda: [[a for a in l.split()] for l in sys.stdin]

az, AZ, mod = ascii_lowercase, ascii_uppercase, 1_000_000_007

A = IM()
# P(A)


def solution(A):
    N, K = A[0]
    B = A[1]
    # P(N, K, B)
    c = Counter(B)
    x = 0
    # P(c, x)
    if len(c) > 0 and 0 in c:
        x += c[0]
        del (c[0])

    if len(c) > 0:
        # print('here')
        x += c.most_common()[0][1]
    # P(c, x)

    # P(c, x)
    if x >= K:
        print('Yes')
    else:
        print('No')


solution(A)
0