Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef struct niru{
- string hero;
- int a;
- int v;
- int s;
- } niru;
- bool cmp(niru b,niru c)
- {
- if(b.a>c.a)
- return true;
- else if(b.a==c.a && b.v>c.v)
- return true;
- else if(b.a==c.a && b.v==c.v && b.s<c.s)
- return true;
- else if(b.a==c.a && b.v==c.v && b.s==c.s && b.hero>c.hero)
- return true;
- }
- int main()
- {
- niru ok;
- vector<niru> non;
- long long int n,i,j;
- cin>>n;
- for(i=0;i<n;i++){
- cin>>ok.hero>>ok.a>>ok.v>>ok.s;
- non.push_back(ok);
- }
- sort(non.begin(),non.end(),cmp);
- for(i=0;i<n;i++)
- {
- cout<<non[i].hero<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement