結果

問題 No.2541 Divide 01 String
ユーザー komkompikomkompi
提出日時 2023-11-24 22:15:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 72,852 KB
最終ジャッジ日時 2023-11-24 22:15:42
合計ジャッジ時間 1,960 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 43 ms
61,712 KB
testcase_04 AC 44 ms
65,800 KB
testcase_05 AC 49 ms
72,308 KB
testcase_06 AC 45 ms
65,808 KB
testcase_07 AC 52 ms
72,308 KB
testcase_08 AC 51 ms
72,852 KB
testcase_09 AC 50 ms
72,852 KB
testcase_10 AC 46 ms
72,340 KB
testcase_11 AC 47 ms
72,336 KB
testcase_12 AC 48 ms
72,484 KB
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 AC 36 ms
53,460 KB
testcase_17 AC 37 ms
53,460 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N=int(input())
S=input()

MOD=998244353

ans=1
count=-1
for s in S:
    if s=="1":
        if count==-1:
            count=0
        else:
            ans*=(count+2)
            ans%=MOD
            count=0
    else:
        if count==-1:
            pass
        else:
            count+=1

print(ans)
0