結果
| 問題 |
No.2774 Wake up Record 2
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-06-07 21:30:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 660 ms / 2,000 ms |
| コード長 | 426 bytes |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 21,664 KB |
| 最終ジャッジ日時 | 2024-12-26 07:07:02 |
| 合計ジャッジ時間 | 5,260 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
import sys
input = sys.stdin.readline
N,K=map(int,input().split())
A=list(map(int,input().split()))
OK=10**10
NG=-1
while OK>NG+1:
mid=(OK+NG)//2
score=0
for a in A:
if a<=mid:
score+=1
#print(mid,score)
if score>=K:
OK=mid
else:
NG=mid
#print(OK)
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)
titia