結果
問題 | No.2774 Wake up Record 2 |
ユーザー |
|
提出日時 | 2024-06-07 22:35:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 1,717 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 24,448 KB |
最終ジャッジ日時 | 2024-12-26 08:46:10 |
合計ジャッジ時間 | 2,884 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
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] C = sorted(B) D = C[:K] mx = 0 if D: mx = D[-1] res = [] c = 0 res = [] for i in range(1, len(B)): if B[i - 1] <= mx and B[i] > mx: c += 1 res += [i + 1] print(c) PI(* res) solution(A)