結果

問題 No.3036 Nauclhlt型文字列
ユーザー Atake-MKU
提出日時 2025-02-28 21:26:01
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 54,188 KB
最終ジャッジ日時 2025-02-28 21:26:07
合計ジャッジ時間 2,285 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    input = input.split("\n");
    const N = Number(input[0]);
    const S = input[1].trim();
    if (N % 2 === 0) {
        const P = [];
        const Q = [];
        for (let i = 0; i < N; i++) {
            if (i % 2 === 0) {
                P.push(S[i]);
            } else {
                Q.push(S[i]);
            }
        }
        console.log("Yes");
        console.log(P.join(""), Q.join(""));
    } else {
        console.log("No");
    }
}
Main(require("fs").readFileSync(0)+"")
0