結果

問題 No.2541 Divide 01 String
ユーザー hiro1729hiro1729
提出日時 2023-11-24 21:30:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 72,920 KB
最終ジャッジ日時 2023-11-24 21:30:38
合計ジャッジ時間 2,109 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 33 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 39 ms
61,712 KB
testcase_04 AC 42 ms
67,856 KB
testcase_05 AC 47 ms
72,308 KB
testcase_06 AC 43 ms
65,808 KB
testcase_07 AC 45 ms
72,480 KB
testcase_08 AC 48 ms
72,724 KB
testcase_09 AC 47 ms
72,920 KB
testcase_10 AC 42 ms
72,400 KB
testcase_11 AC 43 ms
72,396 KB
testcase_12 AC 43 ms
72,396 KB
testcase_13 AC 43 ms
53,456 KB
testcase_14 AC 34 ms
53,460 KB
testcase_15 AC 34 ms
53,460 KB
testcase_16 AC 34 ms
53,460 KB
testcase_17 AC 34 ms
53,460 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input().strip('0')
n = len(s)
ans = 1
now = 0
mod = 998244353
for i in s:
	if i == '0':
		now += 1
	else:
		ans = ans * (now + 2) % mod
		now = 0
print(ans * 499122177 % mod)
0