QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#86443#5422. Perfect Palindromewhite2718WA 13ms3628kbC++14346b2023-03-09 21:44:252023-03-09 21:44:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-09 21:44:28]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:3628kb
  • [2023-03-09 21:44:25]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int t,cnt[100];
char s[1000010];
int main(){
    scanf("%d",&t);
    while(t--){
        scanf("%s",s);
        int len=strlen(s),ma=0;
        for(int i=0;i<len;i++){
            cnt[s[i]-'a']++;
            ma=max(ma,cnt[s[i]-'a']);
        }
        printf("%d\n",len-ma);
    }

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

input:

2
abcb
xxx

output:

2
0

result:

ok 2 number(s): "2 0"

Test #2:

score: -100
Wrong Answer
time: 13ms
memory: 3628kb

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
6
0
7
2
4
0
2
-1
-2
4
-2
0
-2
0
-1
0
1
-1
1
-4
0
-1
-5
-2
-3
-5
-6
-4
-3
-5
-5
-11
-2
-4
-6
-3
-9
-6
-2
-7
-9
-5
-9
-8
-8
-12
-5
-6
-8
-7
-8
-6
-12
-11
-9
-9
-8
-6
-11
-6
-11
-12
-15
-11
-12
-11
-10
-11
-13
-7
-14
-12
-9
-7
-14
-11
-12
-18
-14
-15
-20
-13
-15
-17
-21
-13
-22
-19
-18
-16
-17
-12
-1...

result:

wrong answer 2nd numbers differ - expected: '7', found: '6'