結果

問題 No.2774 Wake up Record 2
ユーザー flippergo
提出日時 2025-07-05 19:37:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 95,604 KB
最終ジャッジ日時 2025-07-05 19:37:40
合計ジャッジ時間 2,897 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
high = max(A)
low = 0
while high-low>1:
    mid = (high+low)//2
    cnt = 0
    for i in range(N):
        if A[i]<=mid:
            cnt += 1
    if cnt>=K:
        high = mid
    else:
        low = mid
ans = []
for i in range(1,N):
    if A[i]>high and A[i-1]<=high:
        ans.append(i+1)
print(len(ans))
print(*ans)
0