H - Election Time POJ - 3664
2017-05-05 21:00
351 查看
H - Election Time
POJ - 3664 #include <iostream> #include <algorithm> #include <map> using namespace std; struct cow{ int a,b,id; }; bool cnt1(cow c1,cow c2) { return c1.a>c2.a; } bool cnt2(cow c1,cow c2) { return c1.b>c2.b; } int main() { int N,k; cow ss[50000+5]; ios::sync_with_stdio(false); cin>>N>>k; for(int i=0;i<N;i++){ cin>>ss[i].a>>ss[i].b; ss[i].id=i+1; } sort(ss,ss+N,cnt1); sort(ss,ss+k,cnt2); cout<<ss[0].id<<endl; return 0; }
相关文章推荐
- (解题报告)POJ3664---Election Time---用结构体实现两组相关联数据的排序问题
- POJ 2643 Election ——STL map
- Milking Time POJ - 3616
- poj 3664 Election Time
- Milking Time POJ - 3616
- POJ 1879 Tempus et mobilius Time and motion 队列和栈
- POJ1879 Tempus et mobilius Time and motion【置换群】
- POJ 3664 Election Time 题解
- poj 3664
- poj 3616 Milking Time dp
- POJ 3616 Milking Time——区间DP
- POJ 1879 Tempus et mobilius Time and motion 队列和栈
- POJ 3664 (qsort 快排)
- poj 3664
- POJ - 3625-Rigging the Bovine Election-(Kruskal,最小生成树)
- POJ 2643 Election
- 【poj解题】3664
- POJ 1676 What time is it? 笔记
- POJ 2643 Election(map)
- POJ_3616_Milking_Time_(动态规划)