結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー yano3
提出日時 2023-07-07 16:16:19
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
AC  
実行時間 89 ms / 5,000 ms
コード長 326 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,195 ms
コンパイル使用メモリ 347,828 KB
実行使用メモリ 52,984 KB
最終ジャッジ日時 2026-06-05 06:30:25
合計ジャッジ時間 7,293 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import fs from 'fs'

function main(input: string): void {
  const [one, two] = input.split('\n')
  const oneSorted = one.split('').sort().join('')
  const twoSorted = two.split('').sort().join('')

  const res = oneSorted === twoSorted
    ? 'YES'
    : 'NO'

  console.log(res)
}

main(fs.readFileSync('/dev/stdin', 'utf8'))
0