結果

問題 No.1481 Rotation ABC
ユーザー pluto77pluto77
提出日時 2021-05-07 10:41:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 9,908 KB
最終ジャッジ日時 2023-10-13 01:36:41
合計ジャッジ時間 17,736 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,048 KB
testcase_01 AC 16 ms
8,084 KB
testcase_02 AC 16 ms
7,948 KB
testcase_03 AC 16 ms
8,168 KB
testcase_04 AC 16 ms
8,120 KB
testcase_05 AC 15 ms
8,248 KB
testcase_06 AC 16 ms
8,308 KB
testcase_07 AC 16 ms
8,224 KB
testcase_08 AC 15 ms
7,884 KB
testcase_09 AC 16 ms
7,920 KB
testcase_10 AC 16 ms
7,892 KB
testcase_11 AC 16 ms
8,224 KB
testcase_12 AC 15 ms
8,172 KB
testcase_13 AC 460 ms
9,416 KB
testcase_14 AC 547 ms
9,380 KB
testcase_15 AC 444 ms
9,264 KB
testcase_16 AC 310 ms
9,100 KB
testcase_17 AC 278 ms
9,172 KB
testcase_18 AC 637 ms
9,468 KB
testcase_19 AC 262 ms
8,864 KB
testcase_20 AC 267 ms
9,044 KB
testcase_21 AC 571 ms
9,384 KB
testcase_22 AC 223 ms
8,976 KB
testcase_23 AC 789 ms
9,884 KB
testcase_24 AC 786 ms
9,648 KB
testcase_25 AC 785 ms
9,564 KB
testcase_26 AC 786 ms
9,652 KB
testcase_27 AC 787 ms
9,448 KB
testcase_28 AC 17 ms
8,480 KB
testcase_29 AC 17 ms
8,296 KB
testcase_30 AC 16 ms
8,360 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1481
from math import *
mod=998244353
n=int(input())
s=input()
x=s.count('A')
y=s.count('B')
z=s.count('C')
if x==0 or y==0 or z==0:
 print(1)
 exit()
res=factorial(n)//(factorial(x)*factorial(y)*factorial(z))-n
print(res%mod)
0