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

Problem_ID: D
Result: Accepted
Time: 0ms
Memory: 1700kB
In contest: 1075

#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int n,i,m,j,max1=0,max2=0,max3=0,a[101]={0},b[101]={0},c[101]={0};
	int q=0,w=0,e=0;
	char tel[100];
	char name[101][100];
	char mark1[101][100],mark2[101][100],mark3[101][100];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>m>>name[i];
		while(m--)
		{
			cin>>tel;
			if(tel[0]==tel[1]&&tel[3]==tel[4]&&tel[6]==tel[7])a[i]++;
			else if(tel[0]>tel[1]&&tel[1]>tel[3]&&tel[3]>tel[4]&&tel[4]>tel[6]&&tel[6]>tel[7])b[i]++;
			else c[i]++;
		}
		if(a[i]>max1)max1=a[i];
		if(b[i]>max2)max2=b[i];
		if(c[i]>max3)max3=c[i];
	}
	for(i=0;i<n;i++)
	{
		if(a[i]==max1){strcpy(mark1[q],name[i]);q++;}
		if(b[i]==max2){strcpy(mark2[w],name[i]);w++;}
		if(c[i]==max3){strcpy(mark3[e],name[i]);e++;}
	}
		cout<<"If you want to have a keyboard, you should call: "<<mark1[0];
		for(i=1;i<q;i++)
			cout<<", "<<mark1[i];
		cout<<"."<<endl;
		cout<<"If you want to order a Watchdog2, you should call: "<<mark2[0];
		for(i=1;i<w;i++)
			cout<<", "<<mark2[i];
		cout<<"."<<endl;
		cout<<"If you want to have a cup of coffee with a girl, you should call: "<<mark3[0];
		for(i=1;i<e;i++)
			cout<<", "<<mark3[i];
		cout<<"."<<endl;
}