結果
| 問題 | No.3500 01 String |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 17:29:16 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 479 bytes |
| 記録 | |
| コンパイル時間 | 547 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 41,348 KB |
| 最終ジャッジ日時 | 2026-04-18 17:30:04 |
| 合計ジャッジ時間 | 15,557 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 RE * 1 |
| other | WA * 19 RE * 1 |
ソースコード
import re
N = int(input())
a = input()
result = 1
blocks = re.findall('0+|1+', a)
if "1" in blocks[0]:
##n = n - len(blocks[0])
blocks = blocks[1:]
if "0" in blocks[-1]:
##n = n - len(blocks[-1])
blocks = blocks[:-1]
print(blocks)
blocks = [len(x) for x in blocks]
if len(blocks) >0:
for i in range(int(len(blocks)/2)):
index1 = 2*i
index2 = 2*i + 1
result = result*(blocks[index1] + blocks[index2] + 1)
print(result%998244353)