結果
| 問題 |
No.3178 free sort
|
| コンテスト | |
| ユーザー |
回転
|
| 提出日時 | 2025-06-24 05:09:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 421 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 82,212 KB |
| 実行使用メモリ | 100,296 KB |
| 最終ジャッジ日時 | 2025-06-24 05:09:27 |
| 合計ジャッジ時間 | 7,331 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | RE * 40 |
ソースコード
from collections import Counter
MOD = 998244353
N = input()
d = Counter(list(map(int,list(N))))
fact = [1]
for i in range(10**5):
fact.append(fact[-1] * (i+1) % MOD)
ans = fact[len(N)]
for i in d:
ans *= pow(fact[d[i]],-1,MOD)
ans %= MOD
if(d[0] > 0):
tmp = fact[len(N)-1]
d[0] -= 1
for i in d:
tmp *= pow(fact[d[i]],-1,MOD)
tmp %= MOD
ans -= tmp
ans %= MOD
print(ans)
回転