QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#210704 | #5422. Perfect Palindrome | ucup-team1001 | WA | 7ms | 3544kb | C++14 | 798b | 2023-10-11 19:09:20 | 2023-10-11 19:09:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using ll = long long;
#define int ll
#define endl "\n"
#define no cout << "NO" << endl
#define yes cout << "YES" << endl
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define ary(i) array<ll,(i)>
#define all(x) x.begin(),x.end()
const int maxn=2e5+7;
const int inf=1e9+7;
const int mod=998244353;
void solve(){
int ans=0;
string mr;
cin>>mr;
int n=mr.size();
for(int i=0;i<n;i++){
if(mr[i]!=mr[n-i-1]){
ans++;
}
}
ans/=2;
cout<<ans<<endl;
}
#undef int
int main()
{
// IOS
int n;
cin>>n;
// n=1;
while(n--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3520kb
input:
2 abcb xxx
output:
2 0
result:
ok 2 number(s): "2 0"
Test #2:
score: -100
Wrong Answer
time: 7ms
memory: 3544kb
input:
11107 lfpbavjsm pdtlkfwn fmb hptdswsoul bhyjhp pscfliuqn nej nxolzbd z clzb zqomviosz u ek vco oymonrq rjd ktsqti mdcvserv x birnpfu gsgk ftchwlm bzqgar ovj nsgiegk dbolme nvr rpsc fprodu eqtidwto j qty o jknssmabwl qjfv wrd aa ejsf i npmmhkef dzvyon p zww dp ru qmwm sc wnnjyoepxo hc opvfepiko inuxx...
output:
4 4 1 5 2 4 1 3 0 2 2 0 1 1 3 1 2 4 0 3 2 3 3 1 3 3 1 2 3 4 0 1 0 5 2 1 0 2 0 4 3 0 1 1 1 2 1 5 1 3 3 2 2 3 1 4 3 3 4 4 3 2 0 1 2 1 1 3 0 0 5 2 2 3 5 2 0 3 1 3 3 0 4 4 2 2 5 2 3 1 3 4 5 4 3 1 3 2 1 4 2 4 4 2 2 5 4 5 2 5 2 5 0 3 4 1 4 0 0 3 3 0 4 2 2 1 1 4 4 3 1 3 3 4 2 2 1 3 2 5 4 0 2 3 1 1 2 0 3 5 ...
result:
wrong answer 1st numbers differ - expected: '8', found: '4'