QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#329016 | #5577. Alchemy | torresos | WA | 0ms | 3844kb | C++23 | 372b | 2024-02-16 11:55:06 | 2024-02-16 11:55:06 |
Judging History
answer
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
int prev = 0;
int nms = 0;
for (int i = 0; i < n / 2; i++) {
if ((s[i] != s[n-i-1]) && !prev) {
prev = 1;
++nms;
continue;
} else if (prev) {
++nms;
}
prev = 0;
}
cout << nms;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3772kb
input:
ioi
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
noi
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
ctsc
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
fool
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
vetted
output:
2
result:
ok single line: '2'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
aa
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
ic
output:
1
result:
ok single line: '1'
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3608kb
input:
tlffohemdcncrfrxaqsbzcoyodvbxmhqukvfpahnakexcmacqa
output:
24
result:
wrong answer 1st lines differ - expected: '12', found: '24'