結果

問題 No.2774 Wake up Record 2
ユーザー 回転
提出日時 2025-07-30 00:44:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,616 KB
実行使用メモリ 95,488 KB
最終ジャッジ日時 2025-07-30 00:44:34
合計ジャッジ時間 2,891 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

def check(n):
    count = 0
    for i in A:count += i <= n
    return count >= K

ng,ok = -1,10**9
while(ok - ng > 1):
    mid = (ok+ng)//2
    if(check(mid)):
        ok = mid
    else:
        ng = mid

ans = []
for i in range(1,N):
    if(A[i-1] <= ok and A[i] > ok):
        ans.append(i+1)
print(len(ans))
print(*ans)
0