結果

問題 No.2774 Wake up Record 2
ユーザー tipstar0125tipstar0125
提出日時 2024-06-07 22:20:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 82,360 KB
実行使用メモリ 90,536 KB
最終ジャッジ日時 2024-06-07 22:20:22
合計ジャッジ時間 2,444 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,880 KB
testcase_01 AC 38 ms
53,488 KB
testcase_02 AC 38 ms
52,468 KB
testcase_03 AC 39 ms
52,140 KB
testcase_04 AC 39 ms
53,084 KB
testcase_05 AC 39 ms
53,020 KB
testcase_06 AC 38 ms
53,068 KB
testcase_07 AC 38 ms
52,956 KB
testcase_08 AC 42 ms
53,216 KB
testcase_09 AC 50 ms
61,864 KB
testcase_10 AC 44 ms
58,516 KB
testcase_11 AC 65 ms
75,196 KB
testcase_12 AC 61 ms
69,824 KB
testcase_13 AC 92 ms
85,820 KB
testcase_14 AC 73 ms
89,384 KB
testcase_15 AC 76 ms
88,764 KB
testcase_16 AC 72 ms
87,952 KB
testcase_17 AC 89 ms
90,536 KB
testcase_18 AC 81 ms
88,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ok=0
ng=int(1e9)+5

def f(n):
    cnt=0
    for a in A:
        if a<=n:cnt+=1
    return cnt<=K

while ng-ok>1:
    m=(ok+ng)//2
    if f(m):ok=m
    else:ng=m

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