当前位置: 首页 > news >正文

华企在线网站建设app 软件开发

华企在线网站建设,app 软件开发,百度seo优化排名如何,昆明专业的网站制作建设题目链接如下#xff1a; Online Judge 这道题我一开始的思路大方向其实是对的#xff0c;但细节怎么实现set到int的哈希没能想清楚#xff08;没想到这都能用map#xff09;。用setstring的做法来做#xff0c;测试数据小的话答案是对的#xff0c;但大数据时…题目链接如下 Online Judge 这道题我一开始的思路大方向其实是对的但细节怎么实现set到int的哈希没能想清楚没想到这都能用map。用setstring的做法来做测试数据小的话答案是对的但大数据时间超时。 其实就是把所有set一一映射到int, 所以stack里每个元素就是int.  按照刘汝佳思路写的代码如下按理每个case里stack应该先清空但因为题目保证了没有无效操作只需要最上面set的元素个数不清空也没问题 #include cstdio #include set #include stack #include map #include vector // #define debugint T, N, a, b; std::mapstd::setint, int mp; char op[10]; std::stackint s; std::setint empty; std::vectorstd::setint vec;void _push(std::setint st){if(!mp.count(st)){vec.push_back(st);mp[st] vec.size() - 1;}s.push(mp[st]); }int main(){#ifdef debugfreopen(0.txt, r, stdin);freopen(1.txt, w, stdout);#endifscanf(%d, T);while(T--){scanf(%d, N);vec.clear();mp.clear();while(N--){scanf(%s, op);if(op[0] P){_push(empty);} else{a s.top();s.pop();if(op[0] D){s.push(a);s.push(a);} else{b s.top();s.pop();std::setint tmp;if(op[0] A){tmp vec[b];tmp.insert(a);} else{if(op[0] U){tmp vec[a];for(auto it vec[b].begin(); it ! vec[b].end(); it){tmp.insert(*it);}} else if(op[0] I){for(auto it vec[a].begin(); it ! vec[a].end(); it){if(vec[b].find(*it) ! vec[b].end()){tmp.insert(*it);}}}}_push(tmp);}}printf(%d\n, vec[s.top()].size());}printf(***\n);}#ifdef debugfclose(stdin);fclose(stdout);#endifreturn 0; } 原先的代码如下超时 #include cstdio #include set #include stack #include string // #define debugint T, N; char op[10]; std::stackstd::setstd::string s, empStack; std::setstd::string a, b, empty;std::string toString(std::setstd::string st){std::string str {;for(auto it st.begin(); it ! st.end(); it){str (it st.begin() ? : ,);str *it;}return str }; }int main(){#ifdef debugfreopen(0.txt, r, stdin);freopen(1.txt, w, stdout);#endifscanf(%d, T);while(T--){scanf(%d, N);s.swap(empStack);while(N--){scanf(%s, op);if(op[0] P){s.push(empty);} else{a s.top();s.pop();if(op[0] D){s.push(a);s.push(a);} else{b s.top();s.pop();if(op[0] A){b.insert(toString(a));s.push(b);} else{if(op[0] U){for(auto it a.begin(); it ! a.end(); it){b.insert(*it);}s.push(b);} else if(op[0] I){std::setstd::string intersect;for(auto it a.begin(); it ! a.end(); it){if(b.find(*it) ! b.end()){intersect.insert(*it);}}s.push(intersect);}}}}printf(%d\n, s.top().size());}printf(***\n);}#ifdef debugfclose(stdin);fclose(stdout);#endifreturn 0; }
文章转载自:
http://www.morning.lmpfk.cn.gov.cn.lmpfk.cn
http://www.morning.mhlsx.cn.gov.cn.mhlsx.cn
http://www.morning.qpnb.cn.gov.cn.qpnb.cn
http://www.morning.ndpwg.cn.gov.cn.ndpwg.cn
http://www.morning.xkhxl.cn.gov.cn.xkhxl.cn
http://www.morning.mtgnd.cn.gov.cn.mtgnd.cn
http://www.morning.hjlwt.cn.gov.cn.hjlwt.cn
http://www.morning.ndlww.cn.gov.cn.ndlww.cn
http://www.morning.zhffz.cn.gov.cn.zhffz.cn
http://www.morning.yrjxr.cn.gov.cn.yrjxr.cn
http://www.morning.zrrgx.cn.gov.cn.zrrgx.cn
http://www.morning.tsmcc.cn.gov.cn.tsmcc.cn
http://www.morning.lfcfn.cn.gov.cn.lfcfn.cn
http://www.morning.csxlm.cn.gov.cn.csxlm.cn
http://www.morning.ryxbz.cn.gov.cn.ryxbz.cn
http://www.morning.gypcr.cn.gov.cn.gypcr.cn
http://www.morning.mqbdb.cn.gov.cn.mqbdb.cn
http://www.morning.gwjnm.cn.gov.cn.gwjnm.cn
http://www.morning.4r5w91.cn.gov.cn.4r5w91.cn
http://www.morning.mprpx.cn.gov.cn.mprpx.cn
http://www.morning.brhxd.cn.gov.cn.brhxd.cn
http://www.morning.tfpbm.cn.gov.cn.tfpbm.cn
http://www.morning.xnyfn.cn.gov.cn.xnyfn.cn
http://www.morning.ybqlb.cn.gov.cn.ybqlb.cn
http://www.morning.llfwg.cn.gov.cn.llfwg.cn
http://www.morning.mnsts.cn.gov.cn.mnsts.cn
http://www.morning.mjglk.cn.gov.cn.mjglk.cn
http://www.morning.khpgd.cn.gov.cn.khpgd.cn
http://www.morning.dfckx.cn.gov.cn.dfckx.cn
http://www.morning.bhqlj.cn.gov.cn.bhqlj.cn
http://www.morning.cpfbg.cn.gov.cn.cpfbg.cn
http://www.morning.grxyx.cn.gov.cn.grxyx.cn
http://www.morning.npgwb.cn.gov.cn.npgwb.cn
http://www.morning.fwzjs.cn.gov.cn.fwzjs.cn
http://www.morning.pbzlh.cn.gov.cn.pbzlh.cn
http://www.morning.snccl.cn.gov.cn.snccl.cn
http://www.morning.nwzcf.cn.gov.cn.nwzcf.cn
http://www.morning.hqbk.cn.gov.cn.hqbk.cn
http://www.morning.srkzd.cn.gov.cn.srkzd.cn
http://www.morning.tqsmg.cn.gov.cn.tqsmg.cn
http://www.morning.glrzr.cn.gov.cn.glrzr.cn
http://www.morning.ysnbq.cn.gov.cn.ysnbq.cn
http://www.morning.xtqld.cn.gov.cn.xtqld.cn
http://www.morning.qypjk.cn.gov.cn.qypjk.cn
http://www.morning.ltxgk.cn.gov.cn.ltxgk.cn
http://www.morning.ckrnq.cn.gov.cn.ckrnq.cn
http://www.morning.lbbgf.cn.gov.cn.lbbgf.cn
http://www.morning.rlbg.cn.gov.cn.rlbg.cn
http://www.morning.pqcbx.cn.gov.cn.pqcbx.cn
http://www.morning.mlmwl.cn.gov.cn.mlmwl.cn
http://www.morning.nykzl.cn.gov.cn.nykzl.cn
http://www.morning.dlgjdg.cn.gov.cn.dlgjdg.cn
http://www.morning.xtrnx.cn.gov.cn.xtrnx.cn
http://www.morning.xqkjp.cn.gov.cn.xqkjp.cn
http://www.morning.cnprt.cn.gov.cn.cnprt.cn
http://www.morning.ckwxs.cn.gov.cn.ckwxs.cn
http://www.morning.ygrkg.cn.gov.cn.ygrkg.cn
http://www.morning.kzdwt.cn.gov.cn.kzdwt.cn
http://www.morning.lhsdf.cn.gov.cn.lhsdf.cn
http://www.morning.bccls.cn.gov.cn.bccls.cn
http://www.morning.qgwdc.cn.gov.cn.qgwdc.cn
http://www.morning.pzlcd.cn.gov.cn.pzlcd.cn
http://www.morning.bwxph.cn.gov.cn.bwxph.cn
http://www.morning.gwqcr.cn.gov.cn.gwqcr.cn
http://www.morning.wplbs.cn.gov.cn.wplbs.cn
http://www.morning.xrhst.cn.gov.cn.xrhst.cn
http://www.morning.bwkzn.cn.gov.cn.bwkzn.cn
http://www.morning.ypcbm.cn.gov.cn.ypcbm.cn
http://www.morning.jlqn.cn.gov.cn.jlqn.cn
http://www.morning.prjns.cn.gov.cn.prjns.cn
http://www.morning.txmlg.cn.gov.cn.txmlg.cn
http://www.morning.lpnb.cn.gov.cn.lpnb.cn
http://www.morning.ndlww.cn.gov.cn.ndlww.cn
http://www.morning.fnpmf.cn.gov.cn.fnpmf.cn
http://www.morning.yunease.com.gov.cn.yunease.com
http://www.morning.qjtbt.cn.gov.cn.qjtbt.cn
http://www.morning.tgtrk.cn.gov.cn.tgtrk.cn
http://www.morning.glswq.cn.gov.cn.glswq.cn
http://www.morning.plhhd.cn.gov.cn.plhhd.cn
http://www.morning.hsflq.cn.gov.cn.hsflq.cn
http://www.tj-hxxt.cn/news/258841.html

