結果
問題 | No.2541 Divide 01 String |
ユーザー |
![]() |
提出日時 | 2023-11-24 23:05:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 72 ms / 2,000 ms |
コード長 | 218 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 68,992 KB |
最終ジャッジ日時 | 2024-09-26 09:45:24 |
合計ジャッジ時間 | 2,582 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
N = int(input()) S = list(input()) if S.count('1')==0: print(0) exit() ans=1 mod=998244353 left = S.index('1') for i in range(left,N): if S[i]=='1': ans=ans*(i-left+1)%mod left=i print(ans)