結果
問題 |
No.1481 Rotation ABC
|
ユーザー |
![]() |
提出日時 | 2021-04-16 21:49:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 215 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 82,168 KB |
実行使用メモリ | 86,912 KB |
最終ジャッジ日時 | 2024-07-03 01:18:56 |
合計ジャッジ時間 | 10,984 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 18 WA * 20 |
ソースコード
n = int(input()) s = input() from math import factorial as f ans = f(len(s)) for i in "ABC": c = s.count(i) if c: ans //= f(c) else: print(-1) exit() print((ans-len(s))%998244353)