题解 | 小红的01串

小红的01串

https://www.nowcoder.com/practice/8920f77fb2c0409a9f4f9025969110de

#include <iostream>
#include<unordered_map>
#define ll long long
using namespace std;

int main() {
    int q;
    cin>>q;
    string s;
    unordered_map<char,ll>cnt;
    while(q--){
        cin>>s;
        for(char a:s){
            cnt[a]++;
        }
        if(cnt['0']%2==0||cnt['1']%2==0)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        cnt.clear();
    }
    return 0;
}

全部评论

相关推荐

04-15 20:51
门头沟学院 Java
纳斯卡可:把名字改一下吧 千万级用户你真测过吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务