QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#190629 | #5422. Perfect Palindrome | SoyTony | Compile Error | / | / | C++14 | 421b | 2023-09-29 08:49:21 | 2023-09-29 08:49:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int t;
int n;
char s[maxn]
mp<char,int> mp;
int main(){
scanf("%d",&t);
while(t--){
scanf("%s",s+1);
n=strlen(s+1);
mp.clear();
int mx=0;
for(int i=1;i<=n;++i){
++mp[s[i]];
mx=max(mx,mp[s[i]]);
}
printf("%d\n",n-mx);
}
return 0;
}
Details
answer.code:9:1: error: expected initializer before ‘mp’ 9 | mp<char,int> mp; | ^~ answer.code: In function ‘int main()’: answer.code:14:20: error: ‘s’ was not declared in this scope 14 | scanf("%s",s+1); | ^ answer.code:16:9: error: ‘mp’ was not declared in this scope 16 | mp.clear(); | ^~ answer.code:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d",&t); | ~~~~~^~~~~~~~~