首页 > 其他分享 >Codeforces Round #666 (Div. 2) A. Juggling Letters

Codeforces Round #666 (Div. 2) A. Juggling Letters

时间:2023-02-08 21:05:12浏览次数:43  
标签:ok cout int 666 Codeforces cin num Letters include


problem

Codeforces Round #666 (Div. 2)  A. Juggling Letters_#include

solution

统计各个字符数,只要都是n的倍数就可以了

#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int num[250];
int main(){
int T; cin>>T;
while(T--){
int n; cin>>n;
memset(num,0,sizeof(num));
for(int i = 1; i <= n; i++){
string s; cin>>s;
for(int i = 0; i < s.size(); i++)
num[s[i]-'A']++;
}
int ok = 1;
for(int i = 0; i <= 100; i++){
if(num[i]%n!=0){
ok = 0; break;
}
}
if(ok)cout<<"YES\n";
else cout<<"NO\n";
}
return 0;
}


标签:ok,cout,int,666,Codeforces,cin,num,Letters,include
From: https://blog.51cto.com/gwj1314/6044885

相关文章