結果

問題 No.171 スワップ文字列(Med)
コンテスト
ユーザー chocorusk
提出日時 2020-09-14 10:47:27
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 313 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 580 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 21,212 KB
最終ジャッジ日時 2026-03-06 05:11:40
合計ジャッジ時間 3,902 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
readlines=sys.stdin.buffer.readlines

s=readline().rstrip().decode()
n=len(s)
f=[1]*(n+1)
for i in range(1, n+1):
    f[i]=f[i-1]*i
from collections import Counter
c=Counter(s)
ans=f[n]
for y in c.values():
    ans//=f[y]
print((ans-1)%MOD)
0