| Task: | Palindromi |
| Sender: | AapoL |
| Submission time: | 2025-10-28 11:37:01 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.04 s | details |
| #2 | WRONG ANSWER | 0.04 s | details |
| #3 | WRONG ANSWER | 0.04 s | details |
| #4 | WRONG ANSWER | 0.04 s | details |
| #5 | WRONG ANSWER | 0.04 s | details |
| #6 | WRONG ANSWER | 0.04 s | details |
| #7 | WRONG ANSWER | 0.04 s | details |
| #8 | WRONG ANSWER | 0.04 s | details |
| #9 | WRONG ANSWER | 0.04 s | details |
| #10 | WRONG ANSWER | 0.04 s | details |
Code
s = input()
l = len(s)
half, rem = divmod(len(s), 2)
left, right = s[:half], s[half + rem:]
print(f"left = {left}")
if rem != 0:
print(f"middle = {s[half]}")
print(f"right = {right}")
muutokset = 0
for i in range(len(left)):
#print(f"i = {i}")
if not (left[i] == right[-(i+1)]):
left = left[:i] + right[-(i+1)] + left[i + 1:]
#print(left)
#print(right)
muutokset += 1
#print(f"muutokset = {muutokset}")
print(muutokset)
#d a a t
#0 1 0 1
#Test details
Test 1 (public)
Verdict: WRONG ANSWER
| input |
|---|
| datatahti |
| correct output |
|---|
| 3 |
| user output |
|---|
| left = data middle = t right = ahti 3 |
Test 2 (public)
Verdict: WRONG ANSWER
| input |
|---|
| saippuakauppias |
| correct output |
|---|
| 0 |
| user output |
|---|
| left = saippua middle = k right = auppias 0 |
Test 3 (public)
Verdict: WRONG ANSWER
| input |
|---|
| a |
| correct output |
|---|
| 0 |
| user output |
|---|
| left = middle = a right = 0 |
Test 4 (public)
Verdict: WRONG ANSWER
| input |
|---|
| aa |
| correct output |
|---|
| 0 |
| user output |
|---|
| left = a right = a 0 |
Test 5 (public)
Verdict: WRONG ANSWER
| input |
|---|
| abc |
| correct output |
|---|
| 1 |
| user output |
|---|
| left = a middle = b right = c 1 |
Test 6 (public)
Verdict: WRONG ANSWER
| input |
|---|
| aybabtu |
| correct output |
|---|
| 2 |
| user output |
|---|
| left = ayb middle = a right = btu 2 |
Test 7 (public)
Verdict: WRONG ANSWER
| input |
|---|
| abacabaca |
| correct output |
|---|
| 2 |
| user output |
|---|
| left = abac middle = a right = baca 2 |
Test 8 (public)
Verdict: WRONG ANSWER
| input |
|---|
| bbbbaaaababbbbbaabaaabaaaaabab... |
| correct output |
|---|
| 23 |
| user output |
|---|
| left = bbbbaaaababbbbbaabaaaba... |
Test 9 (public)
Verdict: WRONG ANSWER
| input |
|---|
| acbaaabaabaddaccdcccbcdbdddacd... |
| correct output |
|---|
| 38 |
| user output |
|---|
| left = acbaaabaabaddaccdcccbcd... |
Test 10 (public)
Verdict: WRONG ANSWER
| input |
|---|
| uaqtmfftecryanvpshxsodjrllqnqp... |
| correct output |
|---|
| 49 |
| user output |
|---|
| left = uaqtmfftecryanvpshxsodj... |
