hiho Week 1 register

Ended

Participants:1162

Verdict:Accepted
Submitted:2014-07-06 19:25:33

Lang:G++

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
    #include<bits/stdc++.h>
    using namespace std;
    const int mx = 1000000;
    char ss[mx + 5], s[(mx << 1) + 5];
    int len[(mx << 1) + 5];
  /*  void debug()
    {
        int i;
        for (i = 1; s[i]; ++i) printf("%c ", s[i]);
        puts("");
        for (i = 1; s[i]; ++i) printf("%d ", len[i]);
        puts("");
    }
*/
    int main()
    {
        int right, mid, i, maxlen,_;
        cin>>_;
        while (_--)
        {
            scanf("%s",ss);
            memset(s, 0, sizeof(s));
            s[0] = '$';
            for (i = 0; ss[i]; ++i) s[(i << 1) + 1] = '#', s[(i << 1) + 2] = ss[i];
            s[(i << 1) + 1] = '#';
            memset(len, 0, sizeof(len));
            maxlen = right = mid = 0;
            for (i = 1; s[i]; ++i)
            {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX