华为笔试第三题(08-21)

求大佬们分析下哪里出问题了?华为笔试第三题,通过率为0,08-21
#include <bits/stdc++.h>
using namespace std;

int main()
{

    string s;
    cin>>s;
    int n;
    cin>>n;
    unordered_set<string>  mys;
    while(n--)
    {
        string ss;
        cin>>ss;
        vector<string> res;
        auto beg=ss.begin();
        for(auto i=ss.begin();i!=ss.end();i++)
        {
            if((*i)==','){
                string temp(beg,i);
                res.push_back(temp);
                beg=i+1;
            }
        }

        string temp(beg,ss.end());
        res.push_back(temp);
        for(auto c:res)
            mys.insert(c);
    }
    mys.insert(s);
    cout<<mys.size();
}



#华为##笔试题目#
全部评论
样例是过了的
点赞 回复
分享
发布于 2019-08-21 22:38
并不是简单的set字符去重
点赞 回复
分享
发布于 2019-08-21 23:36
联想
校招火热招聘中
官网直投

相关推荐

头像
04-09 14:29
Java
点赞 评论 收藏
转发
点赞 1 评论
分享
牛客网
牛客企业服务