View Code of Problem 63

#include<bits/stdc++.h>
using namespace std;
struct st
{
	string s;
	int h, m;
};
bool cmp(st a, st b)
{
	return a.h > b.h;
}
bool cmp1(st a, st b)
{
	return a.m > b.m;
}
int main()
{
	int p, q;
	int n;
	cin >> n;
	st a[n];
	for(int i = 0; i < n; i++)
	{
		cin >> a[i].s >> a[i].h >> a[i].m;
	}
	sort(a, a + n, cmp);
	for(int i = 0; i < n; i++)
	{
		if(a[i].s == "Suxiao")
			p = i;
	}
	sort(a, a + n, cmp1);
	for(int i = 0; i < n; i++)
	{
		if(a[i].s == "Suxiao")
			q = i;
	}
	if(p < q)
		cout << "HEIGHT" << endl;
	else if(p > q)
		cout << "MONEY" << endl;
	else
		cout << "EQ" << endl;
	
	return 0;
}

Double click to view unformatted code.


Back to problem 63