poj 3664 Election Time
来源:互联网 发布:逆战挂机宏数据 编辑:程序博客网 时间:2024/05/17 06:20
#include <iostream>#include <cstdio>#include <algorithm>using namespace std;struct Info{ int index, fv, sv;}info[50001];bool cmp1(Info a, Info b){ return a.fv > b.fv;}bool cmp2(Info a, Info b){ return a.sv > b.sv;}int main(){ int i, j, n, k; while (scanf("%d%d", &n, &k) != EOF){ for (i = 0; i < n; i++){ scanf("%d%d", &info[i].fv, &info[i].sv); info[i].index = i+1; } sort(info, info+n, cmp1);//第一次排序找出前三的 sort(info, info+k, cmp2);//第二次排序找出第一名 cout << info[0].index << endl; } system("pause");}
- poj 3664 Election Time
- poj 3664 Election Time
- POJ 3664 Election Time
- POJ 3664----Election Time
- POJ 3664 Election Time
- POJ 3664 Election Time 题解
- POJ 3664 Election Time 再想想
- POJ Election Time
- poj——3664——Election Time
- Election Time
- Election Time
- (Relax ST1.22)POJ 3664 Election Time(两次排序的巧妙应用)
- pku3664 Election Time
- BNUOJ 14362 Election Time
- POJ_3664 Election Time
- POJ3664 Election Time
- POJ3664——Election Time
- poj 2643 Election
- ExtJs4 笔记(1) ExtJs大比拼JQuery:Dom文档操作
- 设计模式六大原则(6):开闭原则
- JavaScript HTML对象属性用法
- Delphi移动无标题窗体...
- JAX-WS 开发webservices实例
- poj 3664 Election Time
- ZOJ 1494 Climbing Worm
- Office、VB和VBA有什么联系
- 大数相加
- PageRank计算方法及java实现
- 23种设计模式(1):单例模式
- ZOJ 1514 Fake Tickets
- Yaffs2根文件系统制作
- STK App源码解析