結果

問題 No.2774 Wake up Record 2
ユーザー anago-pie
提出日時 2025-01-07 13:22:06
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 64,304 KB
最終ジャッジ日時 2025-01-07 13:22:12
合計ジャッジ時間 3,982 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(INPUT){
  const input=INPUT.split("\n");
  const [N,K]=input[0].split(" ").map(_=>parseInt(_));
  const A=input[1].split(" ").map(_=>parseInt(_));
  const s=A.map(_=>_).sort((a,b)=>a-b);
  const d=s[K-1];
  const ans=[];
  for(let i=1;i<N;i++){
    if(A[i]>d && A[i-1]<=d){
      ans.push(i+1);
    }
  }
  console.log(ans.length);
  console.log(ans.join(" "));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0