Contest Duration: ~ (local time) (90 minutes) Back to Home

Submission #144007

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

#### Submission Info

Submission Time 2014-03-15 21:47:37+0900 B - こだわりの名前 matsulib Python (2.7.3) 100 474 Byte AC 97 ms 4680 KB

#### Test Cases

Set Name Score / Max Score Test Cases
All 100 / 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 97 ms 4572 KB
hand_2.txt 89 ms 4680 KB
hand_3.txt 87 ms 4676 KB
hand_4.txt 86 ms 4672 KB
hand_5.txt 86 ms 4668 KB
hand_6.txt 85 ms 4676 KB
palindrome_1.txt 52 ms 3576 KB
palindrome_12345.txt 55 ms 3592 KB
palindrome_2.txt 53 ms 3580 KB
palindrome_299998.txt 86 ms 4672 KB
palindrome_299999.txt 87 ms 4572 KB
palindrome_3.txt 53 ms 3644 KB
palindrome_300000.txt 87 ms 4568 KB
palindrome_4.txt 53 ms 3636 KB
palindrome_5.txt 51 ms 3652 KB
palindrome_6789.txt 56 ms 3556 KB
palindrome_67890.txt 58 ms 3792 KB
palindrome_mod_1.txt 50 ms 3536 KB
palindrome_mod_1000.txt 52 ms 3520 KB
palindrome_mod_10000.txt 54 ms 3540 KB
palindrome_mod_100001.txt 65 ms 3804 KB
palindrome_mod_2.txt 54 ms 3572 KB
palindrome_mod_200000.txt 79 ms 4276 KB
palindrome_mod_299999.txt 89 ms 4584 KB
palindrome_mod_3.txt 56 ms 3568 KB
palindrome_mod_300000.txt 85 ms 4568 KB
palindrome_mod_4.txt 52 ms 3640 KB
palindrome_mod_5.txt 52 ms 3536 KB
palindrome_mod_50001.txt 59 ms 3688 KB
random_1.txt 53 ms 3636 KB
random_10.txt 50 ms 3540 KB
random_100001.txt 65 ms 3900 KB
random_101.txt 51 ms 3536 KB
random_3000.txt 54 ms 3616 KB
random_300000.txt 88 ms 4672 KB
random_50001.txt 58 ms 3748 KB
sample_1.txt 52 ms 3520 KB
sample_2.txt 49 ms 3536 KB
sample_3.txt 51 ms 3540 KB