QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#561677 | #5422. Perfect Palindrome | louhao088# | WA | 3ms | 3932kb | C++23 | 407b | 2024-09-13 08:09:40 | 2024-09-13 08:09:46 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int T;
string s;
int ans,buc[26];
int main()
{
ios::sync_with_stdio(false);
cin>>T;
while(T--)
{
cin>>s;
for(int i=0;i<26;i++) buc[i]=0;
for(int i=0;i<s.length();i++) ++buc[s[i]-'a'];
for(int i=0;i<26;i++) ans=max(ans,buc[i]);
printf("%d\n",(int)s.length()-ans);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3824kb
input:
2 abcb xxx
output:
2 0
result:
ok 2 number(s): "2 0"
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3932kb
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:
8 7 2 8 4 7 1 5 -1 2 7 -1 0 1 5 1 4 6 -1 5 2 5 4 1 5 4 1 2 4 6 -1 1 -1 8 2 1 0 2 -1 6 4 -1 1 0 0 2 0 8 0 7 5 2 3 4 0 8 5 4 8 7 5 2 -1 1 2 1 0 4 -1 -1 8 2 2 4 7 3 -2 3 0 4 4 -2 6 6 2 1 7 1 3 0 3 6 7 6 4 -1 3 2 0 6 1 6 5 2 2 7 5 7 2 7 1 7 -2 6 6 0 5 -2 -2 4 3 -2 6 4 2 1 -1 5 6 4 0 3 3 6 1 2 0 3 2 7 5 ...
result:
wrong answer 6th numbers differ - expected: '8', found: '7'