結果
| 問題 |
No.2905 Nabeatsu Integration
|
| コンテスト | |
| ユーザー |
amentorimaru
|
| 提出日時 | 2024-08-13 15:12:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 632 bytes |
| コンパイル時間 | 384 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 51,052 KB |
| 最終ジャッジ日時 | 2024-09-07 11:33:45 |
| 合計ジャッジ時間 | 23,563 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 68 TLE * 2 |
ソースコード
import sys
input = sys.stdin.readline
def read_values(): return map(int, input().split())
def read_list(): return list(read_values())
def construct_mp(W):
L = len(W)
T = [0]*(L+1)
T[0] = j = -1
for i in range(L):
while j >= 0 and W[i] != W[j]:
j = T[j]
j += 1
T[i+1] = j
return T
def main():
s=input().strip()
mod = 998244353
mp = construct_mp(s)
ans = pow(10,len(s),mod) - len(s) + 1
now = len(s)
while mp[now] > 0:
ans += pow(10,mp[now],mod)
ans %= mod
now = mp[now]
print(ans)
if __name__ == "__main__":
main()
amentorimaru