QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#692004 | #5422. Perfect Palindrome | lselegies | WA | 0ms | 3828kb | C++14 | 371b | 2024-10-31 13:37:14 | 2024-10-31 13:37:14 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int ans[26];
signed main()
{
int t;
cin>>t;
while(t--)
{
string s;
cin>>s;
s=" "+s;
int n=s.size()-1,res=0;
for (int i=1;i<=n;i++)
ans[i]=0;
for (int i=1;i<=n;i++)
{
int a=s[i]-'a';
ans[a]++;
}
for (int i=1;i<=n;i++)
res=max(res,ans[i]);
cout<<n-res<<endl;
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3828kb
input:
2 abcb xxx
output:
2 3
result:
wrong answer 2nd numbers differ - expected: '0', found: '3'