QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
详细
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'