結果

問題 No.2034 Anti Lexicography
ユーザー kisschankisschan
提出日時 2022-10-03 15:45:30
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 66,816 KB
最終ジャッジ日時 2023-08-27 15:14:02
合計ジャッジ時間 3,900 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
42,372 KB
testcase_01 AC 77 ms
42,444 KB
testcase_02 AC 77 ms
42,100 KB
testcase_03 AC 76 ms
42,084 KB
testcase_04 AC 76 ms
42,216 KB
testcase_05 AC 242 ms
66,572 KB
testcase_06 AC 236 ms
66,692 KB
testcase_07 AC 232 ms
66,392 KB
testcase_08 AC 238 ms
66,784 KB
testcase_09 AC 235 ms
66,640 KB
testcase_10 AC 238 ms
66,768 KB
testcase_11 AC 238 ms
66,816 KB
testcase_12 AC 237 ms
66,536 KB
testcase_13 AC 82 ms
45,700 KB
testcase_14 AC 83 ms
45,576 KB
testcase_15 AC 84 ms
45,800 KB
testcase_16 AC 96 ms
46,744 KB
testcase_17 AC 96 ms
46,940 KB
権限があれば一括ダウンロードができます

ソースコード

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