QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#91876#5422. Perfect Palindromed1n9yxWA 3ms3772kbC++14447b2023-03-29 19:43:232023-03-29 19:43:24

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-29 19:43:24]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3772kb
  • [2023-03-29 19:43:23]
  • 提交

answer

# include <iostream>
# include <algorithm>

int cnt[200];

int main()
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int t;
  std::cin >> t;
  while (t -- ) {
    int maxres = -1;
    std::string s;
    std::cin >> s;
    for (int i = 0; i < s.size(); ++ i) {
      int x = s[i];
      ++ cnt[x];
      maxres = std::max(maxres, cnt[x]);
    }
    std::cout << s.size() - maxres << '\n';
  }

  return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3404kb

input:

2
abcb
xxx

output:

2
0

result:

ok 2 number(s): "2 0"

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 3772kb

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
18446744073709551615
18446744073709551614
4
18446744073709551614
0
18446744073709551614
0
18446744073709551615
0
1
18446744073709551615
1
18446744073709551612
0
18446744073709551615
18446744073709551611
18446744073709551614
18446744073709551613
18446744073709551611
184467440737095516...

result:

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