QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#323786 | #5577. Alchemy | leleco3248# | WA | 0ms | 3816kb | C++14 | 565b | 2024-02-10 13:23:33 | 2024-02-10 13:23:34 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.length();
int cnt = 0;
int i = 0, j = len - 1;
while (i < j) {
if (s[i] == s[j]) {
i++;
j--;
}
else {
if (j == i + 1) {
cnt += 1;
j--;
i++;
}
else {
cnt += 2;
j-= 2;
i+= 2;
}
}
}
cout << cnt << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3816kb
input:
ioi
output:
0
result:
ok single line: '0'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
noi
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'