QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB 총점: 100

#4844. Positive String

통계

Grammy 有個獨特嘅見解關於字串。佢覺得一個字串係 正數 若且唯若佢字典序大過佢嘅反轉。

家下俾咗你一個字串,請你計出有幾多個連續子字串係符合 Grammy 嘅見解嘅正數。

輸入

唯一一行包含一個字串 $S$($1 \leq |S| \leq 200\,000$),由細楷英文字母組成。

輸出

輸出一個整數,表示 $S$ 入面正數子字串嘅數量。

示例

輸入 1

jjikkollp

輸出 1

4

輸入 2

pbpbppb

輸出 2

7

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.