結果
問題 |
No.18 うーさー暗号
|
ユーザー |
|
提出日時 | 2024-07-18 23:28:19 |
言語 | JavaScript (node v23.5.0) |
結果 |
AC
|
実行時間 | 62 ms / 5,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 6,684 KB |
実行使用メモリ | 39,296 KB |
最終ジャッジ日時 | 2024-07-18 23:28:24 |
合計ジャッジ時間 | 4,231 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
function Main(input) { input = input.split("\n"); const s = input[0]; const al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); let res = ""; for (let i = 0; i < s.length; ++i) { let idx = al.indexOf(s[i]); idx -= i + 1; idx %= 26; if (idx < 0) idx += 26; res += al[idx]; } console.log(res); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));