Files
PAT/source/html/a1040.html
T

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&amp;TAP symmetric?</code>, the longest symmetric sub-string is <code>s PAT&amp;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&amp;TAP symmetric?
</code></pre>
<h3 id="sample-output-">Sample Output:</h3>
<pre><code class="lang-out">11
</code></pre>
</div>