結果

問題 No.1335 1337
ユーザー megane_ankomegane_anko
提出日時 2021-03-23 01:26:04
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 9,567 ms
コンパイル使用メモリ 252,732 KB
実行使用メモリ 42,480 KB
最終ジャッジ日時 2023-08-16 05:10:49
合計ジャッジ時間 12,385 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
42,376 KB
testcase_01 AC 77 ms
42,424 KB
testcase_02 AC 75 ms
42,328 KB
testcase_03 AC 76 ms
42,288 KB
testcase_04 AC 75 ms
42,300 KB
testcase_05 AC 76 ms
42,252 KB
testcase_06 AC 77 ms
42,352 KB
testcase_07 AC 75 ms
42,408 KB
testcase_08 AC 76 ms
42,256 KB
testcase_09 AC 77 ms
42,480 KB
testcase_10 AC 76 ms
42,372 KB
testcase_11 AC 76 ms
42,332 KB
testcase_12 AC 76 ms
42,300 KB
testcase_13 AC 76 ms
42,256 KB
testcase_14 AC 75 ms
42,468 KB
testcase_15 AC 75 ms
42,340 KB
testcase_16 AC 77 ms
42,336 KB
testcase_17 AC 76 ms
42,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import * as fs from 'fs';
const input = fs.readFileSync('/dev/stdin', 'utf8');

const nl_array = input.split('\n');
const A_array = nl_array[0].split('');
const S_array = nl_array[1].split('');

const answer_array = [];

for (let i = 0; i < S_array.length; i++) {
    if (S_array[i].match (/^[a-z]/)) {
        answer_array.push(S_array[i]);
    } else {
        answer_array.push(A_array[parseInt(S_array[i])]);
    }
}
console.log(answer_array.join(''));
0