結果

問題 No.1335 1337
コンテスト
ユーザー megane_anko
提出日時 2021-03-23 01:26:04
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 456 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,747 ms
コンパイル使用メモリ 348,140 KB
実行使用メモリ 53,240 KB
最終ジャッジ日時 2026-06-05 05:36:35
合計ジャッジ時間 7,354 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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