ABC044 B - 美しい文字列
問題はこちら atcoder.jp
方針
いっぱいループしました。
コード
#include <bits/stdc++.h> using namespace std; int main(){ string w; cin>>w; vector<int> count(26); bool check=true; char c='a'; for(int i=0; i<26; i++){ for(int j=0; j<w.size(); j++){ if(w[j]==c){ count[i]++; } } c++; } for(int i=0; i<26; i++){ if(count[i]%2!=0){ check=false; } } cout<<(check==true ? "Yes" : "No")<<endl; }