QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#465788#5422. Perfect PalindromeJustJieWA 0ms3608kbC++20783b2024-07-07 09:31:542024-07-07 09:31:54

Judging History

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

  • [2024-07-07 09:31:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3608kb
  • [2024-07-07 09:31:54]
  • 提交

answer

/***************************************************************************************************
 * author : Jie Chen (4th Year CS)
 * school : Rochester Institute of Technology
 * created: 07.06.2024 21:30:27
****************************************************************************************************/
#include "bits/stdc++.h"

using namespace std;

using i64 = long long;

void work(int tc) {
    string s;
    cin >> s;
    int n = s.size();

    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += int(s[i] != s[n - i - 1]);
    }
    cout << ans << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin >> T;
    for (int t = 1; T--; t++) {
        work(t);
    }
}

// ~ Just Jie

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3608kb

input:

2
abcb
xxx

output:

4
0

result:

wrong answer 1st numbers differ - expected: '2', found: '4'