結果

問題 No.170 スワップ文字列(Easy)
ユーザー tcltktcltk
提出日時 2022-06-03 03:48:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 588 bytes
コンパイル時間 781 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 86,216 KB
最終ジャッジ日時 2023-10-21 01:25:16
合計ジャッジ時間 4,597 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
86,212 KB
testcase_01 AC 131 ms
86,212 KB
testcase_02 AC 128 ms
86,212 KB
testcase_03 AC 127 ms
86,212 KB
testcase_04 AC 123 ms
86,212 KB
testcase_05 AC 123 ms
86,216 KB
testcase_06 AC 123 ms
86,216 KB
testcase_07 AC 123 ms
86,216 KB
testcase_08 AC 126 ms
86,212 KB
testcase_09 AC 126 ms
86,204 KB
testcase_10 AC 125 ms
86,212 KB
testcase_11 AC 124 ms
86,212 KB
testcase_12 AC 123 ms
86,212 KB
testcase_13 AC 124 ms
86,212 KB
testcase_14 AC 124 ms
86,216 KB
testcase_15 AC 124 ms
86,212 KB
testcase_16 AC 122 ms
86,212 KB
testcase_17 AC 123 ms
86,212 KB
testcase_18 AC 126 ms
86,212 KB
testcase_19 AC 125 ms
86,216 KB
testcase_20 AC 125 ms
86,212 KB
testcase_21 AC 125 ms
86,212 KB
testcase_22 AC 125 ms
86,216 KB
testcase_23 AC 122 ms
86,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """XYZYX
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10


def solve(S):
    counter = collections.Counter(list(S))
    N = len(S)
    ans = 1
    for i in range(1, N+1):
        ans *= i
    
    for n in counter.values():
        for i in range(1, n+1):
            ans //= i
    return ans-1


S = input()
print(solve(S))
0