Submission #143764


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
    else:
        print 25*n*2

Submission Info

Submission Time
Task B - こだわりの名前
User matsulib
Language Python (2.7.3)
Score 0
Code Size 429 Byte
Status
Exec Time 88 ms
Memory 4296 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 88 ms 4296 KB
hand_2.txt 76 ms 4284 KB
hand_3.txt 77 ms 4280 KB
hand_4.txt 80 ms 4284 KB
hand_5.txt 77 ms 4288 KB
hand_6.txt 78 ms 4292 KB
palindrome_1.txt 46 ms 3260 KB
palindrome_12345.txt 49 ms 3368 KB
palindrome_2.txt 46 ms 3268 KB
palindrome_299998.txt 77 ms 4284 KB
palindrome_299999.txt 78 ms 4288 KB
palindrome_3.txt 46 ms 3264 KB
palindrome_300000.txt 80 ms 4292 KB
palindrome_4.txt 49 ms 3364 KB
palindrome_5.txt 47 ms 3268 KB
palindrome_6789.txt 47 ms 3268 KB
palindrome_67890.txt 53 ms 3504 KB
palindrome_mod_1.txt 48 ms 3256 KB
palindrome_mod_1000.txt 44 ms 3260 KB
palindrome_mod_10000.txt 48 ms 3380 KB
palindrome_mod_100001.txt 57 ms 3636 KB
palindrome_mod_2.txt 46 ms 3268 KB
palindrome_mod_200000.txt 68 ms 3880 KB
palindrome_mod_299999.txt 81 ms 4264 KB
palindrome_mod_3.txt 45 ms 3264 KB
palindrome_mod_300000.txt 78 ms 4288 KB
palindrome_mod_4.txt 47 ms 3268 KB
palindrome_mod_5.txt 47 ms 3264 KB
palindrome_mod_50001.txt 54 ms 3380 KB
random_1.txt 46 ms 3256 KB
random_10.txt 46 ms 3268 KB
random_100001.txt 60 ms 3616 KB
random_101.txt 48 ms 3376 KB
random_3000.txt 46 ms 3260 KB
random_300000.txt 78 ms 4292 KB
random_50001.txt 54 ms 3488 KB
sample_1.txt 47 ms 3256 KB
sample_2.txt 46 ms 3268 KB
sample_3.txt 49 ms 3256 KB