QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
詳細信息
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); | ~~~~~^~~~~~~~~