标签:ret ++ str mes color i++ min bsp bar
依照题意暴力模拟即可A掉
#include <cstdio> #include <algorithm> #include <cstring> #include <set> using namespace std; char s[100100]; int n,k,barrel[30]; int main(){ scanf("%d %d",&n,&k); scanf("%s",s+1); for(int i=1;i<=n;i++) barrel[s[i]-‘A‘+1]++; int ans=0x3f3f3f3f; for(int i=1;i<=k;i++) ans=min(ans,barrel[i]); printf("%d\n",ans*k); return 0; }
题解——Codeforces Round #508 (Div. 2) T1 (模拟)
标签:ret ++ str mes color i++ min bsp bar
原文地址:https://www.cnblogs.com/dreagonm/p/9602502.html