mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-28 18:41:38 +08:00
26 lines
1007 B
HTML
26 lines
1007 B
HTML
<!DOCTYPE html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<h1>1093. Count PAT's (25)</h1>
|
|
<div id="problemContent">
|
|
<p>
|
|
The string <i>APPAPT</i> contains two <i>PAT</i>'s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.
|
|
</p>
|
|
<p>Now given any string, you are supposed to tell the number of <i>PAT</i>'s contained in the string.</p>
|
|
<p><b>
|
|
Input Specification:
|
|
</b></p>
|
|
<p>Each input file contains one test case. For each case, there is only one line giving a string of no more than 10<sup>5</sup> characters containing only P, A, or T.
|
|
</p>
|
|
<p><b>
|
|
Output Specification:
|
|
</b></p>
|
|
<p>
|
|
For each test case, print in one line the number of <i>PAT</i>'s contained in the string. Since the result may be a huge number, you only have to output the result moded by 1000000007.
|
|
</p>
|
|
<b>Sample Input:</b><pre>
|
|
APPAPT
|
|
</pre>
|
|
<b>Sample Output:</b><pre>
|
|
2
|
|
</pre>
|
|
</div> |