結果

問題 No.170 スワップ文字列(Easy)
コンテスト
ユーザー ktshun
提出日時 2015-06-05 11:06:13
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 89 ms / 5,000 ms
コード長 265 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 197 ms
コンパイル使用メモリ 77,492 KB
最終ジャッジ日時 2025-12-03 15:30:18
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding:utf-8 -*-
import collections
import math
if __name__ == "__main__":
	s = raw_input()
	l = len(s)
	s_set = set(s)
	n = len(s_set)
	count = collections.Counter(s)
	ans = math.factorial(l)
	for i in count.values():
		ans /= math.factorial(i)
	print ans -1
0