#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<cstdlib>
#include<set>
#include<ctime>
#include<vector>
#include<cstdio>
#include<list>
#include<sstream>
//#include<regex>
using namespace std;
typedef long long ll;
int INF=;
int inf=-;
#define read(x) scanf("%d",&x);
#define fo(i,n) for(int i=0;i<(n);i++)
#define me(a) memset(a,0,sizeof(a));
#define one(x) cout<<(x)<<endl;
#define two(a,b) cout<<(a)<<" "<<(b)<<endl;
#define three(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl;
#define four(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl;
//int dir[4][2]={-1,0,1,0,0,-1,0,1};
//int dir[8][2]={-1,0,1,0,0,-1,0,1,-1,-1,1,1,1,-1,-1,1};
//int dir[4][2]={-2,0,2,0,0,-2,0,2};
int main()
{
//ios::sync_with_stdio(false);
int n,i,l=,r=,ans=,a,b;
cin>>n;
pair<int,int>p[];
for(i=;i<n;i++){
cin>>p[i].first>>p[i].second;
//p[i]=make_pair(a,b);
if(p[i].first<)
l++;
else
r++;} sort(p,p+n);
for(i=max(,l-r-);i<=min(n,l*);i++)
ans+=p[i].second; cout<<ans;
return ;
}

pair的使用的更多相关文章

  1. c++ pair 使用

    1. 包含头文件: #include <utility> 2. pair 的操作: pair<T1,T2> p; pair<T1,T2> p(v1,v2); pai ...

  2. 论Pair的重要性

    这些天我在用React和D3做图表,从已经实现的图表里复制了一些坐标轴的代码,发现坐标轴上的n个点里,只有第一个点下面能渲染出文字提示,其余点下面都无法渲染出文字. 和组里的FL一起百思不得其解好几天 ...

  3. 2016 ACM/ICPC Asia Regional Dalian Online 1010 Weak Pair dfs序+分块

    Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submissio ...

  4. 【C++】pair

    STL的pair,有两个值,可以是不同的类型. template <class T1, class T2> struct pair; 注意,pair在头文件utility中,不要inclu ...

  5. hackerrank Similar Pair

    传送门 Problem Statement You are given a tree where each node is labeled from 1 to n. How many similar ...

  6. uva12546. LCM Pair Sum

    uva12546. LCM Pair Sum One of your friends desperately needs your help. He is working with a secret ...

  7. C++标准库 -- pair

    头文件:<utility> 可访问属性: first 第一个值 second 第二个值 可访问方法: swap(pair) 和另外一个pair交换值 其他相关方法: make_pair(v ...

  8. 2016 大连网赛---Weak Pair(dfs+树状数组)

    题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 Problem Description You are given a rooted ...

  9. C++学习之Pair

    C++学习之Pair Pair类型概述 pair是一种模板类型,其中包含两个数据值,两个数据的类型可以不同,基本的定义如下: pair<int, string> a; 表示a中有两个类型, ...

随机推荐

  1. MySQL复制和集群

    一.复制配置 (A) 主从服务器相同版本的数据库 (B) 主服务器上复制使用的账户,具有相应的权限. (C) 修改主服务器的配置文件my.cnf,开启BINLOG,并设置server-id的值.重启后 ...

  2. word20161216

    object / 对象 object identifier / 对象标识符 offline / 脱机  OLE on-disk catalog / 磁盘目录 on-media catalog / 媒体 ...

  3. 修复Linux Mint损坏的依赖

    第一种: sudo apt-get install -f 第二种 sudo aptitude install -f 注: 要是某软件xxx依赖损坏了,可以这样 sudo aptitude instal ...

  4. rocketmq生产者部署的机器注意事项

    报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'warningP ...

  5. ORA-01502: index 'INDEX_NAME' or partition of such index is in unusable state

    ORA-01502: index 'INDEX_NAME' or partition of such index is in unusable state 原因: 这个错误一般是因为索引状态为UNUS ...

  6. 修改组策略,禁止用户修改IP

    运行中打开gepdit.msc,依次打开用户配置,管理模板,网络,网络连接:在右侧将“禁止访问LAN链接组建的属性”.“为管理员启用windows2000网络连接设置”设置为已启用即可令用户无法访问网 ...

  7. DL论文

    题目:Accurate Image Super-Resolution Using Very Deep Convolutional Networks(2016CVPR) 摘要:文中提出了一种高精度处理单 ...

  8. gdb 调试多线程

    基本i threads 等操作略过,只谈线程同步.异步控制: 先点到,gdb attach到主线程t1 时,所有线程都会停止,所谓同步异步效果,是指在apply continue到所有线程之后, 再切 ...

  9. Shell 获取指定行的内容

    需求: 有一个文件,根据指定的字符串,得到该字符串上两行的内容. 文件内容如下: linux-56:# cat sys.ttconnect.ini # Copyright (C) 1999, 2006 ...

  10. IE8 下 iframe 滚动条的问题

    //设置滚动条                $("iframe[name='updateFocalWork']").attr("scrolling", &qu ...