Submission #143795


Source Code Expand

Copy
s = raw_input()
n = len(s)/2
if len(s)%2==0:
    sl = s[:n]
    sr = s[n:][::-1]
    ndiff = sum((1 if sl[i]!=sr[i] else 0) for i in xrange(n))
    if ndiff==1:
        print 25*n*2-2
    else:
        print 25*n*2
else:
    sl = s[:n]
    # sc = s[n]
    sr = s[n+1:][::-1]
    ndiff = sum((1 if sl[i]!=sr[i] else 0) for i in xrange(n))
    if ndiff==1:
        print 25*n*2-2+25
    elif ndiff==0:
        print 25
    else:
        print 25*n*2

Submission Info

Submission Time
Task B - こだわりの名前
User matsulib
Language Python (2.7.3)
Score 0
Code Size 467 Byte
Status
Exec Time 99 ms
Memory 4672 KB

Test Cases

Set Name Score / Max Score Test Cases
All 0 / 100 hand_1.txt, hand_2.txt, hand_3.txt, hand_4.txt, hand_5.txt, hand_6.txt, palindrome_1.txt, palindrome_12345.txt, palindrome_2.txt, palindrome_299998.txt, palindrome_299999.txt, palindrome_3.txt, palindrome_300000.txt, palindrome_4.txt, palindrome_5.txt, palindrome_6789.txt, palindrome_67890.txt, palindrome_mod_1.txt, palindrome_mod_1000.txt, palindrome_mod_10000.txt, palindrome_mod_100001.txt, palindrome_mod_2.txt, palindrome_mod_200000.txt, palindrome_mod_299999.txt, palindrome_mod_3.txt, palindrome_mod_300000.txt, palindrome_mod_4.txt, palindrome_mod_5.txt, palindrome_mod_50001.txt, random_1.txt, random_10.txt, random_100001.txt, random_101.txt, random_3000.txt, random_300000.txt, random_50001.txt
Case Name Status Exec Time Memory
hand_1.txt 99 ms 4584 KB
hand_2.txt 89 ms 4584 KB
hand_3.txt 83 ms 4568 KB
hand_4.txt 86 ms 4564 KB
hand_5.txt 88 ms 4572 KB
hand_6.txt 88 ms 4604 KB
palindrome_1.txt 54 ms 3632 KB
palindrome_12345.txt 56 ms 3644 KB
palindrome_2.txt 52 ms 3648 KB
palindrome_299998.txt 89 ms 4672 KB
palindrome_299999.txt 87 ms 4600 KB
palindrome_3.txt 55 ms 3568 KB
palindrome_300000.txt 88 ms 4568 KB
palindrome_4.txt 53 ms 3648 KB
palindrome_5.txt 55 ms 3572 KB
palindrome_6789.txt 57 ms 3588 KB
palindrome_67890.txt 63 ms 3728 KB
palindrome_mod_1.txt 54 ms 3556 KB
palindrome_mod_1000.txt 51 ms 3644 KB
palindrome_mod_10000.txt 56 ms 3556 KB
palindrome_mod_100001.txt 65 ms 3824 KB
palindrome_mod_2.txt 55 ms 3572 KB
palindrome_mod_200000.txt 78 ms 4188 KB
palindrome_mod_299999.txt 86 ms 4608 KB
palindrome_mod_3.txt 60 ms 3548 KB
palindrome_mod_300000.txt 86 ms 4572 KB
palindrome_mod_4.txt 55 ms 3536 KB
palindrome_mod_5.txt 56 ms 3644 KB
palindrome_mod_50001.txt 64 ms 3716 KB
random_1.txt 50 ms 3540 KB
random_10.txt 55 ms 3540 KB
random_100001.txt 64 ms 3784 KB
random_101.txt 58 ms 3536 KB
random_3000.txt 55 ms 3552 KB
random_300000.txt 89 ms 4672 KB
random_50001.txt 62 ms 3760 KB
sample_1.txt 58 ms 3568 KB
sample_2.txt 51 ms 3580 KB
sample_3.txt 53 ms 3580 KB