Lang:C#
Edit12345678910111213141516171819202122232425262728293031using System;using System.Collections.Generic;public class Program{private static void Main(){int n, i, max, mx, id, length;int[] p = new int[1000000];string seq = "";for (n = Convert.ToInt32(Console.ReadLine()); n > 0; n--){seq = Console.ReadLine();length = seq.Length;int Longest = 0;List<int> l = new List<int>();i = 0;int palLen = 0;int s = 0;int e = 0;while (i < seq.Length){if (i > palLen && seq[i - palLen - 1] == seq[i]){palLen += 2;i += 1;continue;}l.Add(palLen);Longest = Math.Max(Longest, palLen);s = l.Count - 2;