結果

問題 No.2773 Wake up Record 1
ユーザー YU Hirose
提出日時 2024-07-22 21:47:08
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 47,384 KB
最終ジャッジ日時 2024-07-22 21:47:14
合計ジャッジ時間 4,036 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    input = input.trim().split("\n");
    const n = parseInt(input[0].trim());
    const s = input[1].trim();

    let cnt = [];
    for (let i = 0; i < n; ++i) {
        if (s[i] == "o" && s[i-1] == "x")
            cnt.push(i+1);
    }
    console.log(cnt.length);
    console.log(cnt.join(" "));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0