hiho week 160 register

Ended

Participants:304

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-29 12:05:46

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 <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
string s;
int f[105][105];
int find(int x,int y)
{
    int l=y-x+1;
    bool b=0;
    for (int i=1;i<=l/2;i++)
    {
        if (l%i!=0) continue;
        b=1;
        for (int j=x;j<=y;j+=i)
        {
            for (int k=0;k<i;k++)
                if (s[x+k]!=s[k+j])
                {
                    b=0;//if (x==9&&y==14) cout<<"233"<<endl;
                    break;
                }
            if (!b) break;
        }
        if (b) return i;
    }
    return -1;
}
int find2(int x)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX