結果

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

ソースコード

diff #

function Main(input) {
  input = input.split("\n").map((line) => line.trim());
  const N = Number(input[0]);
  const S = input[1].split("");
  if (N % 2 !== 0) {
    console.log("No");
    return;
  }

  const P = S.map((s, i) => (i % 2 === 0 ? s : "")).join("");
  const Q = S.map((s, i) => (i % 2 !== 0 ? s : "")).join("");
  console.log("Yes");
  console.log(P, Q);
}

Main(require("fs").readFileSync(0, "utf8"));
0