Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In the name of Allah.
- // We're nothing and you're everything.
- // Ya Ali!
- /*
- , \ / ,
- / \ )\__/( / \
- / \ (_\ /_) / \
- ____/_____\__\@ @/___/_____\____
- | |\../| |
- | \VV/ |
- | ------___------- |
- |__________Chuta Dragon___________|
- | /\ / \\ \ /\ |
- | / V )) V \ |
- |/ ` // ' \|
- ` V '
- */
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef pair<ll,ll>pll;
- #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL))
- #define fi first
- #define se second
- #define pb push_back
- ll const MOD=1000000007;
- ///-------------------------------------------------------------------------------------------------///
- /// KARMA IS LIKE 69,,, YOU GET WHAT YOU GIVE ///
- ///-------------------------------------------------------------------------------------------------///
- void input(ll ara[],ll n){ for(ll i=0; i<n; i++)cin>>ara[i];}
- #define eb emplace_back
- typedef struct{ll x,y;string name;}node;
- bool compare(const pair<ll,ll> &a,const pair<ll,ll> &b){
- if(a.fi==b.fi)return a.se<b.se;
- return a.first<b.first;
- }
- int main()
- {
- ll n;
- cin>>n;
- vector<pair<ll,ll>>v(n);
- for(ll i=0;i<n;i++)
- {
- cin>>v[i].fi>>v[i].se;
- }
- sort(v.begin(),v.end(),compare);
- for(ll i=0;i<n;i++)
- {
- cout<<v[i].fi<<" "<<v[i].se<<endl;
- }
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- struct nod{
- ll s,f,p;
- };
- bool com(nod a,nod b)
- {
- return a.f<b.f;
- }
Add Comment
Please, Sign In to add comment