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: 1096kB
In contest: 1075

#include<stdio.h>
int main(void){
	int n,i,m,j,max,temp;
	char name[101][21]={"\0"},b[9];
	int a[101][3]={0},x[101]={0},y[101]={0},z[101]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%s",&m,&name[i]);
		temp=m;
		while(m--){
			scanf("%s",&b);
			if(b[0]==b[1]&&b[1]==b[3]&&b[3]==b[4]&&b[4]==b[6]&&b[6]==b[7])
				a[i][0]++;
			else if(b[0]>b[1]&&b[1]>b[3]&&b[3]>b[4]&&b[4]>b[6]&&b[6]>b[7])
				a[i][1]++;
			else a[i][2]++;
		}
	}
	for(i=0;i<n;i++){
		if(i==0)
			max=a[i][0];
		if(a[i][0]>max)
			max=a[i][0];
	}
	for(j=0,i=0;i<n;i++){
		if(a[i][0]==max)
			x[j]=i,j++;
	}
	printf("If you want to have a keyboard, you should call: ");
	for(i=0;i<=(j-1);i++){
		if(i!=0)
			printf(", ");
	printf("%s",name[x[i]]);
	}
	printf(".\n");
	for(i=0;i<n;i++){
		if(i==0)
			max=a[i][1];
		if(a[i][1]>max)
			max=a[i][1];
	}
	for(j=0,i=0;i<n;i++){
		if(a[i][1]==max)
			y[j]=i,j++;
	}
	printf("If you want to order a Watchdog2, you should call: ");
	for(i=0;i<=(j-1);i++){
		if(i!=0)
			printf(", ");
	printf("%s",name[y[i]]);
	}
	printf(".\n");
	for(i=0;i<n;i++){
		if(i==0)
			max=a[i][2];
		if(a[i][2]>max)
			max=a[i][2];
	}
	for(j=0,i=0;i<n;i++){
		if(a[i][2]==max)
			z[j]=i,j++;
	}
	printf("If you want to have a cup of coffee with a girl, you should call: ");
	for(i=0;i<=(j-1);i++){
		if(i!=0)
			printf(", ");
	printf("%s",name[z[i]]);
	}
	printf(".\n");
	getchar();getchar();getchar();
	return 0;
}