結果
| 問題 | No.3500 01 String |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 20:44:46 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 234 bytes |
| 記録 | |
| コンパイル時間 | 559 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 16,092 KB |
| 最終ジャッジ日時 | 2026-04-18 20:44:58 |
| 合計ジャッジ時間 | 5,588 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 19 |
ソースコード
MOD = 998244353
N = int(input())
A = input().strip()
ans = 1
i = 0
while i < N:
j = i
while j + 1 < N and A[j] != A[j+1]:
j += 1
length = j - i + 1
ans = ans * (length + 1) % MOD
i = j + 1
print(ans)