結果
| 問題 |
No.599 回文かい
|
| コンテスト | |
| ユーザー |
KoshStorm
|
| 提出日時 | 2017-11-24 23:52:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2024-11-27 08:35:26 |
| 合計ジャッジ時間 | 2,120 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 RE * 4 |
ソースコード
from functools import lru_cache import sys sys.setrecursionlimit(1000000) @lru_cache(maxsize=1000000) def is_kaibun (S): l = len(S) left_index = 1 right_index = l-1 count = 1 while left_index-1 < right_index: if S[0:left_index] == S[right_index:]: count += is_kaibun(S[left_index:right_index]) left_index += 1 right_index -= 1 return count if __name__ == "__main__": S = input() l = len(S) ans = is_kaibun(S) % 1000000007 print(ans)
KoshStorm