結果

問題 No.1481 Rotation ABC
ユーザー convexineqconvexineq
提出日時 2021-04-16 22:05:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 753 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 80,032 KB
最終ジャッジ日時 2023-09-16 00:46:05
合計ジャッジ時間 11,162 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,220 KB
testcase_01 AC 69 ms
71,244 KB
testcase_02 AC 68 ms
71,240 KB
testcase_03 AC 68 ms
71,136 KB
testcase_04 AC 68 ms
71,232 KB
testcase_05 AC 69 ms
71,220 KB
testcase_06 AC 68 ms
71,120 KB
testcase_07 AC 70 ms
71,252 KB
testcase_08 AC 68 ms
71,276 KB
testcase_09 AC 70 ms
71,240 KB
testcase_10 AC 69 ms
71,160 KB
testcase_11 AC 69 ms
71,032 KB
testcase_12 AC 68 ms
71,244 KB
testcase_13 AC 445 ms
77,144 KB
testcase_14 AC 529 ms
77,456 KB
testcase_15 AC 431 ms
77,284 KB
testcase_16 AC 307 ms
76,996 KB
testcase_17 AC 281 ms
76,728 KB
testcase_18 AC 613 ms
79,148 KB
testcase_19 AC 269 ms
76,724 KB
testcase_20 AC 272 ms
76,736 KB
testcase_21 AC 556 ms
78,328 KB
testcase_22 AC 239 ms
76,584 KB
testcase_23 AC 750 ms
79,564 KB
testcase_24 AC 753 ms
79,500 KB
testcase_25 AC 749 ms
79,532 KB
testcase_26 AC 751 ms
80,032 KB
testcase_27 AC 751 ms
79,624 KB
testcase_28 AC 69 ms
71,060 KB
testcase_29 AC 69 ms
71,256 KB
testcase_30 AC 68 ms
71,028 KB
testcase_31 AC 69 ms
71,216 KB
testcase_32 AC 67 ms
71,264 KB
testcase_33 AC 70 ms
71,056 KB
testcase_34 AC 69 ms
71,236 KB
testcase_35 AC 68 ms
71,052 KB
testcase_36 AC 68 ms
71,052 KB
testcase_37 AC 69 ms
71,248 KB
testcase_38 AC 69 ms
71,132 KB
testcase_39 AC 68 ms
71,116 KB
testcase_40 AC 68 ms
71,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
F = 0
for lst in ["ABC","BCA","CAB"]:
    v = 0
    for i in lst:
        v = s.find(i,v)+1
        if v==0:
            break
    F = max(F,v)
if F==0:
    print(1)
    exit()
from math import factorial as f
r = f(len(s))
for i in "ABC": r //= f(s.count(i))
print((r-len(s))%998244353)
0