結果
問題 | No.170 スワップ文字列(Easy) |
ユーザー |
![]() |
提出日時 | 2015-07-28 04:08:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 5,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2024-12-23 00:30:32 |
合計ジャッジ時間 | 1,693 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import collections def C(n, r): c = 1 for s in range(n, n - r, -1): c *= s for b in range(r, 0, -1): c //= b return c def solve(): S = input() L = len(S) ans = 1 for n in collections.Counter(S).values(): ans *= C(L, n) L -= n print(ans - 1) def main(): solve() if __name__ == '__main__': main()