結果
| 問題 | No.170 スワップ文字列(Easy) |
| コンテスト | |
| ユーザー |
nuwasogi
|
| 提出日時 | 2015-11-24 14:38:31 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 5,000 ms |
| + 452µs | |
| コード長 | 284 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-06 06:12:02 |
| 合計ジャッジ時間 | 2,065 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
from math import factorial
S = input()
n = len(S)
dict = {}
for x in S:
if x in dict:
dict[x] +=1
else:
dict[x] = 1
list1 = dict.values()
list1 = list(filter(lambda x : x!=1, list1))
ans = factorial(n)
for x in list1:
ans //= factorial(x)
ans-=1
print(ans)
nuwasogi