Submission #998518

# Submission time Handle Problem Language Result Execution time Memory
998518 2024-06-14T06:39:54 Z Ibrohim0704 Palindromes (APIO14_palindrome) PyPy 3
8 / 100
1000 ms 23852 KB
a=str(input())
def palin(s):
    if s==s[::-1]:
        return True
    return False
def cou(s,el):
    ret=0
    for i in range(len(s)):
        c=0
        for j in range(len(el)):
            if i+j<len(s):
                if s[i+j]==el[j]:
                    c+=1
        if c==len(l):
            ret+=1
    return ret
ans=[]
for i in range(len(a)):
    for j in range(len(a)):
        l=a[i:j+1]
        k=palin(l)
        if k:
            ans.append(len(l)*(cou(a,l)))
print(max(ans))       
# Verdict Execution time Memory Grader output
1 Correct 29 ms 18236 KB Output is correct
2 Correct 29 ms 18228 KB Output is correct
3 Correct 27 ms 18236 KB Output is correct
4 Correct 26 ms 18296 KB Output is correct
5 Correct 27 ms 18236 KB Output is correct
6 Correct 26 ms 18260 KB Output is correct
7 Correct 26 ms 18300 KB Output is correct
8 Correct 29 ms 18228 KB Output is correct
9 Correct 33 ms 19220 KB Output is correct
10 Correct 37 ms 19692 KB Output is correct
11 Correct 35 ms 19256 KB Output is correct
12 Correct 38 ms 19248 KB Output is correct
13 Correct 45 ms 20016 KB Output is correct
14 Correct 52 ms 21036 KB Output is correct
15 Correct 35 ms 19248 KB Output is correct
16 Correct 37 ms 19500 KB Output is correct
17 Correct 40 ms 20012 KB Output is correct
18 Correct 41 ms 19236 KB Output is correct
19 Correct 121 ms 22876 KB Output is correct
20 Correct 117 ms 23592 KB Output is correct
21 Correct 69 ms 22360 KB Output is correct
22 Correct 51 ms 21444 KB Output is correct
23 Correct 150 ms 23852 KB Output is correct
24 Correct 84 ms 23852 KB Output is correct
25 Correct 137 ms 23368 KB Output is correct
26 Correct 66 ms 21808 KB Output is correct
27 Correct 71 ms 22320 KB Output is correct
28 Correct 87 ms 22832 KB Output is correct
29 Correct 67 ms 21804 KB Output is correct
30 Correct 50 ms 21040 KB Output is correct
31 Correct 47 ms 20272 KB Output is correct
32 Correct 66 ms 22040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1030 ms 20788 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1099 ms 20528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 20688 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1040 ms 21548 KB Time limit exceeded
2 Halted 0 ms 0 KB -