結果
問題 |
No.171 スワップ文字列(Med)
|
ユーザー |
|
提出日時 | 2018-08-11 17:47:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-23 06:20:19 |
合計ジャッジ時間 | 1,183 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 3 |
ソースコード
from collections import Counter from math import factorial from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def main(): S = input() n1, n2 = factorial(len(S)), 1 cnt = Counter(S) for i in cnt.values(): n2 *= factorial(i) ans = (n1 // n2) % 573 - 1 print(ans) main()