QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#331921#5577. AlchemyjbalatyWA 12ms9452kbPython3560b2024-02-18 22:59:162024-02-18 22:59:16

Judging History

你现在查看的是最新测评结果

  • [2024-02-18 22:59:16]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:9452kb
  • [2024-02-18 22:59:16]
  • 提交

answer

word = input()

l = 0
r = len(word) - 1
operations = 0
binstr = ""

while l < r:
    if word[l] != word[r]:
        binstr += "0"
    else:
        binstr += "1"
    l += 1
    r -= 1
count = 0
if binstr == '0':
    count = 1
else:
    
    for i in range(1, len(binstr)):
        if binstr[i] == '0' and binstr[i - 1] == '0':
            count += 1
        elif binstr[i] == '1' and binstr[i - 1] == '0':
            count += 2
        elif binstr[i] == '0' and binstr[i - 1] == '1':
                count += 1
print(count)
        

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 10ms
memory: 9364kb

input:

ioi

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 12ms
memory: 9392kb

input:

noi

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 10ms
memory: 9352kb

input:

ctsc

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 8ms
memory: 9324kb

input:

fool

output:

2

result:

ok single line: '2'

Test #5:

score: 0
Accepted
time: 7ms
memory: 9392kb

input:

vetted

output:

2

result:

ok single line: '2'

Test #6:

score: 0
Accepted
time: 4ms
memory: 9380kb

input:

aa

output:

0

result:

ok single line: '0'

Test #7:

score: 0
Accepted
time: 7ms
memory: 9452kb

input:

ic

output:

1

result:

ok single line: '1'

Test #8:

score: -100
Wrong Answer
time: 5ms
memory: 9308kb

input:

tlffohemdcncrfrxaqsbzcoyodvbxmhqukvfpahnakexcmacqa

output:

25

result:

wrong answer 1st lines differ - expected: '12', found: '25'