結果

問題 No.2774 Wake up Record 2
ユーザー miho-4miho-4
提出日時 2024-06-07 23:06:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 95,032 KB
最終ジャッジ日時 2024-06-07 23:06:50
合計ジャッジ時間 1,941 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,096 KB
testcase_01 AC 34 ms
52,352 KB
testcase_02 AC 35 ms
51,712 KB
testcase_03 AC 36 ms
52,224 KB
testcase_04 AC 35 ms
51,840 KB
testcase_05 AC 36 ms
51,712 KB
testcase_06 AC 35 ms
51,968 KB
testcase_07 AC 34 ms
51,968 KB
testcase_08 AC 36 ms
51,968 KB
testcase_09 AC 44 ms
61,184 KB
testcase_10 AC 40 ms
57,728 KB
testcase_11 AC 56 ms
72,960 KB
testcase_12 AC 53 ms
68,736 KB
testcase_13 AC 77 ms
85,888 KB
testcase_14 AC 67 ms
85,760 KB
testcase_15 AC 67 ms
85,376 KB
testcase_16 AC 68 ms
85,760 KB
testcase_17 AC 106 ms
95,032 KB
testcase_18 AC 83 ms
88,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
L=list(map(int,input().split()))

def f(x):
	cnt=0
	for e in L:
		if e<=x:
			cnt+=1
	if cnt==k:
		return -1
	else:
		if k<cnt:
			return 1
		else:
			return 0

l,r=0,10**9+1
while 1:
	m=(l+r)//2
	x=f(m)
	if x==-1:
		break
	else:
		if x:
			r=m-1
		else:
			l=m+1

ans=[]
for i in range(1,n):
	if L[i-1]<=m and m<L[i]:
		ans.append(i+1)
print(len(ans))
print(*ans)
0