mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-04 00:38:13 +08:00
13 lines
804 B
HTML
13 lines
804 B
HTML
Longest Symmetric String
|
|
<div class="ques-view"><p>Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given <code>Is PAT&TAP symmetric?</code>, the longest symmetric sub-string is <code>s PAT&TAP s</code>, hence you must output <code>11</code>.</p>
|
|
<h3 id="input-specification-">Input Specification:</h3>
|
|
<p>Each input file contains one test case which gives a non-empty string of length no more than 1000.</p>
|
|
<h3 id="output-specification-">Output Specification:</h3>
|
|
<p>For each test case, simply print the maximum length in a line.</p>
|
|
<h3 id="sample-input-">Sample Input:</h3>
|
|
<pre><code class="lang-in">Is PAT&TAP symmetric?
|
|
</code></pre>
|
|
<h3 id="sample-output-">Sample Output:</h3>
|
|
<pre><code class="lang-out">11
|
|
</code></pre>
|
|
</div> |