結果
| 問題 |
No.2774 Wake up Record 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 21:46:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 231 ms / 2,000 ms |
| コード長 | 405 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 82,072 KB |
| 実行使用メモリ | 109,056 KB |
| 最終ジャッジ日時 | 2024-12-26 07:38:03 |
| 合計ジャッジ時間 | 2,364 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
from collections import defaultdict
N,K=map(int,input().split())
A=list(map(int,input().split()))
C=defaultdict(int)
for a in A:
C[a]+=1
S=sorted(C.items())
G=0
C=0
for g,c in S:
C+=c
if C==K:
G=g
break
S=[]
for a in A:
if a<=G:S.append("x")
else:S.append("o")
S="".join(S)
ans=[]
for i in range(1,N):
if S[i-1:i+1]=="xo":ans.append(i+1)
print(len(ans))
print(*ans)