hiho Week 1 register

Ended

Participants:1162

Verdict:Accepted
Submitted:2014-07-11 00:30:46

Lang:C#

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using 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;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX