結果

問題 No.2034 Anti Lexicography
ユーザー kisschan
提出日時 2022-10-03 15:45:30
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 243 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 62,684 KB
最終ジャッジ日時 2024-12-27 15:37:57
合計ジャッジ時間 3,936 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
  // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。

  const data = input.split("\n");
  let number = Number(data[0]);
  let str = data[1].split("")
  let abc =['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  let answer = [];
  for(let i = 0 ; i < number ; i ++){
    let index = abc.findIndex((e) => e === str[i]);
    answer.push(abc[abc.length - index -1]);
  }
  console.log(answer.join(""));
}

// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0