Contest Duration: ~ (local time)

Submission #5655497

Source Code Expand

Copy
```s = input()

a = ''
for i in range(len(s)):
if s[i]!='x':
a+=s[i]

b = ''
for i in range(len(a)):
b+=a[-1-i]

if a!=b:
print(-1)
else:
ss = ''
for i in range(len(s)):
ss += s[-1-i]
i = 0
ans = 0
while s!=ss:
if i>=len(s):
ans += len(ss)-i
break
elif i>= len(ss):
ans += len(s)-i
break
if s[i]!=ss[i]:
if s[i]=='x':
ss = ss[:i]+'x'+ss[i:]
else:
s = s[:i]+'x'+s[i:]
ans += 1
i+=1
print(ans//2)

```

#### Submission Info

Submission Time 2019-05-27 00:47:51+0900 C - Inserting 'x' psmf1 PyPy3 (2.4.0) 0 628 Byte TLE

#### Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt
All 0 / 400 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt
Case Name Status Exec Time Memory
0_00.txt 173 ms 38256 KB
0_01.txt 170 ms 38256 KB
0_02.txt 173 ms 38256 KB
0_03.txt 173 ms 38256 KB
1_00.txt 172 ms 38256 KB
1_01.txt 173 ms 38256 KB
1_02.txt 172 ms 38256 KB
1_03.txt 178 ms 38256 KB
1_04.txt 174 ms 38256 KB
1_05.txt 172 ms 38256 KB
1_06.txt
1_07.txt
1_08.txt
1_09.txt
1_10.txt
1_11.txt
1_12.txt
1_13.txt
1_14.txt
1_15.txt
1_16.txt 178 ms 39280 KB
1_17.txt
1_18.txt 173 ms 39280 KB
1_19.txt
1_20.txt 175 ms 39280 KB
1_21.txt
1_22.txt 478 ms 64732 KB
1_23.txt
1_24.txt 720 ms 97756 KB
1_25.txt
1_26.txt 1782 ms 133768 KB
1_27.txt
1_28.txt