QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#91876 | #5422. Perfect Palindrome | d1n9yx | WA | 3ms | 3772kb | C++14 | 447b | 2023-03-29 19:43:23 | 2023-03-29 19:43:24 |
Judging History
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'