Submission #24955

# Submission time Handle Problem Language Result Execution time Memory
24955 2017-06-18T07:19:06 Z leejseo 구간 성분 (KOI15_interval) PyPy
0 / 100
711 ms 119 KB
def solve(A, B):
    n = len(A)
    m = len(B)
    common = 0
    L = []
    M = []
    for i in range(n):
        for j in range(i+1, n):
            s = A[i:j]
            u = []
            for k in s:
                u.append(k)
            u.sort()
            L.append(u)
    for i in range(m):
        for j in range(i+1, m):
            s = B[i:j]
            u = []
            for k in s:
                u.append(k)
            u.sort()
            M.append(u)
    for i in L:
        for j in M:
            if i == j and common < len(i):
                common = len(i)
    return common

def main():
    A = raw_input()
    B = raw_input()
    print solve(A, B)
    return
main()
# Verdict Execution time Memory Grader output
1 Correct 25 ms 5 KB Output is correct
2 Correct 94 ms 10 KB Output is correct
3 Incorrect 711 ms 21 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 348 ms 119 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 361 ms 119 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 356 ms 119 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -