Skip the Class

代码:

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ls rt<<1,l,m
#define rs rt<<1|1,m+1,r
#define pb push_back
#define mem(a,b) memset((a),(b),sizeof(a))
const int INF=0x3f3f3f3f;
const int N=;
struct lesson
{
string s;
int v;
operator < (const lesson &t) const
{
return v>t.v;
}
}a[N];
map<string,int>mp;
int main()
{
ios::sync_with_stdio(false);
cin.tie();
int t;
cin>>t;
while(t--)
{
mp.clear();
int n;
cin>>n;
for(int i=;i<n;i++)cin>>a[i].s>>a[i].v;
sort(a,a+n);
int ans=;
for(int i=;i<n;i++)
{
if(mp[a[i].s]<)
{
ans+=a[i].v;
mp[a[i].s]++;
}
}
cout<<ans<<endl;
}
return ;
}

HDU 6015 Skip the Class的更多相关文章

  1. HDU 6015 Skip the Class 优先队列 map的使用

    Skip the Class Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Tota ...

  2. (bc 1001) hdu 6015 skip the class

    Skip the Class Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) T ...

  3. BestCoder Round #92 (hdu 6015 6016)

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

  4. hdu多校第二场 1010 (hdu6600)Just Skip This Problem

    题意: 给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能求出xi是几,求出这样询问次数最少的询问方案数. 结果mod1e6+3 题解: 队友赛时很快 ...

  5. HDU 5724:Chess(博弈 + 状压)

    http://acm.hdu.edu.cn/showproblem.php?pid=5724 Chess Problem Description   Alice and Bob are playing ...

  6. HDU 5724 Chess(国际象棋)

    HDU 5724 Chess(国际象棋) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  7. HDU 5724 Chess (sg函数)

    Chess 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5724 Description Alice and Bob are playing a s ...

  8. 2013 多校联合2 D Vases and Flowers (hdu 4614)

    Vases and Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others ...

  9. hdu 5724 SG+状态压缩

    Chess Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submi ...

随机推荐

  1. ubuntu shell脚本出错 dash

    今天在Ubuntu下调试代码,明明是正确的,却仍然报错,查了错误信息才知道:Ubuntu中默认不是bash,而是为了加快开机速度,使用了dash. dash中需要严格的语法,而且与bash语法不同.例 ...

  2. poj2932 Coneology

    地址:http://poj.org/problem?id=2932 题目: Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Subm ...

  3. 十图详解tensorflow数据读取机制

    在学习tensorflow的过程中,有很多小伙伴反映读取数据这一块很难理解.确实这一块官方的教程比较简略,网上也找不到什么合适的学习材料.今天这篇文章就以图片的形式,用最简单的语言,为大家详细解释一下 ...

  4. 2018-2019-2 20165209 《网络对抗技术》Exp2:后门原理与实践

    2018-2019-2 20165209 <网络对抗技术>Exp2:后门原理与实践 1 后门原理与实验内容 1.1 后门原理 -后门就是不经过正常认证流程而访问系统的通道. 哪里有后门呢? ...

  5. 用CSS让字体在一行内显示不换行

    青枫 , 2012/07/13 18:08 , css样式设计 , 评论(0) , 阅读(2189) , Via 本站原创 大 | 中 | 小  当一行文字超过DIV或者Table的宽度的时候,浏览器 ...

  6. 20145335郝昊《网络攻防》Exp4 Msf基础

    20145335郝昊<网络攻防>Exp4 Msf基础 实验内容 掌握metasploit的基本应用方式,掌握常用的三种攻击方式的思路. 一个主动攻击,如ms08_067; 一个针对浏览器的 ...

  7. 判断两个vector是否相等

    转载:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=26354188&id=3198604 #include < ...

  8. Linux驱动模块的Makefile分析【转】

    本文转载自:http://blog.chinaunix.net/uid-29307109-id-3993784.html 1. 获取内核版本 当设备驱动需要同时支持不同版本内核时,在编译阶段,内核模块 ...

  9. MAC BOOK Air 安装metasploit-framework

    Step 1:Xcode命令行开发工具OS X确保它已经安装了Xcode开发工具,在终端执行: xcode-select --install1Step 2:Java SDK安装Java sdk,不能用 ...

  10. POJ 1270 Following Orders(拓扑排序)题解

    Description Order is an important concept in mathematics and in computer science. For example, Zorn' ...