比赛链接

A题主要是map的使用,比赛的时候问了下队友,下次要记住了

#include<bits/stdc++.h>
using namespace std;
typedef long long LL; LL T,n;
map<string,int> mp1,mp2; int main()
{
cin>>T;
while(T--)
{
mp1.clear();mp2.clear();
cin>>n;
for(int i=;i<n;i++)
{
string str;
int t;
cin>>str>>t;
if(mp1[str]<t)
{
mp2[str]=mp1[str];
mp1[str]=t;
}
else if(mp2[str]<t)
{
mp2[str]=t;
}
}
int ans=;
for(map<string,int>::iterator it=mp1.begin();it!=mp1.end();++it)
ans+=it->second;
for(map<string,int>::iterator it=mp2.begin();it!=mp2.end();++it)
ans+=it->second;
cout<<ans<<endl;
}
}

hdu_6015

B题算是道组合数学吧,枚举可能满足条件的 -B-C- (也即-C-B),以BC为中间二点的满足条件的序列数=(du[B]-1)*(du[C]-1)*2

#include<bits/stdc++.h>
using namespace std;
typedef long long LL; LL du[];
struct Edge
{
LL u,v;
}e[]; int main()
{
ios::sync_with_stdio(false);cin.tie();
LL T,n,m,k;
cin>>T;
while(T--)
{
memset(du,,sizeof(du));
cin>>n>>m>>k;
for(int i=;i<k;i++)
{
LL u,v;
cin>>u>>v;
du[u]++,du[n+v]++;
e[i]=(Edge){u,v+n};
}
LL ans=;
for(int i=;i<k;i++)
ans+=(du[e[i].u]-)*(du[e[i].v]-)*;
cout<<ans<<endl;
}
}

hdu_6016

BestCoder Round #92 (hdu_6015 6016)的更多相关文章

  1. BestCoder Round #92 (hdu 6015 6016)

    比赛链接 A题主要是map的使用,比赛的时候问了下队友,下次要记住了 #include<bits/stdc++.h> using namespace std; typedef long l ...

  2. BestCoder Round #92 比赛记录

    上午考完试后看到了晚上的BestCoder比赛,全机房都来参加 感觉压力好大啊QAQ,要被虐了. 7:00 比赛开始了,迅速点进了T1 大呼这好水啊!告诉了同桌怎么看中文题面 然后就开始码码码,4分1 ...

  3. BestCoder Round #92 1001 Skip the Class —— 字典树 or map容器

    题目链接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=748&pid=1001 题解: 1.trie树 关 ...

  4. BestCoder Round #92 1002 Count the Sheep —— 枚举+技巧

    题目链接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=748&pid=1002 题解: 做题的时候只是想到 ...

  5. HDU_6016_(Bestcoder round #92 1002)_(dfs)(暴力)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6016 题意:给定男羊和女羊的朋友关系,即给定一个图,问从任意一只羊开始连续数四只不相同的羊的方法数. ...

  6. BestCoder Round #92

    这里是逢比赛必挂的智障选手ysf…… 不知道是因为自己菜还是心态不好……也许是后者吧,毕竟每次打比赛的时候都会很着急.lrd说我打比赛的功利性太强,想想确实是这样. 昨天打完之后自觉身败名裂没敢写出来 ...

  7. [BestCoder Round #3] hdu 4908 BestCoder Sequence (计数)

    BestCoder Sequence Problem Description Mr Potato is a coder. Mr Potato is the BestCoder. One night, ...

  8. BestCoder Round #89 02单调队列优化dp

    1.BestCoder Round #89 2.总结:4个题,只能做A.B,全都靠hack上分.. 01  HDU 5944   水 1.题意:一个字符串,求有多少组字符y,r,x的下标能组成等比数列 ...

  9. BestCoder Round #90 //div all 大混战 一题滚粗 阶梯博弈,树状数组,高斯消元

    BestCoder Round #90 本次至少暴露出三个知识点爆炸.... A. zz题 按题意copy  Init函数 然后统计就ok B. 博弈 题  不懂  推了半天的SG.....  结果这 ...

随机推荐

  1. 如何用Python做词云(收藏)

    看过之后你有什么感觉?想不想自己做一张出来? 如果你的答案是肯定的,我们就不要拖延了,今天就来一步步从零开始做个词云分析图.当然,做为基础的词云图,肯定比不上刚才那两张信息图酷炫.不过不要紧,好的开始 ...

  2. 06.04 html

    域名跟ip地址是绑定的看某个网站的ip地址 可以ping网址知道ip地址   最终访问的都是ip地址  每个ip地址都对应了一个空间(一块区域 要用来存储内容)网页访问的原理: 客户端电脑发动请求到服 ...

  3. (转)Javascript的DOM操作 - 性能优化

    转载:https://my.oschina.net/blogshi/blog/198910 摘要: 想稍微系统的说说对于DOM的操作,把Javascript和jQuery常用操作DOM的内容归纳成思维 ...

  4. git 常用的命令符

    1. linux操作命令: touch Filename:创建一个文件: mkdir 文件夹名字:创建一个文件夹: cd pathname:切换磁盘: cd ..:返回上一级: rm Filename ...

  5. Java通过jxl解析Excel文件入库,及日期格式处理方式 (附源代码)

    JAVA可以利用jxl简单快速的读取文件的内容,但是由于版本限制,只能读取97-03  xls格式的Excel. 本文是项目中用到的一个实例,先通过上传xls文件(包含日期),再通过jxl进行读取上传 ...

  6. Python中的枚举

    在Python中想要实现枚举功能的方式比较多,可以通过字典这一数据结构,利用键与值的对应关系,可以实现枚举的功能. my_Enum={ 'red':1, 'yellow':2, 'blue':3 } ...

  7. Linux版微信

    一.到github上下载https://github.com/geeeeeeeeek/electronic-wechat/releases下载linux-x64.tar.gz,具体根据操作系统是32位 ...

  8. Bash中的数学扩展

    Bash只支持整数运算,不支持浮点运算.如果需要进行浮点运算,需要使用bc程序.Bash中的数学扩展有两种形式:$[ expression ]或$(( expression )) 例子:$echo $ ...

  9. API 接口规范

    整体规范建议采用RESTful 方式来实施. 1. 协议 API与用户的通信协议,总是使用HTTPs协议,确保交互数据的传输安全. 2. 域名 应该尽量将API部署在专用域名之下. https://a ...

  10. webpack2教程--从入门到放弃

    开车之前,先介绍一些npm的命令: :D 进入D盘 mkdir webapp 创建webapp文件夹 cd webapp 进入webapp文件夹 mkdir webapp && cd ...