Start: Dec, 04, 2016 12:00:00
杭州师范大学第十届程序设计竞赛—正式
End: Dec, 04, 2016 17:00:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 1ms
Memory: 1704kB
In contest: 1075

#include<iostream>
#include<algorithm>
#include<string>
#include<stdio.h>
using namespace std;

struct xx{
	int key;
	int wat;
	int cof;
	string name;
}p[105];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int m;
		cin>>m>>p[i].name;
		while(m--)
		{
			string s;
			cin>>s;
			if(s[0]==s[1]&&s[1]==s[3]&&s[3]==s[4]&&s[4]==s[6]&&s[6]==s[7])p[i].key++;
			else if(s[0]>s[1]&&s[1]>s[3]&&s[3]>s[4]&&s[4]>s[6]&&s[6]>s[7])p[i].wat++;
			else p[i].cof++;
			//printf("%c%c-%c%c-%c%c\n",s[0],s[1],s[3],s[4],s[6],s[7]);
		}
	}
	int max,flag; 
	
	max=0; flag=0;
	for(int i=0;i<n;i++)
	{
		if(p[i].key>max)
		{
			max=p[i].key;
		}
	}
	cout<<"If you want to have a keyboard, you should call: ";
	for(int i=0;i<n;i++)
	{
		if(p[i].key==max)
		{
			if(flag)cout<<", ";
			cout<<p[i].name;
			flag=1;
		}
	}
	cout<<".\n";


		max=0; flag=0;
	for(int i=0;i<n;i++)
	{
		if(p[i].wat>max)
		{
			max=p[i].wat;
		}
	}
	cout<<"If you want to order a Watchdog2, you should call: ";
	for(int i=0;i<n;i++)
	{
		if(p[i].wat==max)
		{
			if(flag)cout<<", ";
			cout<<p[i].name;
			flag=1;
		}
	}
	cout<<".\n";


		max=0; flag=0;
	for(int i=0;i<n;i++)
	{
		if(p[i].cof>max)
		{
			max=p[i].cof;
		}
	}
	cout<<"If you want to have a cup of coffee with a girl, you should call: ";
	for(int i=0;i<n;i++)
	{
		if(p[i].cof==max)
		{
			if(flag)cout<<", ";
			cout<<p[i].name;
			flag=1;
		}
	}
	cout<<".\n";


	
}