CodeForces 166A Rank List
来源:互联网 发布:网络协议实践加密技术 编辑:程序博客网 时间:2024/05/17 22:56
场上有点被逼急了,直接结构体加重载等于运算符。呃,简单直白,清晰明了
#include<stdio.h>#include<iostream>#include<math.h>#include<string.h>#include<iomanip>#include<stdlib.h>#include<ctype.h>#include<algorithm>#include<deque>#include<functional>#include<iterator>#include<vector>#include<list>#include<map>#include<queue>#include<set>#include<stack>#define CPY(A, B) memcpy(A, B, sizeof(A))typedef long long LL;typedef unsigned long long uLL;const int MOD = 1e9 + 7;const int INF = 0x3f3f3f3f;const LL INFF = 0x3f3f3f3f3f3f3f3fLL;const double EPS = 1e-9;const double OO = 1e20;const double PI = acos (-1.0);const int dx[] = {-1, 0, 1, 0};const int dy[] = {0, 1, 0, -1};using namespace std;struct team{ int tn,ft; bool operator ==(const team &d){ if(this->tn==d.tn&&this->ft==d.ft) return true; return false; }};team t[55];bool cmp(team a,team b){ if(a.tn==b.tn){return a.ft<b.ft;} return (a.tn>b.tn);}int main() { int n,k; scanf("%d%d",&n,&k); for(int i=0;i<n;i++){ scanf("%d%d",&t[i].tn,&t[i].ft); } sort(t,t+n,cmp);int cnt=0; for(int i=0;i<n;i++){ if(t[i]==t[k-1]){cnt++;}//就是让求同种的有多少个嘛……等于就是呗 } printf("%d\n",cnt); return 0;}
0 0
- CodeForces 166A Rank List
- Codeforces 166A Rank List(二分)
- Rank List CodeForces
- A. Rank List
- Rank List
- Rank List
- pku 2153 Rank List
- poj 2153 Rank List
- POJ2153-Rank List
- poj 2153 Rank List
- POJ 2153 Rank List
- poj 2153 Rank List
- Poj 2153 Rank List
- poj2153 Rank List
- POJ 2135 Rank List
- USTC 1122 Millionaire Rank List
- POJ2153 Rank List(Map)
- Rank List - POJ 2153 map
- CSS魔法堂:重新认识Box Model、IFC、BFC和Collapsing margins
- ArCGis Server 发布后地图服务,如何进行权限限制
- IBatis物理分页实现
- STL Vector remove()和erase()的使用
- thinkphp学习之入门一
- CodeForces 166A Rank List
- YII2.0 UrlHelper
- iOS音频编程之实时语音通信
- UVA 1625 Color Length
- TCP连接心跳机制
- Cocos2d-x 事件分发机制
- Dubbo zookeeper:Will not attempt to authenticate using SASL (unknown error)
- 音乐播放器开发过程——连载
- java导出Excel