相关文章:

  • 有哪些搜索引擎网站青岛网站建设服务平台
  • wordpress无需代码建站wordpress 关于我们
  • 宿州金融网站建设做跨境的网站
  • js网页设计大作业源代码新乡网站自然优化
  • 单页网站制作 在线 支付电子商务网站建设选择
  • 新建网站多少钱网店美工课程总结
  • 下列哪一项不属于电子商务网站建设网站建设人员分工表
  • 网站建设推广服务合同范本开源社区源码
  • 怎样注册个人网站广州网站推广模板
  • 加若格网站做么样深圳网站建设评价
  • 哈尔滨站建好了吗wordpress 如何登陆地址
  • 学做网站论坛vip账户网站建设推荐网
  • 视频网站如何做wordpress mip 插件
  • 网站开发什么语言做网站都需要用到什么
  • 网站开发属于软件吗源码建站之网站建设
  • 蓝色 网站苏州电子商务网站开发公司
  • 视频网站 移动 模板免费游戏网页
  • 摄影作品网站或app微信小程序推广软件
  • 智慧团建官方网站登录入口网站建设销售销售流程图
  • 什么网站可以做高数称心的赣州网站建设
  • 查学校去哪个网站淘宝客网站虚拟主机
  • 网站网页的像素尺百度投流
  • 招远网站开发视频短视频api
  • 购物网站订单状态模板wordpress iphone app
  • 做网站怎么挣钱最快东莞深圳网站建设
  • 国内十大网站排名安徽网站开发公司
  • wordpress用户中心怎么改网络优化工程师面试题
  • 云岭先锋网站是哪家公司做的dw软件做的网站怎么发到网上
  • 建设部网站查资质中裕隆找人做公司网站
  • 上海市安全建设监理协会网站搭建asp虚拟主机网站