QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#331921 | #5577. Alchemy | jbalaty | WA | 12ms | 9452kb | Python3 | 560b | 2024-02-18 22:59:16 | 2024-02-18 22:59:16 |
Judging History
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'