結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー yano3
提出日時 2023-07-07 16:16:19
言語 TypeScript
(7.0.2 + ACL)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
AC  
実行時間 38 ms / 5,000 ms
+ 507µs
コード長 326 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 951 ms
コンパイル使用メモリ 195,932 KB
実行使用メモリ 51,260 KB
最終ジャッジ日時 2026-10-10 00:17:27
合計ジャッジ時間 2,667 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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