POJ 3664
2015-02-23 10:56
253 查看
水水更健康
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; const int N=50100; struct COW{ int f,s,d; }cows ; bool cmp1(COW a,COW b){ if(a.f>b.f) return true; return false; } bool cmp2(COW a,COW b){ if(a.s>b.s) return true; return false; } int n,k; int main(){ while(scanf("%d%d",&n,&k)!=EOF){ for(int i=0;i<n;i++){ scanf("%d%d",&cows[i].f,&cows[i].s); cows[i].d=i+1; } sort(cows,cows+n,cmp1); sort(cows,cows+k,cmp2); printf("%d\n",cows[0].d); } return 0; }
相关文章推荐
- POJ 3664 排序,水题
- POJ 3664 Election Time(简单的快速排序)
- poj 3664 Election Time
- poj 3664 Election Time
- POJ 3664 Election Time
- POJ 3664 Election Time 再想想
- POJ3664——Election Time
- poj 3664
- POJ 3664----Election Time
- POJ 3664 Election Time 题解
- (解题报告)POJ3664---Election Time---用结构体实现两组相关联数据的排序问题
- 【poj解题】3664
- poj-3664
- POJ 3664
- poj 3664 Election Time
- poj 3664
- (Relax ST1.22)POJ 3664 Election Time(两次排序的巧妙应用)
- poj3664
- POJ 3664
- POJ 3664 (qsort 快排)