hiho Week 3 register

Ended

Participants:669

Verdict:Accepted
Submitted:2014-07-20 11:11:45

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 <cstdio>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
    int N;
    scanf("%d", &N);
    for (int n = 0; n < N; n++)
    {
        char s1[10001], s2[1000001];
        scanf("%s %s", s1, s2);
        int len1 = strlen(s1), len2 = strlen(s2);
        int *next = new int[len1+1]();
        next[0] = -1;
        int i = 0, j = -1;
        while (i < len1)
        {
            if (j == -1 || s1[i] == s1[j])
            {
                i++;
                j++;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX