Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define op ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0)
- #define endl "\n"
- /*bool momo(const pair<int,int>&p1,const pair<int,int>&p2){
- if(p1.first>p2.first) return 1;
- else if (p1.first==p2.first) return p1.second < p2.second;
- return 0;
- }*/
- int main()
- {
- op;
- int n,k;
- cin>>n>>k;
- int a=0;
- vector<pair<int,int> >v;
- for(int i=0;i<n;i++) {
- int l,m;
- cin>>l>>m;
- l=l*(-1);
- v.push_back(make_pair(l,m));
- }
- // sort(v.begin(),v.end(),momo);
- sort(v.begin(),v.end());
- for(auto u: v){
- if(u==v[k-1]) a++;
- }
- cout<<a<<endl;
- /* pair<int,int>p[52];
- for(int i=0;i<n;i++){
- cin>>p[i].first>>p[i].second;
- p[i].first*=(-1);
- }
- sort(p,p+n);
- cout<<(count(p,p+n,p[k-1]))<<endl;*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement