Submission details
Task:Palindromi
Sender:Viiviiii
Submission time:2025-10-29 21:44:46 +0200
Language:Python3 (PyPy3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.04 sdetails
#20.04 sdetails
#30.04 sdetails
#40.04 sdetails
#50.04 sdetails
#60.04 sdetails
#70.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.04 sdetails

Code

word = input("Anna merkkijono:")
word_lenght = len(word)
times = 0
true = 0
new_half = ""
new_another_half = ""
pair=0
if word_lenght > 100 :
    exit()
else:
    if word_lenght%2==0:
        half_lenght=word_lenght//2
        half_word = (word[0:half_lenght])
        another_half = (word[half_lenght:])
        atm_letter = 0
        atm_letter_negative = -1
        while atm_letter<half_lenght:
            a = half_word[atm_letter]
            b = another_half[atm_letter_negative]
            atm_letter +=1
            atm_letter_negative -=1
            if a != b:
                if pair%2==0:
                    b = a
                    pair+=1
                    times+=1
                else:
                    a = b
                    times+=1
            new_half = new_half + a
            new_another_half = new_another_half + b
        new_another_half_lenght = len(new_another_half)
        new_new_another_half_letter=0
        new_new_another_half = ""
        number=-1
        while new_new_another_half_letter < new_another_half_lenght:
            new_new_another_half += new_another_half[number]
            number -=1
            new_new_another_half_letter +=1
    else:
        half_lenght=word_lenght//2
        half_word = (word[0:half_lenght])
        another_half = (word[half_lenght+1:])
        atm_letter = 0
        atm_letter_negative = -1
        while atm_letter<half_lenght:
            a = half_word[atm_letter]
            b = another_half[atm_letter_negative]
            atm_letter +=1
            atm_letter_negative -=1
            if a != b:
                if pair%2==0:
                    b = a
                    pair+=1
                    times+=1
                else:
                    a = b
                    times+=1
            new_half = new_half + a
            new_another_half = new_another_half + b
        new_half += word[half_lenght]
        new_another_half_lenght = len(new_another_half)
        new_new_another_half_letter=0
        new_new_another_half = ""
        number=-1
        while new_new_another_half_letter < new_another_half_lenght:
            new_new_another_half += new_another_half[number]
            number -=1
            new_new_another_half_letter +=1
    print(times)






Test details

Test 1 (public)

Verdict:

input
datatahti

correct output
3

user output
Anna merkkijono:3

Test 2 (public)

Verdict:

input
saippuakauppias

correct output
0

user output
Anna merkkijono:0

Test 3 (public)

Verdict:

input
a

correct output
0

user output
Anna merkkijono:0

Test 4 (public)

Verdict:

input
aa

correct output
0

user output
Anna merkkijono:0

Test 5 (public)

Verdict:

input
abc

correct output
1

user output
Anna merkkijono:1

Test 6 (public)

Verdict:

input
aybabtu

correct output
2

user output
Anna merkkijono:2

Test 7 (public)

Verdict:

input
abacabaca

correct output
2

user output
Anna merkkijono:2

Test 8 (public)

Verdict:

input
bbbbaaaababbbbbaabaaabaaaaabab...

correct output
23

user output
Anna merkkijono:23

Test 9 (public)

Verdict:

input
acbaaabaabaddaccdcccbcdbdddacd...

correct output
38

user output
Anna merkkijono:38

Test 10 (public)

Verdict:

input
uaqtmfftecryanvpshxsodjrllqnqp...

correct output
49

user output
Anna merkkijono:49