label
stringlengths
1
2
index
stringlengths
1
5
code
stringlengths
87
8.24k
2
900
int main() { int i,j,k,n,num[1000],len[1000],num1[1000][26]={0},sum[26]={0},max=0,m; char writer[1000][26],letter[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%s",&num[i],writer[i]); len[i]=strlen(writer[i]); } for(i=0;i<26;i++) { for(j=0;j<n;j++) { for(k=0;k<len[j];k++) { if(writer[j][k]==letter[i]) { num1[j][i]++; } } } } for(i=0;i<26;i++) { for(j=0;j<n;j++) { sum[i]=sum[i]+num1[j][i]; } } for(i=0;i<26;i++) { if(max<sum[i]) { max=sum[i]; m=i; } } printf("%c\n%d\n",letter[m],sum[m]); for(i=0;i<n;i++) { for(j=0;j<len[i];j++) { if(writer[i][j]==letter[m]) { printf("%d\n",num[i]); } } } return 0; }
2
901
int n; struct student { char name[100]; int num; struct student *next; }; struct student *creat(void) { struct student *head; struct student *p1,*p2; int i; p1=p2=(struct student*)malloc(LEN); head=p1; for(i=0;i<n;i++) {p1=(struct student*)malloc(LEN); p2->next=p1; p2=p1; scanf("%d %s",&p1->num,p1->name); } p2->next=NULL; return(head); } void list(struct student *head) { struct student *p1,*p2,*p3,*p4; int i,j,t,a[100]={0},b[100]; char str[100]; p1=head->next; for(i=0;i<n;i++) { strcpy(str,p1->name); for(j=0;j<strlen(str);j++) //?????2?????i???? {if(str[j]>='A'&&str[j]<='Z'){a[str[j]-65]++;} //?????????a[]???? } p1=p1->next; } for(i=0;i<26;i++){b[i]=a[i];} for(i=0;i<26-1;i++) {for(j=0;j<26-1-i;j++) {if(a[j]<a[j+1]){t=a[j];a[j]=a[j+1];a[j+1]=t;} //???? } } for(i=0;i<26;i++) {if(b[i]==a[0]) {printf("%c\n%d\n",i+65,a[0]);t=i;} //b[i]?=a[0]????????,?????? } p1=head->next; //??8?????????????????????????????????????????????? for(i=0;i<n;i++) { strcpy(str,p1->name); for(j=0;j<strlen(str);j++) {if(str[j]==t+65){printf("%d\n",p1->num);} } p1=p1->next; } } int main() { struct student *p; scanf("%d",&n); p=creat(); list(p); } //???????????????????????str?????????A-Z??????a[0]-a[25]????a[]????b[],b[]?????????????????a[]? //?b[]??a[0](?????)???????????????????? //????????????????????? ????????????
2
902
struct stu{ int id; char author[26]; int length; }a[1000]; int main(){ int n,i,k,num=0,max=0; char b,c; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%s",&a[i].id,a[i].author); a[i].length=strlen(a[i].author); } for(b='A';b<='Z';b++){ num=0; for(i=0;i<n;i++){ for(k=0;k<a[i].length;k++){ if(a[i].author[k]==b){ num++; break; } } } if(num>max){ max=num; c=b; } } printf("%c\n%d\n",c,max); for(i=0;i<n;i++){ for(k=0;k<a[i].length;k++){ if(a[i].author[k]==c){ printf("%d\n",a[i].id); break; } } } return 0; }
2
903
struct stu{ int num; char id[26]; }a[999]; struct aut{ char wri; int sum; }b[26]; int main(){ int n,i,j,k,t,m=0; for(i=0;i<26;i++){ b[i].wri='A'+i; b[i].sum=0; } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i].num); scanf("%s",a[i].id); } for(j=0;j<26;j++){ for(i=0;i<n;i++){ for(k=0;k<26;k++){ if(b[j].wri==a[i].id[k]){ b[j].sum++; } } } } int max=b[0].sum; for(j=0;j<26;j++){ if(max<b[j].sum){ max=b[j].sum; m=j; } } printf("%c\n%d\n",b[m].wri,max); for(i=0;i<n;i++){ for(k=0;k<26;k++){ if(a[i].id[k]==b[m].wri) printf("%d\n",a[i].num); } } return 0; }
2
904
struct info { int nam; char aut[27]; }inf[1000]; void main() { int n,i,a[26]={0},k,max=0,sum=0; char *p; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d%s",&inf[i].nam,inf[i].aut); for(i=0;i<n;i++) { p=inf[i].aut; while(*p!='\0') { a[*p-65]++; p++; } } for(i=0;i<26;i++) max=max>a[i]?max:a[i]; for(i=0;i<26;i++) {if(a[i]==max){printf("%c\n",i+65);break;}} k=i+65; for(i=0;i<n;i++) { p=inf[i].aut; while(*p!='\0') {if(*p==k){sum++;break;}p++;} }printf("%d\n",sum); for(i=0;i<n;i++) { p=inf[i].aut; while(*p!='\0') {if(*p==k){printf("%d\n",inf[i].nam);break;} p++; } } }
2
905
int main() { int m; struct bo {int a; char au[36]; }; struct bo bo[999]; int i,j; char k,K; int sb[26]={0},sbt; int len; int n; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%d %s",&bo[i].a,bo[i].au); len=strlen(bo[i].au); for(j=0;j<len;j++){ for(k=65;k<91;k++){ if(bo[i].au[j]==k){ sb[k-65]++; } } } } K=0; sbt=0; for(i=0;i<26;i++){ if(sb[i]>sbt){ K=i+65; sbt=sb[i]; } } printf("%c\n%d\n",K,sbt); for(i=0;i<m;i++){ n=1; for(j=0;j<strlen(bo[i].au);j++){ if(K==bo[i].au[j]){ n=0; } } if(n==0){ printf("%d\n",bo[i].a); } } }
2
906
int m,n; struct student { int id; char name[100]; struct student* next; }; struct student *creat() { int i=1; struct student *head,*p1,*p2; p1=p2=(struct student*)malloc(len); scanf("%d",&m); scanf("%d %s",&p1->id,p1->name); head=NULL; for(;i<m;i++) { if(i==1) head=p1; p1=(struct student*)malloc(len); scanf("%d %s",&p1->id,p1->name); p2->next=p1; p2=p1; } p2->next=NULL; return(head); } void main() { struct student *head,*p1; int num[30]={0},max,j; char i,auth; head=creat(); for(p1=head;p1!=NULL;p1=p1->next) { for(i='A';i<='Z';i++) { for(j=0;j<strlen(p1->name);j++) if(p1->name[j]==i) num[i-'A']++; } } for(i=0,max=0;i<26;i++) { if(num[i]>max) { max=num[i]; auth=i+'A'; } } printf("%c\n",auth); printf("%d\n",max); for(p1=head;p1!=NULL;p1=p1->next) { for(j=0;j<strlen(p1->name);j++) if(p1->name[j]==auth) printf("%d\n",p1->id); } }
2
907
int main() { int i,j,k,l,m,n,g[26]={0},s[26][1000]={0}; char a[50]; scanf("%d",&n); for(m=0;m<n;m++) {for(i=0;i<50;i++) a[i]=0; scanf("%d%s",&l,a); for(i=0;i<26;i++) for(j=0;j<26;j++) if(a[i]=='A'+j) {s[j][g[j]]=l,g[j]++; break;}} m=0; for(i=0;i<26;i++) if(g[i]>m) m=g[i],k=i; printf("%c\n%d\n",'A'+k,m); for(i=0;i<m;i++) printf("%d\n",s[k][i]); }
2
908
struct m { int no,j; char a[27]; } main() { int n,k,i,j,no,ath[26]={0},m; char *t,a[26]; struct m *head,*p1,*p2,*tp,*q; scanf("%d",&n); head=(struct m*)calloc(n,L); for(i=0;i<n;i++) { scanf("%d%s",&(head+i)->no,(head+i)->a); (head+i)->j=0; for(t=(head+i)->a;*t!='\0';t++) { ath[*t-'A']++; } } for(m=ath[0],k=0,i=1;i<26;i++) { if(ath[i]>m){k=i;m=ath[i];} } printf("%c",'A'+k); m=0; for(i=0;i<n;i++) { for(t=(head+i)->a;*t!='\0';t++) if(*t==('A'+k)) { (head+i)->j=1; m++; break; } } printf("\n%d\n",m); for(i=0;i<n;i++) { if((head+i)->j==1){ printf("%d",(head+i)->no); m--; if(m>0)printf("\n");} } }
2
909
int main() { struct book { int num; char writer[26]; }bookn[999]; struct zuozhe { char w; int count; }zuozhen[26]; int n,i; scanf("%d",&n); for(i=0;i<26;i++) { zuozhen[i].w='A'+i; zuozhen[i].count=0; } int h=0; int m,j; for(i=0;i<n;i++) { scanf("%d %s",&bookn[i].num,bookn[i].writer); m=strlen(bookn[i].writer); for(j=0;j<m;j++) { h=bookn[i].writer[j]-'A'; zuozhen[h].count++; } } struct zuozhe a; a=zuozhen[0]; for(i=1;i<26;i++) { if(a.count<zuozhen[i].count) a=zuozhen[i]; } printf("%c\n",a.w); printf("%d\n",a.count); int t; for(i=0;i<n;i++) { t=strlen(bookn[i].writer); for(j=0;j<t;j++) { if(bookn[i].writer[j]==a.w) printf("%d\n",bookn[i].num); } } }
2
910
void main() { int a[1000]; char s[1000][30],ch; int b[30]={0}; int i,k; int n; int max=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d %s",&a[i],s[i]); for(i=0;i<n;i++) for(ch='A';ch<='Z';ch++) if(strchr(s[i],ch)!=NULL) b[ch-65]++; for(i=0;i<=26;i++) if(b[i]>max) { max=b[i]; k=i; } printf("%c\n%d\n",k+65,max); ch=k+65; for(i=0;i<n;i++) if(strchr(s[i],ch)!=NULL) printf("%d\n",a[i]); }
2
911
void main() { int n,i,j,sh[100],a[26]={0},b[26][100]; int max,t,m; char ch[100][40]={'\0'}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&sh[i],ch[i]); } for(i=0;i<n;i++) { for(j=0;j<40;j++) { m=ch[i][j]; if(m>64 && m<91) {a[m-65]++;b[m-65][a[m-65]]=sh[i];} }} max=0; for(i=0;i<26;i++) { if(a[i]>max) { max=a[i];t=i; } } printf("%c\n",65+t); printf("%d\n",a[t]); for(i=1;i<=a[t];i++) { printf("%d\n",b[t][i]); } }
2
912
int main() { int n; scanf("%d",&n); int a[1000]={0},b[1000]={0},c[100]={0},l=0; char s[1000][100]={0},m[26]={0},p; int i=0,j=0,k=0,t=0; for(i=0;i<n;i++) { scanf("%d %s",&a[i],s[i]); } for(i='A';i<='Z';i++) { m[j]=i; for(t=0;t<n;t++) { for(k=0;s[t][k]!='\0';k++) { if(s[t][k]==m[j]) { c[j]++; break; } } } j++; } l=0; for(i=0;i<26;i++) { if(c[i]>l) { l=c[i]; p=m[i]; } } printf("%c\n",p); printf("%d\n",l); for(i=0;i<n;i++) { k=0; for(j=0;s[i][j]!='\0';j++) { if(s[i][j]==p) { k=1; break; } } if(k==1) { printf("%d\n",a[i]); } } return 0; }
2
913
int main() { char a[1000][27],x; int m,i,j,k,b[1000],c[26]={0},max=0; cin>>m; for(i=0;i<m;i++) { cin>>b[i]>>a[i]; int len=strlen(a[i]); for(j=0;j<len;j++) c[a[i][j]-'A']++; } for(j=0;j<26;j++) if(max<c[j]) { max=c[j]; x='A'+j; } cout<<x<<endl; cout<<max<<endl; for(i=0;i<m;i++) { int len=strlen(a[i]); for(k=0;k<len;k++) if(a[i][k]==x) { cout<<b[i]<<endl; break; } } return 0; }
2
914
int a[26][1000]; int ai[26]; void func() { int k,i,len; char str[27]; scanf("%d %s",&k,str); len=strlen(str); for(i=0;i<len;i++) { a[str[i]-'A'][ai[str[i]-'A']]=k; ai[str[i]-'A']++; } } int main() { memset(a,0,sizeof(a)); memset(ai,0,sizeof(ai)); int n,i,i0,max=0; scanf("%d",&n); while(n--) func(); for(i=0;i<26;i++) { if(ai[i]>max) {max=ai[i]; i0=i;} } printf("%c\n",i0+'A'); printf("%d\n",max); for(i=0;i<ai[i0];i++) printf("%d\n",a[i0][i]); }
2
915
struct book { int id; char s[L]; int len; }b[M]; void fun(int count[L],char s[L],int len) { int i; for(i=0;i<len;i++) { int m; m=s[i]-'A'; count[m]++; } } int judge(char s[L],int len,char name) { int i,answer=0; for(i=0;i<len;i++) { if(s[i]==name) { answer=1; break; } } return answer; } int main() { int m,k,count[L]={0},i,j,max,num; char name; scanf("%d",&m); for(k=0;k<m;k++) { scanf("%d%s",&b[k].id,b[k].s); b[k].len=strlen(b[k].s); fun(count,b[k].s,b[k].len); } max=count[0]; num=0; for(j=1;j<L;j++) { if(count[j]>max) { max=count[j]; num=j; } } name=num+65; printf("%c\n",name); printf("%d\n",max); for(k=0;k<m;k++) { int answer=0; answer=judge(b[k].s,b[k].len,name); if(answer==1) printf("%d\n",b[k].id); } return 0; }
2
916
int main(int argc, char* argv[]) { int m,i,j,len,max; int id[1000],b[26]={0}; char a[100][27],name; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%d %s",&id[i],a[i]); len=strlen(a[i]); for(j=0;j<len;j++){ b[a[i][j]-'A']++; } }//?????????????????????????? max=b[0];name='A'; for(j=1;j<26;j++){ if(b[j]>max){ max=b[j]; name=j+'A'; } } printf("%c\n%d\n",name,max);//???????????????? for(i=0;i<m;i++){ len=strlen(a[i]); for(j=0;j<len;j++){ if(a[i][j]==name) {strcpy(a[i],"shuchu"); break;}//???????????? } } for(i=0;i<m;i++){ if(strcmp(a[i],"shuchu")==0) printf("%d\n",id[i]);//??????????? } return 0; }
2
917
struct Bo{ int num; char auth[30]; }a[1010]; void main(){ int n,i,j,maxnum=0,max; int zuozhe[26]={0}; char out; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d %s",&a[i].num,a[i].auth); for(j=0;j<=strlen(a[i].auth)-1;j++) zuozhe[a[i].auth[j]-'A']=zuozhe[a[i].auth[j]-'A']+1; } for(i=1;i<=25;i++) if(zuozhe[i]>zuozhe[maxnum]) maxnum=i; out='A'+maxnum; printf("%c\n",out); printf("%d\n",zuozhe[maxnum]); for(i=1;i<=n;i++) { if(strchr(a[i].auth,out)!=NULL) printf("%d\n",a[i].num); } }
2
918
int main() { struct bookinf { int code; char auth[27]; }book[999]; int i,k,m,max=0,num[26]; for (i=0;i<26;i++) num[i]=0; scanf("%d", &m); for (i=0;i<m;i++) { scanf ("%d %s", &book[i].code, book[i].auth); for (k=0;book[i].auth[k]!='\0';k++) num[book[i].auth[k]-'A']+=1; } for (i=1;i<26;i++) { if (num[i]>num[max]) max=i; } printf("%c\n%d\n", max+'A', num[max]); for (i=0;i<m;i++) { for (k=0;book[i].auth[k]!='\0';k++) { if (book[i].auth[k]==max+'A') { printf("%d\n", book[i].code); break; } } } return 0; }
2
919
struct { int a; char b[26]; }shu[1000]; int main() { int s[27]; int n,i,j,o,max,t=1,x; scanf("%d",&n); for (i=0;i<n;i++) scanf("%d %s",&shu[i].a,shu[i].b); for (i=1;i<=26;i++) s[i]=0; for (i=0;i<n;i++) for (j=0;j<strlen(shu[i].b);j++) { o=shu[i].b[j]-64; s[o]++; } max=0; for(i=1;i<=26;i++) if (max<s[i]) {max=s[i];t=i;} printf("%c\n",t+64); printf("%d\n",max); for (i=0;i<n;i++) { x=strlen(shu[i].b); for (j=0;j<x;j++) if (shu[i].b[j]==t+64) printf("%d\n",shu[i].a); } return 0; }
2
920
int main() { int m, a, i, j, k, n, s[26][999] = {0}, p[26] = {0}; char b[26], c; cin >> m; for(i = 0; i < m; i++) { cin >> j; cin >> b; n = strlen(b); for(k = 0; k < n; k++) { a = b[k] - 'A'; s[a][p[a]] = j; p[a] ++; } } j = 0; for(i = 1; i < 26; i++) { if(p[j] < p[i]) j = i; } c = 'A' + j; cout << c << endl << p[j] << endl; for(i = 0; ; i++) { if(s[j][i] != 0) cout << s[j][i] << endl; else break; } return 0; }
2
921
int main() { int *p; char q[1000][30]; int shu[26]={0}; char zm[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int n,i,j,k; int len,max=0; scanf("%d",&n); p=(int*)malloc(sizeof(int)*n); for(i=0;i<n;i++) { len=0; scanf("%d %s", &p[i],q[i]); len=strlen(q[i]); for(j=0;j<len;j++) { for(k=0;k<26;k++) { if(q[i][j]==zm[k]) shu[k]++; } } } for(i=0;i<26;i++) { if(shu[i]>max) { max=shu[i]; k=i; } } printf("%c\n%d\n",zm[k],shu[k]); for(i=0;i<n;i++) { len=strlen(q[i]); for(j=0;j<len;j++) { if(q[i][j]==zm[k]) printf("%d\n",p[i]); } } free(p); return 0; }
2
922
int main() { int m; cin>>m; int num[1001]; char name[1001][27]; for(int i=0;i<m;++i) { cin>>num[i]; cin.get(); cin.getline(name[i],27); } int count[100];memset(count, 0, sizeof(count)); int record[27][1000]; int start=0; int i,j; char call; for( i=0;i<m;i++) { for( j=0;j<strlen(name[i]);j++) { count[name[i][j]]++; //call=name[i][j]-'A'; //record[call][start++]=num[i]; } } int max=0,k=0; char t; for(char w = 'A';w<='Z';w++) { if(count[(int)w]>max) { max=count[(int)w]; t=w; } } cout<<t<<endl; cout<<max<<endl; for( i=0;i<m;i++) { for( j=0;j<strlen(name[i]);j++) { if(name[i][j]==t) {cout<<num[i]<<endl; continue; } } } return 0; }
2
923
struct book{ int num; char author[26]; }; char max(int *p); int main() { int m,b,i,*p; struct book shu[999]; char c; int writer[26]; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%d%s",&shu[i].num,shu[i].author); } for(c='A',writer[c-'A']=0;c<='Z';c++){ writer[c-'A']=0; for(i=0;i<m;i++){ for(b=0;shu[i].author[b]!='\0';b++){ if(c==shu[i].author[b]){ writer[c-'A']++; } } } } p=writer; printf("%c\n%d\n",max(p),writer[max(p)-'A']); for(i=0;i<m;i++){ for(b=0;shu[i].author[b]!='\0';b++){ if(max(p)==shu[i].author[b]){ printf("%d\n",shu[i].num); } } } return 0; } char max(int *p) { int i; char max; for(i=0,max='A';i<26;i++){ if(*(p+i)>*(p+max-'A')){ max=i+'A'; } } return max; }
2
924
int main(int argc, char* argv[]) { int n,i,j,m,b=0,max; int let[26]={0}; char a; struct student{ int num; char name[26]; }book[999]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%s",&book[i].num,&book[i].name); } for(i=0;i<n;i++){ m=strlen(book[i].name); for(j=0;j<m;j++){ let[book[i].name[j]-'A']++; } } max=let[0]; for(i=0;i<25;i++){ if(let[i]>max){ max=let[i]; b=i; } } a=b+'A'; printf("%c\n%d\n",a,max); for(i=0;i<n;i++){ m=strlen(book[i].name); for(j=0;j<m;j++){ if(book[i].name[j]==a){ printf("%d\n",book[i].num); } } } return 0; }
2
925
void main() { struct book { char num[20]; char ren[30]; struct book *next; }; int n; int a[26]={0}; struct book *head,*p1,*p2; int i,j; char tem; char b[100][30]; p1=(struct book *)malloc(L); head=p1; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s%s",p1->num,p1->ren); p2=p1; p1=(struct book *)malloc(L); p2->next=p1; } p1=head; for(i=0;i<n;i++) { for(j=0;j<strlen(p1->ren);j++) { int t=p1->ren[j]-'A'; a[t]++; } p1=p1->next; } int max=0; for(i=0;i<26;i++) { if(a[i]>max) { max=a[i]; tem='A'+i; } } printf("%c\n",tem); p1=head; int u=0; for(i=0;i<n;i++) { for(j=0;j<strlen(p1->ren);j++) { if(p1->ren[j]==tem) { strcpy(b[u],p1->num); u++; } } p1=p1->next; } printf("%d\n",u); for(i=0;i<u;i++) { printf("%s\n",b[i]); } }
2
926
int main() { int n; scanf("%d",&n); struct book{ int booknumber; char writer[27]; }book[999]; int i; for(i=0;i<n;i++) { scanf("%d %s",&book[i].booknumber,book[i].writer); } int writerbookquantity[26]; for(i=0;i<26;i++)writerbookquantity[i]=0; int j,len,x; for(i=0;i<n;i++) { len=strlen(book[i].writer); for(j=0;j<len;j++) { x= book[i].writer[j]-'A'; writerbookquantity[x]++; } } int maxwriter=0,maxquantity=0; for(i=0;i<26;i++) { if(writerbookquantity[i]>maxquantity) { maxquantity=writerbookquantity[i]; maxwriter=i; } } printf("%c\n%d\n",(char)(maxwriter+'A'),writerbookquantity[maxwriter]); for(i=0;i<n;i++) { len=strlen(book[i].writer); for(j=0;j<len;j++) { if((int)book[i].writer[j]==maxwriter+'A') printf("%d\n",book[i].booknumber); } } return 0; }
2
927
int n; struct stu {int num; char name[27]; struct stu *next; }; struct stu *creat() {int i=0; struct stu *head, *p1,*p2; head=p1=p2=(struct stu*)malloc(sizeof(struct stu)); scanf("%d %s", &p2->num,p2->name); while(i<n-1) {i++; p2=(struct stu*)malloc(sizeof(struct stu)); scanf("%d %s", &p2->num,p2->name); p1->next=p2; p1=p2;} return head;} void main() {struct stu *p,*head; int k,u,max=0,maxnum; int a[26]={0}; scanf("%d",&n); head=p=creat(); for (k=0;k<n;k++) {for (u=0;p->name[u]!='\0';u++) a[p->name[u]-'A']++; p=p->next; } for(k=0;k<26;k++) if(a[k]>max){max=a[k];maxnum=k;} printf("%c\n%d\n",maxnum+'A',max); p=head; for(k=0;k<n;k++){ for(u=0;p->name[u]!='\0';u++) if(p->name[u]==maxnum+'A'){printf("%d\n",p->num);break;} p=p->next; }}
2
928
int main() { int A[100],C[26]={0},n,i,j,m,a=0,b; char B[100][100],c; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d%s",&A[i],B[i]); } for (i=0;i<n;i++) { for (j=0;j<strlen(B[i]);j++) { m=B[i][j]; C[m-65]++; } } for (i=0;i<26;i++) { if (a<C[i]) { a=C[i]; b=i; } } printf("%c\n",b+65); printf("%d\n",a); c=b+65; for (i=0;i<n;i++) { for (j=0;j<strlen(B[i]);j++) { if (B[i][j]==c) { printf("%d\n",A[i]); } } } return 0; }
2
929
void main() { struct x { char num[26]; int y; }q[1000],x0; int n,i,j,c[100]={0},m=0,f; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d %s",&q[i].y,&q[i].num);} for(i=0;i<n;i++) for(j=0;q[i].num[j]!='\0';j++) m=(int)q[i].num[j],c[m]=c[m]+1; for(m=0;m<100;m++) if(c[m]>c[0]) f=m,c[0]=c[m]; printf("%c\n%d\n",(char)f,c[f]); for(i=0;i<n;i++) for(j=0;q[i].num[j]!='\0';j++) if(q[i].num[j]==(char)f) printf("%d\n",q[i].y); }
2
930
int m; struct book { char num[20]; char aut[20]; struct book*next; }; struct book*creat() { struct book*head,*p1,*p2; int i; p1=(struct book*)malloc(LEN); scanf("%s %s",p1->num,p1->aut); p1->next=NULL; head=p1; p2=p1; for(i=1;i<m;i++) { p1=(struct book*)malloc(LEN); scanf("%s %s",p1->num,p1->aut); p1->next=NULL; p2->next=p1; p2=p1; } return(head); } void print(struct book*head) { struct book*p; int*tem,i,k; char*q,max,c; tem=(int*)malloc(30*sizeof(int)); for(i=0;i<30;i++) { *(tem+i)=0; } for(p=head;p;p=p->next) { q=p->aut; for(i=0;*(q+i)!='\0';i++) { c=*(q+i)-'A'; *(tem+c)+=1; } } max=0; k=0; for(i=0;i<26;i++) { if(*(tem+i)>max) { max=*(tem+i); k=i; } } c=k+'A'; printf("%c\n",c); printf("%d\n",max); for(p=head;p;p=p->next) { for(q=p->aut,i=0;*(q+i)!='\0';i++) { if(*(q+i)==c) { break; } } if(*(q+i)!='\0') { printf("%s\n",p->num); } } } int main() { struct book*head; scanf("%d",&m); head=creat(); print(head); }
2
931
struct book { int number; char author[26]; struct book *next; }; int m,i; struct book *creat(void) { struct book *head,*p1,*p2; int i=1; p1=p2=(struct book *)malloc(sizeof(struct book)); head=p1; for(i=1;i<m;i++) { scanf("%d %s",&p1->number,p1->author); p1=(struct book *)malloc(sizeof(struct book)); p2->next=p1; p2=p1; } scanf("%d %s",&p1->number,p1->author); p2->next=p1; p1->next=NULL; return head; } main() { struct book *head,*p; int j,a[26]={0},max; scanf("%d",&m); head=creat(); for(p=head;p!=NULL;p=p->next) for(i=0;i<strlen(p->author);i++) switch(p->author[i]) { case 'A': a[0]++;break; case 'B': a[1]++;break; case 'C': a[2]++;break; case 'D': a[3]++;break; case 'E': a[4]++;break; case 'F': a[5]++;break; case 'G': a[6]++;break; case 'H': a[7]++;break; case 'I': a[8]++;break; case 'J': a[9]++;break; case 'K': a[10]++;break; case 'L': a[11]++;break; case 'M': a[12]++;break; case 'N': a[13]++;break; case 'O': a[14]++;break; case 'P': a[15]++;break; case 'Q': a[16]++;break; case 'R': a[17]++;break; case 'S': a[18]++;break; case 'T': a[19]++;break; case 'U': a[20]++;break; case 'V': a[21]++;break; case 'W': a[22]++;break; case 'X': a[23]++;break; case 'Y': a[24]++;break; case 'Z': a[25]++;break; } max=a[0]; for(i=0;i<26;i++) if(a[i]>max)max=a[i]; for(i=0;i<26;i++) if(a[i]==max) {printf("%c\n",65+i);break;} printf("%d\n",max); for(p=head;p!=NULL;p=p->next) for(j=0;j<strlen(p->author);j++) if(p->author[j]==65+i)printf("%d\n",p->number); }
2
932
struct student { int num; char str[27]; struct student *next; }; int n; struct student *creat(int m) { struct student *head; struct student *p1,*p2; p1=p2=(struct student*)malloc(LEN); scanf("%ld %s",&p1->num,p1->str); n=1; head=0; while(n<m) { if(n==1)head=p1; else p2->next=p1; p2=p1; p1=(struct student *)malloc(LEN); scanf("%d %s",&p1->num,p1->str); n=n+1; } p2->next=p1; p1->next=0; return(head); } void main() { struct student *head,*p,stu; int m,i,t,max,y=1,a[100]={0},sum[27]={0}; char x,c; scanf("%d",&m); head=creat(m); p=head; for(;p!=0;p=p->next) { for(t=0;t<strlen(p->str);t++) { c=p->str[t]; sum[c-'A'+1]++; } } max=sum[1]; x=1; for(i=1;i<=26;i++) if(sum[i]>max){max=sum[i];x=i;} for(p=head;p!=0;p=p->next) { for(t=0;t<=strlen(p->str);t++) if(p->str[t]==x+'A'-1) {a[y]=p->num;y++;t=strlen(p->str)+1;} } printf("%c\n%d\n",x+64,max); for(y=1;y<=max;y++) printf("%d\n",a[y]); }
2
933
void main() { int b[1000],d[1000],e[30]={0}; int i,j,k,n,t=0,max; char c[1000][10]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&b[i],c[i]); d[i]=(int)strlen(c[i]); } for(i=0;i<n;i++) for(j=0;j<d[i];j++) for(k=0;k<26;k++) if(c[i][j]==k+65)e[k]=e[k]+1; max=e[0]; for(k=1;k<26;k++) { if(e[k]>max) { t=k; max=e[k]; } } printf("%c\n",t+65); printf("%d\n",e[t]); for(i=0;i<n;i++) for(j=0;j<d[i];j++) if(c[i][j]==t+65)printf("%d\n",b[i]); }
2
934
struct book { int num; char writer[26]; }book[1000]; void main() { int n,i,j,e,max=0; scanf("%d",&n); char da,c; int temp[27]={0}; for(i=0;i<n;i++) { scanf("%d%s",&book[i].num,book[i].writer); } for(i=0;i<n;i++) { for(da='A';da<='Z';da++) { for(j=0;j<26;j++) { if(book[i].writer[j]==da) temp[da-'A'+0]++; } } } for(j=0;j<26;j++) { if(temp[j]>max) { max=temp[j]; } } for(j=0;j<26;j++) { if(temp[j]==max) { c=j+65; printf("%c\n%d\n",c,temp[j]); } } for(i=0;i<n;i++){ for(j=0;j<26;j++){ if(book[i].writer[j]==c) printf("%d\n",book[i].num); } } }
2
935
struct shu { int haoma; char b[26]; struct shu *next; }; int main() { int n,i,a[26],c[26][100],max; int *s,(*q)[100]; s=a; q=c; char m[26]; struct shu *head,*p; for(i=0;i<26;i++) a[i]=0; scanf("%d",&n); head=(struct shu *)malloc(n*sizeof(shu)); p=head; for(i=0;i<n-1;i++) { (p+i)->next=p+i+1; } (p+n-1)->next=0; p=head; for(;p!=0;) { scanf("%d %s",&p->haoma,p->b); strcpy(m,p->b); for(i=0;*(m+i)!='\0';i++) { *(*(q+*(m+i)-65)+*(s+*(m+i)-65))=p->haoma; //c[m[i]-65][a[m[i]-65]]=p->haoma; *(s+*(m+i)-65)+=1; //a[m[i]-65]++; } p=p->next; } max=0; for(i=0;i<26;i++) if(*(a+i)>max) { max=*(a+i); n=i; } printf("%c\n",n+65); printf("%d\n",*(a+n)); for(i=0;i<*(a+n);i++) { printf("%d\n",*(*(q+n)+i)); } }
2
936
int main() { int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0; char w; cin >> m; for(int i = 1; i <= m; i++) { cin >> b; book[i][26] = b; cin.get(); while((w = cin.get()) != '\n') { writer[w - 'A']++; book[i][w - 'A'] = 1; } } for(int i = 1; i < 26; i++) if(writer[max] < writer[i]) max = i; cout << (char) (max + 'A') << endl; cout << writer[max] << endl; for(int i = 1; i <= m; i++) if(book[i][max]) cout << book[i][26] << endl; return 0; }
2
937
struct xinxi { int sh; char zz[20]; }a[1000]; void main() { int n,i,l,j,b[26]={0},m=0,k=0; char c; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d%s",&a[i].sh,a[i].zz); for(i=0;i<n;i++) { l=strlen(a[i].zz); for(j=0;j<l;j++) b[a[i].zz[j]-65]++; } for(i=0;i<26;i++) if(b[i]>m) {m=b[i];k=i;} c=k+65; printf("%c\n%d\n",c,m); for(i=0;i<n;i++) { l=strlen(a[i].zz); for(j=0;j<l;j++) if(a[i].zz[j]==c) printf("%d\n",a[i].sh); } }
2
938
int main() { struct writer { int num; char name[20]; struct writer * next; }; int i,j,k,l,m,z[26]={0},max,n; struct writer *p1,*p2,*p,*head; scanf("%d",&n); head=p1=p2=(struct writer *)malloc(sizeof(struct writer)); scanf("%d %s",&p1->num,&p1->name); for (i=0;i<n-1;i++) { p1=(struct writer *)malloc(sizeof(struct writer)); scanf("%d %s",&p1->num,&p1->name); p2->next=p1; p2=p1; } p=head; for (i=0;i<26;i++) /*26?????????????????*/ { p=head; for (j=0;j<n;j++) { for (k=0;k<20;k++) { if (p->name[k]==(char)(i+65)) { z[i]++; } } p=p->next; } } max=z[0]; j=0; for (i=0;i<26;i++) { if (max<z[i]) { max=z[i]; j=i; /*????????*/ } } printf("%c\n%d\n",65+j,max); /*??????????*/ p=head; for (i=0;i<n;i++) /*???????*/ { for (k=0;k<20;k++) { if (p->name[k]==(char)(65+j)) { printf("%d\n",p->num); break; } } p=p->next; } }
2
939
struct book {int num; char str[200]; }bk[1000]; int main() { int m,i,l,k,p=0,max,maxl; int a[200][1000]; int b[200]; scanf("%d",&m); for(i=0;i<m;i++) scanf("%d%s",&bk[i].num,bk[i].str); for(l=0;l<26;l++) { for(i=0;i<m;i++) { for(k=0;bk[i].str[k]!='\0';k++) { if((bk[i].str[k])==l+65) {a[l][p]=bk[i].num; p++;} } } b[l]=p; p=0; } max=b[0];maxl=0; for(l=0;l<26;l++) { if(b[l]>max) {max=b[l]; maxl=l;} } printf("%c\n",maxl+65); printf("%d\n",max); for(i=0;i<max;i++) printf("%d\n",a[maxl][i]); return 0; }
2
940
void main() { struct book { int num; char wri[26]; struct book *next; }; int n,m,i; scanf("%d",&m); struct book *head,*p1,*p2; n=0; p1=p2=(struct book *)malloc(L); scanf("%d%s",&p1->num,p1->wri); head=NULL; for(i=0;i<m-1;i++) { n=n+1; if(n==1)head=p1; else p2->next=p1; p2=p1; p1=(struct book *)malloc(L); scanf("%d%s",&p1->num,p1->wri); } p2->next=p1; p2=p1; p2->next=NULL; int a[26]={0},b,j,k,max1=0,max2; struct book *g; g=head; do { for(i=0;i<26;i++) { if(g->wri[i]!='\0') { b=g->wri[i]; a[b-65]=a[b-65]+1; } } g=g->next; }while(g!=NULL); for(i=0;i<26;i++) { if(max1<a[i]) { max1=a[i]; max2=i; } } max2=max2+65; printf("%c\n%d",max2,max1); g=head; do { for(i=0;i<26;i++) { if(g->wri[i]==max2) { printf("\n%d",g->num); break; } } g=g->next; }while(g!=NULL); }
2
941
struct book { int num; char edt[27]; }; struct total //?????????????? { char name; int amount; }; int main() { int m,i,j,k; struct book bk[1000]; struct total to[27]; scanf("%d",&m); for(i=0;i<m;i++) scanf("%d %s",&bk[i].num,bk[i].edt); for(i=0;i<26;i++) { to[i].name='A'+i;//????26??? to[i].amount=0; } //??????????? for(i=0;i<m;i++) { for(j=0;j<strlen(bk[i].edt);j++) { for(k=0;k<26;k++) { if(bk[i].edt[j]==to[k].name) to[k].amount ++; } } } //???????????????to[k]?? for(i=k=0;i<26;i++) { if(to[i].amount>to[k].amount ) k=i; } printf("%c\n%d\n",to[k].name ,to[k].amount ); //?????????? for(i=0;i<m;i++) { for(j=0;j<strlen(bk[i].edt);j++) if(bk[i].edt[j]==to[k].name) printf("%d\n",bk[i].num); } return 0; }
2
942
int main() { int n,i,j,k,w=0; int maxzm,maxbk=0; char c1; int zimu[26]={0}; int lm[100]; struct{ int num; char a[100]; }book[1000]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d %s",&book[i].num,book[i].a); for(i=0;i<n;i++) { for(j=0;book[i].a[j];j++) { for(k=65;k<91;k++) { if(book[i].a[j]==k) zimu[k-65]++; } } } for(i=0;i<26;i++) { if(zimu[i]>maxbk) { maxbk=zimu[i]; maxzm=i; } } c1=maxzm+65; printf("%c\n",c1); printf("%d\n",maxbk); for(i=0;i<n;i++) { for(j=0;book[i].a[j];j++) { if(book[i].a[j]==c1) { lm[w]=book[i].num; w++; continue; } } } for(i=0;i<w;i++) printf("%d\n",lm[i]); return 0; }
2
943
struct book { int ID; char author[30]; struct book *next; }; int n,max=0; char c; int num[26]={0}; struct book *create() { struct book *head,*p1,*p2; p1=(struct book*)malloc(LEN); scanf("%d %s",&p1->ID,p1->author); head=p1; p2=p1; p1->next=NULL; int i=1; do { if(i==n)break; p1=(struct book*)malloc(LEN); scanf("%d %s",&p1->ID,p1->author); p2->next=p1; p2=p1; p1->next=NULL; i++; }while(1); return(head); } void seek(struct book *head) { struct book *p; char *s; p=head; while(p) { for(s=p->author;*s!='\0';s++) { int temp; temp=*s-'A'; (*(num+temp))++; } p=p->next; } } void find(struct book *head) { struct book *p; char *s; p=head; while(p) { for(s=p->author;*s!='\0';s++) { if(*s==c)break; } if(*s!='\0')printf("%d\n",p->ID); p=p->next; } } int main() { struct book *head; int i; scanf("%d",&n); head=create(); seek(head); for(i=0;i<26;i++) { if(*(num+i)>max)max=*(num+i); } for(i=0;i<26;i++) { if(*(num+i)==max)break; } printf("%c\n%d\n",'A'+i,max); c='A'+i; find(head); }
2
944
int ismax(int l[],int a) { int i; for(i=0;i<26;i++) { if(l[i]>l[a]) return(0); } return(1); } void main() { int i,j,k,n,p,l[26]={0}; struct shu { int num; char auth[100]; } book[999]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&book[i].num,book[i].auth); } for(i=0;i<26;i++) { for(j=0;j<n;j++) { for(k=0;k<100;k++) { if(book[j].auth[k]==i+65) l[i]++; } } } for(i=0;i<26;i++) { if(ismax(l,i)==1) { printf("%c\n%d\n",i+65,l[i]); p=i; } } for(i=0;i<n;i++) { for(j=0;j<100;j++) { if(book[i].auth[j]==p+65) printf("%d\n",book[i].num); } } }
2
945
struct book { int num; char author[27]; struct book *next; }; void main() { int m,i,j,k,a[26],sum=0; for(j=0;j<26;j++) a[j]=0; char aut; scanf("%d",&m); struct book *head,*pb1,*pb2; head=NULL; for(i=0;i<m;i++) { pb1=(struct book*)malloc(sizeof(struct book)); scanf("%d %s",&pb1->num,pb1->author); for(j=0;pb1->author[j]!='\0';j++) { k=pb1->author[j]-'A'; a[k]+=1; } if(head==NULL) {head=pb1;pb2=pb1;pb2->next=NULL;} else { pb2->next=pb1;pb2=pb1;pb2->next=NULL; } } for(j=0;j<26;j++) {if(a[j]>sum) {sum=a[j],k=j;} } aut=(char)('A'+k); printf("%c\n",aut); printf("%d\n",sum); pb1=head; while(pb1) { for(j=0;pb1->author[j]!='\0';j++) if(pb1->author[j]==aut) printf("%d\n",pb1->num); pb1=pb1->next; } }
2
946
int main() { int i,j,n,k,c,big=0; int num[30]={0},a[1000]; char name[1000][20]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&a[i],name[i]); } for(k=0;k<26;k++) { for(i=0;i<n;i++) { for(j=0;j<strlen(name[i]);j++) { if(name[i][j]==k+'A') num[k]=num[k]+1; } } } for(i=0;i<26;i++) { if(big<num[i]) {big=num[i]; c=i+'A'; } } printf("%c\n",c); printf("%d\n",big); /* for(i=0;i<n;i++) { if(num[i]==big) printf("%d\n",big); }*/ for(i=0;i<n;i++) { for(j=0;j<strlen(name[i]);j++) { if(name[i][j]==c) printf("%d\n",a[i]); } } return 0; }
2
947
struct book { int num; char writer[27]; struct book *next; }; int n; int time[26]={0},max,k; struct book *create(int m) { struct book *head; struct book *p1,*p2; n=0; p1=p2=(struct book *)malloc(LEN); head=NULL; while(n<m) { scanf("%d %s",&p1->num,p1->writer); n=n+1; if(n==1) head=p1; else p2->next=p1; p2=p1; p1=(struct book *)malloc(LEN); } p2->next=NULL; return (head); } void search(struct book *head) { int i; struct book *p; p=head; if(head!=NULL) { do { for(i=0;(p->writer)[i]!='\0';i++) time[(p->writer)[i]-'A']++; p=p->next; } while(p!=NULL); } } void pr(struct book *head) { int i; struct book *p; p=head; if(head!=NULL) { do { for(i=0;(p->writer)[i]!='\0';i++) { if((p->writer)[i]=='A'+k) printf("%d\n",p->num); } head = p; p=p->next; free(head); } while(p!=NULL); } } void main() { int m,i; scanf("%d",&m); struct book *head; head=create(m); search(head); max=time[0]; k=0; for(i=1;i<26;i++) { if(time[i]>max) { max=time[i]; k=i; } } printf("%c\n%d\n",'A'+k,max); pr(head); }
2
948
struct book { int H; char writer[26]; }b[max]; int main() { int m,i,j,k,sum[26]={0},t,Max,g; char y; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d %s",&b[i].H,b[i].writer); t=strlen(b[i].writer); for(j=0;j<t;j++) { k=b[i].writer[j]-65; sum[k]++; } } Max=sum[0]; for(i=0;i<26;i++) { if(sum[i]>Max) Max=sum[i]; } for(i=0;i<26;i++) { if(sum[i]==Max) { y=i+65; printf("%c\n%d\n",y,Max); } } for(i=0;i<m;i++) { g=0; t=strlen(b[i].writer); for(j=0;j<t;j++) { if(b[i].writer[j]==y) { g++; break; } } if(g!=0) printf("%d\n",b[i].H); } return 0; }
2
949
struct book { int num; char aut[27]; struct book *next; }; int n; struct book *creat(int amount) { struct book *head; struct book *p1,*p2; n=0; p1=(struct book *)malloc(sizeof(struct book)); p2=p1; scanf("%d %s",&p1->num,p1->aut); while(n<amount-1) { n=n+1; if(n==1)head=p1; else p2->next=p1; p2=p1; p1=(struct book *)malloc(sizeof(struct book)); scanf("%d %s",&p1->num,p1->aut); } p2->next=p1,p1->next=NULL; return(head); } int main() { int amount,i,a[26]={0},max,maxn; struct book *p,*headp; char *auth,name[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','R','S','T','U','V','W','X','Y','Z'}; scanf("%d",&amount); p=creat(amount); headp=p; for(p=headp;p!=NULL;p=p->next) { for(auth=p->aut;*auth!='\0';auth++) { for(i=0;i<26;i++) { if(name[i]==*auth)break; } a[i]=a[i]+1; } } for(i=0,max=a[0],maxn=0;i<26;i++) { if(a[i]>max)max=a[i],maxn=i; } printf("%c\n%d\n",name[maxn],max); for(p=headp;p!=NULL;p=p->next) { for(auth=p->aut;*auth!='\0';auth++) { if(*auth==name[maxn])break; } if(*auth=='\0'); else printf("%d\n",p->num); } }
2
950
struct book {int num; char a[27]; int y; struct book *next; }; void main() {int n,i,j,k,m=0,num,max; struct book *p1,*p2,*p,*head; int c[26]={0}; scanf("%d",&n); head=p1=p2=Z; for(i=0;i<n;i++) {p2->next=p1; p2=p1; scanf("%d%s",&p2->num,p2->a); num=strlen(p2->a); for(j=0;j<num;j++) c[*(p2->a+j)-65]++; p1=Z; } p2->next=0; max=0; for(i=0;i<26;i++) if(c[i]>c[max]) max=i; max=max+65; p=head; for(i=0;i<n;i++) {num=strlen(p->a); for(j=0;j<num;j++) if(*(p->a+j)==max) break; if(j==num) p->y=0; else {p->y=1;m++;} p=p->next; } p=head; printf("%c\n%d\n",max,m); for(i=0;i<n;i++) {if(p->y==1) printf("%d\n",p->num); p=p->next; } }
2
951
int main() { int m; char a[1000][10]={0}; //???? char b[1000][30]; //???? int len[1000]={0}; //????????? int c[150]={0}; //??????? int max=0; //?????????????? int i,j,k,p,q,r,s; //???? scanf("%d", &m); for(i=0;i<m;i++) { scanf("%s %s", a[i], b[i]); len[i]=strlen(b[i]); //printf("%d\n", len[i]); for(j=0;j<len[i];j++) { //printf("%d\n", b[i][j]); for(k=65;k<=90;k++) { if(b[i][j]==k) c[k]++; } } } for(p=65;p<=90;p++) { if(c[p]>max) max=c[p]; } for(q=65;q<=90;q++) { if(c[q]==max) { printf("%c\n%d\n", q, max); for(r=0;r<m;r++) { for(s=0;s<len[r];s++) { if(b[r][s]==q) printf("%s\n", a[r]); } } } } return 0; }
2
952
int main() { int m,sum[27]={0},max=0,author; cin>>m; char str[1000][4],name[1000][27]; for(int i=0;i<m;i++) cin>>str[i]>>name[i]; for(int i=0;i<m;i++){ for(int j=0;j<strlen(name[i]);j++) sum[name[i][j]-'A']++; } for(int i=0;i<26;i++){ if(max<sum[i]){ max=sum[i]; author=i; } } cout<<(char)('A'+author)<<endl; cout<<max<<endl; for(int i=0;i<m;i++){ for(int j=0;j<strlen(name[i]);j++){ if(name[i][j]-'A'==author) cout<<str[i]<<endl; } } return 0; }
2
953
char name[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int main() { int n,t,i,j; int count[26],max=0; for(i=0;i<26;i++) count[i]=0; struct book { int num; char man[26]; } book[999]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%s",&book[i].num,book[i].man); for(j=0;book[i].man[j];j++) { if(book[i].man[j]=='A') count[0]++; else if(book[i].man[j]=='B') count[1]++; else if(book[i].man[j]=='C') count[2]++; else if(book[i].man[j]=='D') count[3]++; else if(book[i].man[j]=='E') count[4]++; else if(book[i].man[j]=='F') count[5]++; else if(book[i].man[j]=='G') count[6]++; else if(book[i].man[j]=='H') count[7]++; else if(book[i].man[j]=='I') count[8]++; else if(book[i].man[j]=='J') count[9]++; else if(book[i].man[j]=='K') count[10]++; else if(book[i].man[j]=='L') count[11]++; else if(book[i].man[j]=='M') count[12]++; else if(book[i].man[j]=='N') count[13]++; else if(book[i].man[j]=='O') count[14]++; else if(book[i].man[j]=='P') count[15]++; else if(book[i].man[j]=='Q') count[16]++; else if(book[i].man[j]=='R') count[17]++; else if(book[i].man[j]=='S') count[18]++; else if(book[i].man[j]=='T') count[19]++; else if(book[i].man[j]=='U') count[20]++; else if(book[i].man[j]=='V') count[21]++; else if(book[i].man[j]=='W') count[22]++; else if(book[i].man[j]=='X') count[23]++; else if(book[i].man[j]=='Y') count[24]++; else if(book[i].man[j]=='Z') count[25]++; } } for(i=0;i<26;i++) { if(count[i]>max) { max=count[i]; t=i; } } printf("%c\n%d\n",name[t],max); for(i=0;i<n;i++) { for(j=0;book[i].man[j];j++) { if(book[i].man[j]==name[t]) printf("%d\n",book[i].num); } } return 0; }
2
954
struct jisuan{ int num; char name[26]; }book[1000]; int main() { int i,j,m,n,k,e; int count[26]={0},author[26]; scanf("%d",&m); for(i=0;i<26;i++) author[i]=65+i; for(i=0;i<m;i++){ scanf("%d",&book[i].num); gets(book[i].name); } for(i='A';i<='Z';i++){ for(j=0;j<m;j++){ n=strlen(book[j].name); for(k=0;k<n;k++){ if(i==book[j].name[k]) count[i-65]++; } } } for(i=0;i<25;i++){ if(count[i]>count[i+1]){ e=count[i]; count[i]=count[i+1]; count[i+1]=e; e=author[i]; author[i]=author[i+1]; author[i+1]=e; } } printf("%c\n%d\n",author[25],count[25]); for(i=0;i<m;i++){ n=strlen(book[i].name); for(k=0;k<n;k++){ if(book[i].name[k]==author[25]) printf("%d\n",book[i].num); } } return 0; }
2
955
struct tushu { int num; char name[26]; struct tushu *next; }; struct tushu *creat(int n) { struct tushu *head,*p1,*p2; p1=p2=(struct tushu *)malloc(LEN); scanf("%d%s",&p1->num,p1->name); head=p1; int i; for(i=1;i<n;i++) { p1=(struct tushu *)malloc(LEN); scanf("%d%s",&p1->num,p1->name); p2->next=p1; p2=p1; } p2->next=NULL; return(head); } int main() { int n,num[26]={0},*p,i,j,max=0; char *a; scanf("%d",&n); struct tushu *head,*p1; head=creat(n); p=num; for(i=0;i<26;i++) { p1=head; a=p1->name; while(p1!=NULL) { for(j=0;*(a+j)!='\0';j++) { if(*(a+j)==i+65) { *(p+i)=*(p+i)+1; break; } } p1=p1->next; a=p1->name; } } for(i=1;i<26;i++) { if(*(p+max)<*(p+i)) max=i; } printf("%c\n",max+65); printf("%d\n",*(p+max)); p1=head; a=p1->name; while(p1!=NULL) { for(i=0;*(a+i)!='\0';i++) { if(*(a+i)==(max+65)) { printf("%d\n",p1->num); break; } } p1=p1->next; a=p1->name; } return 0; }
2
956
struct a { int num; char s[20]; struct a *next; } main() { int n,i,a[26],b[26]={0},t,j,max; struct a *p1,*p2,*head; scanf("%d",&n); head=p1=(struct a *)malloc(L); scanf(M,&p1->num,p1->s); for(i=1;i<n;i++) { p2=p1; p1=(struct a *)malloc(L); p2->next=p1; scanf(M,&p1->num,p1->s); } p1->next=NULL; for(i=0;i<26;i++) a[i]=65+i; for(i=0;i<26;i++) { p1=head; while(p1!=NULL) { for(j=0;p1->s[j]!='\0';j++) if(a[i]==p1->s[j]) b[i]++; p1=p1->next; } } max=b[0];t=0; for(i=1;i<26;i++) if(b[i]>max) { max=b[i]; t=i; } printf("%c\n%d\n",a[t],max); p1=head; while(p1!=NULL) { for(j=0;p1->s[j]!='\0';j++) if(a[t]==p1->s[j]) {printf("%d\n",p1->num);break;} p1=p1->next; } }
2
957
int main() { struct { int num; char author[26]; }book[1000]; int shu_num[26],i,j,k,n,max,length; char max_author; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %s",&book[i].num,book[i].author); } for(k=0;k<26;k++){ shu_num[k]=0; } for(k=0;k<26;k++){ for(i=0;i<n;i++){ length=strlen(book[i].author); for(j=0;j<length;j++){ if(book[i].author[j]=='A'+k){ shu_num[k]++; } } } } max=shu_num[0]; max_author='A'; for(k=0;k<26;k++){ if(shu_num[k]>max){ max=shu_num[k]; max_author='A'+k; } } printf("%c\n%d\n",max_author,max); for(i=0;i<n;i++){ length=strlen(book[i].author); for(j=0;j<length;j++){ if(book[i].author[j]==max_author){ printf("%d\n",book[i].num); } } } return 0; }
2
958
int n; struct book { int num; char name[20]; struct book *next; }*p1,*p2; //???? struct book *creat(void) { struct book *head; int i; head=0; p1=0; p2=0; scanf("%d",&n); for(i=1;i<=n;i++) { p1=(struct book *)malloc(LEN); scanf("%d %s",&p1->num,p1->name); if(head==0) head=p1; else p2->next=p1; p2=p1; } p2->next=0; return(head); } void main() { struct book *head,*p; char a[27],*q,c; int b[27],i,m,n1=0,max;//??a??????????b????????????? for(i=1;i<27;i++) { a[i]=0; b[i]=0; } head=creat(); for(p=head;p!=0;p=p->next)//p++???p=p->next { for(q=p->name;*q!='\0';q++) { m=0; for(i=1;i<=n1;i++)//???????????????????????????????????????1 if(*q==a[i]) { m=1; b[i]++; break; } if(m==0) { n1++;//??n1???n a[n1]=*q; b[n1]=1; } } } max=b[1];c=a[1]; for(i=1;i<=n1-1;i++) if(b[i]>max) { c=a[i]; max=b[i]; } printf("%c\n",c); printf("%d\n",max); for(p=head;p!=0;p=p->next) { m=0; for(q=p->name;*q!='\0';q++) if(*q==c) { m=1; break; } if(m) printf("%d\n",p->num);//????????? } }
2
959
int main() { int num,temp; int author[27][500]={0,}; char str[1000]; cin>>num; for(int i=1;i<=num;i++) { cin>>temp; getchar(); cin>>str; for(int j=0;j<strlen(str);j++) { author[str[j]-'A'+1][0]++; author[str[j]-'A'+1][author[str[j]-'A'+1][0]]=temp; } } int temp_num=0,temp_author; for(int i=1;i<=26;i++) { if(author[i][0]>temp_num) { temp_num=author[i][0]; temp_author=i; } } cout<<(char)(temp_author+'A'-1)<<endl; cout<<temp_num<<endl; for(int i=1;i<=temp_num;i++) { cout<<author[temp_author][i]<<endl; } return 0; }
2
960
void main() { int n,i,j,l,max,p; int a[1000]; scanf("%d",&n); struct book { int m; char c[27]; }; struct book b[1000]; for(i=0;i<n;i++) { scanf("%d",&b[i].m); scanf("%s",b[i].c); } for(i=0;i<26;i++) a[i]=0; for(i=0;i<n;i++) { l=strlen(b[i].c); for(j=0;j<l;j++) a[b[i].c[j]-'A']++; } max=a[0]; for(i=0;i<26;i++) { if(a[i]>max) max=a[i]; } for(i=0;i<26;i++) { if(max==a[i]) p=i; } p=p+'A'; printf("%c\n",p); printf("%d\n",max); for(i=0;i<n;i++) { l=strlen(b[i].c); for(j=0;j<l;j++) { if(b[i].c[j]==p) printf("%d\n",b[i].m); } } }
2
961
struct people { int a; char name[26]; }; void main() { struct people pl[1000]; int i,j,k,l=0,n,s,m,max,x[26]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&pl[i].a,pl[i].name); } for(i=0;i<n;i++) { m=strlen(pl[i].name); for(j=0;j<m;j++) for(k=0;k<26;k++) if(k==pl[i].name[j]-'A') { x[k]++; break; } } max=x[0]; for(i=0;i<26;i++) if(x[i]>max) max=x[i]; for(i=0;i<26;i++) if(x[i]==max) { printf("%c\n",'A'+i); s=i; printf("%d\n",x[i]); break; } for(i=0;i<n;i++) for(j=0;j<26;j++) if(pl[i].name[j]=='A'+s) { printf("%d\n",pl[i].a); break; } }
2
962
int c[255]; int main() { int i,j,n; char m = 0; struct { int id; char s[255]; } a[1000]; scanf("%d", &n); for (i=0;i<n;i++) { scanf("%d%s", &a[i].id, a[i].s); for (j=0; a[i].s[j]; j++) { if (++c[a[i].s[j]] > c[m]) m=a[i].s[j]; } } printf("%c\n%d\n", m, c[m]); for (i=0;i<n;i++) { if (strchr(a[i].s, m)) printf("%d\n", a[i].id); } return 0; }
2
963
struct { int num; char au[27]; }book[999]; int main() { int m,a[26]={0},i,j,t,max=0; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d%s",&book[i].num,book[i].au); int au_n=strlen(book[i].au); for(j=0;j<au_n;j++) { if(book[i].au[j]<=90&&book[i].au[j]>=65) { int k=book[i].au[j]-65; a[k]++; if(a[k]>max) max=a[k]; } } } for(i=0;i<26;i++) { if(a[i]==max) { char r=i+65; printf("%c\n%d\n",r,max); break; } } for(t=0;t<m;t++) { int au_n=strlen(book[t].au); for(j=0;j<au_n;j++) { if(book[t].au[j]==i+65) printf("%d\n",book[t].num); } } return 0; }
2
964
struct chain { int num; char name[27]; struct chain *next; }; void main() { int a[26]={0},m,i,j,k,max=0,n; struct chain *p1,*p2,*head; scanf("%d",&m); p2=head=(struct chain *)malloc(LEN); for(k=0;k<27;k++) head->name[k]=0; scanf("%d%s",&head->num,&head->name); for(k=0;k<strlen(head->name);k++) { if(head->name[k]>=65&&head->name[k]<=90) a[head->name[k]-65]++; } for(j=0;j<m-1;j++) { p1=(struct chain *)malloc(LEN); p2->next=p1; for(k=0;k<27;k++) p1->name[k]=0; scanf("%d%s",&p1->num,&p1->name); p2=p1; for(k=0;k<strlen(p1->name);k++) { if(p1->name[k]>=65&&p1->name[k]<=90) a[p1->name[k]-65]++; } } for(i=0;i<26;i++) { if(max<a[i]) { max=a[i]; n=i; } } printf("%c\n%d\n",n+65,max); p1=head; for(i=0;i<m;i++) { for(j=0;j<26;j++) { if(p1->name[j]==(n+65)) { printf("%d\n",p1->num); break; } } p1=p1->next; } }
2
965
void main() { struct b {int n; char a[26]; }; struct b b[999]; int m,k,i,j,c[26]={0},p=0,q=0; char x; scanf("%d",&m); for(i=0;i<m;i++) scanf("%d%s",&b[i].n,&b[i].a); for(i=0;i<m;i++) for(j=0;(x=b[i].a[j])!='\0'&&j<26;j++) c[x-65]++; k=c[0]; for(i=0;i<26;i++) if(c[i]>k){k=c[i];p=i;} printf("%c\n",p+65); printf("%d\n",c[p]); for(i=0;i<m;i++) {q=0; for(j=0;(x=b[i].a[j])!='\0'&&j<26;j++) if(x==p+65)q=1; if(q==1)printf("%d\n",b[i].n); } }
2
966
int main() { int m; int i, j, a,n; struct book{ int no; char name[30]; }book[999]; int author1[30]={0}, author2[30]={0}; char k; scanf("%d", &m); for(i=0;i<m;i++) scanf("%d %s", &book[i].no, &book[i].name); for(i=0;i<m;i++){ a = strlen(book[i].name); for(j=0;j<a;j++){ for(k='A';k<='Z';k++){ if(book[i].name[j]==k) author1[(int)k-65]++; } } } for(i=0;i<26;i++) author2[i]=author1[i]; for(i=0;i<26;i++){ for(j=i+1;j<26;j++){ if(author1[i]<author1[j]){ int tmp; tmp = author1[i]; author1[i] = author1[j]; author1[j]= tmp; } } } for(i=0;i<26;i++){ if(author2[i] == author1[0]){ printf("%c\n", (char)(65+i)); printf("%d\n", author1[0]); for(j=0;j<m;j++){ a = strlen(book[j].name); for(n=0;n<a;n++){ if(book[j].name[n]==(char)(65+i)){ printf("%d\n", book[j].no); break; } } } } } return 0; }
2
967
struct book { int num; char w[26]; struct book *next; }; int c[26],m,i,j=0,max; struct book *creat(int m) { struct book *head,*p1,*p2; p1=(struct book*)malloc(len); scanf("%d%s",&p1->num,p1->w); p1->next=NULL; p2=p1; head=p1; for(i=1;i<m;i++) { p1=(struct book*)malloc(len); scanf("%d%s",&p1->num,p1->w); p1->next=NULL; p2->next=p1; p2=p1; } return head; } void a(struct book *head) { struct book *p; char *x; int l,ch; p=head; for(i=0;i<m;i++) { for(x=p->w;x<p->w+26;x++) { l=(int)*x; ch=l-65; if(ch>=0) c[ch]=c[ch]+1; } p=p->next; } } void main() { struct book *head,*p; struct book *creat(int m); void a(struct book *head); char writer,*x; int wri,b[200]; for(i=0;i<26;i++) c[i]=0; for(i=0;i<200;i++) b[i]=0; scanf("%d",&m); head=creat(m); a(head); max=0; j=0; for(i=0;i<26;i++) { if(c[i]>max) { wri=i+65; max=c[i]; } } printf("%c\n",wri); p=head; for(i=0;i<m;i++) { for(x=p->w;x<p->w+26;x++) { if(*x==(char)wri) { b[j]=p->num; j=j+1; break; } } p=p->next; } printf("%d\n",j); for(j=0;b[j]>0;j++) printf("%d\n",b[j]); }
2
968
int max,n,x,b[30]={0}; struct book { int num; char author[30]; struct book*next; }; struct book*creat() { struct book*head,*p1,*p2; p2=NULL; head=(struct book*)malloc(len); p1=head; while(n>0) { char a[30];int i,j; p2=p1; x=0; scanf("%d%s",&p1->num,&p1->author); strcpy(a,p1->author); max=b[0]; for(i=0;a[i]!='\0';i++) { for(j='A';j<='Z';j++) { if(j==a[i]) b[j]++; } } for(j='A';j<='Z';j++) { if(b[j]>max) { max=b[j]; x=j; } } p1=(struct book*)malloc(len); p2->next=p1; n--; } p2->next=NULL; printf("%c\n%d\n",x,max); return head; } struct book*print(struct book*head,char x) { struct book*p1; p1=head; int i; while(p1!=NULL) { char a[30]; strcpy(a,p1->author); for(i=0;a[i]!='\0';i++) { if(a[i]==x) printf("%d\n",p1->num); } p1=p1->next; } return head; } void main() { scanf("%d",&n); struct book*head; head=creat(); print(head,x); }
2
969
int main(int argc, char* argv[]) { int m,i,j,A[26]={0},B[26]; char s; scanf("%d",&m); struct book{ int num; char n[26]; }*book; book=(struct book*)malloc(sizeof(struct book)*m); for(i=0;i<m;i++) { scanf("%d %s",&book[i].num,book[i].n); for(j=0;book[i].n[j]!='\0';j++) { switch(book[i].n[j]) { case 65:A[0]++;break; case 66:A[1]++;break; case 67:A[2]++;break; case 68:A[3]++;break; case 69:A[4]++;break; case 70:A[5]++;break; case 71:A[6]++;break; case 72:A[7]++;break; case 73:A[8]++;break; case 74:A[9]++;break; case 75:A[10]++;break; case 76:A[11]++;break; case 77:A[12]++;break; case 78:A[13]++;break; case 79:A[14]++;break; case 80:A[15]++;break; case 81:A[16]++;break; case 82:A[17]++;break; case 83:A[18]++;break; case 84:A[19]++;break; case 85:A[20]++;break; case 86:A[21]++;break; case 87:A[22]++;break; case 88:A[23]++;break; case 89:A[24]++;break; case 90:A[25]++;break; } } } int k,max; //for(i=0;i<26;i++) // printf("%d\n",A[i]); for(i=0;i<26;i++) { B[i]=A[i]; } for(i=25;i>0;i--) { if(B[i]>B[i-1]) { B[i-1]=B[i]; max=B[i]; } else { max=B[i-1]; } } for(i=25;i>=0;i--) { if(A[i]==max) k=i; } //printf("%d",k); s=k+65; printf("%c\n%d\n",s,max); for(i=0;i<m;i++) { for(j=0;book[i].n[j]!='\0';j++) { if(book[i].n[j]==s) { printf("%d\n",book[i].num); break; } } } return 0; }
2
970
int n; struct student { int num; char name[100]; struct student *next; }; struct student *creat(void) { struct student *head; struct student *p1,*p2; int i; p1=(struct student*)malloc(LEN); scanf("%d",&p1->num); scanf("%s",p1->name); p1->next=NULL; head=p1; p2=p1; for(i=1;i<n;i++) { p1=(struct student*)malloc(LEN); scanf("%d",&p1->num); scanf("%s",p1->name); p1->next=NULL; p2->next=p1; p2=p1; } return (head); } void main() { struct student *head; struct student *p1; char *p2; int i; int a[26]; for(i=0;i<26;i++) { a[i]=0; } scanf("%d",&n); head=creat(); p1=head; do { p2=p1->name; for(;(*p2)!='\0';p2++) { if((*p2)=='A') { a[0]=a[0]+1; } if((*p2)=='B') { a[1]=a[1]+1; } if((*p2)=='C') { a[2]=a[2]+1; }if((*p2)=='D') { a[3]=a[3]+1; }if((*p2)=='E') { a[4]=a[4]+1; }if((*p2)=='F') { a[5]=a[5]+1; }if((*p2)=='G') { a[6]=a[6]+1; }if((*p2)=='H') { a[7]=a[7]+1; }if((*p2)=='I') { a[8]=a[8]+1; }if((*p2)=='J') { a[9]=a[9]+1; }if((*p2)=='K') { a[10]=a[10]+1; }if((*p2)=='L') { a[11]=a[11]+1; }if((*p2)=='M') { a[12]=a[12]+1; }if((*p2)=='N') { a[13]=a[13]+1; }if((*p2)=='O') { a[14]=a[14]+1; }if((*p2)=='P') { a[15]=a[15]+1; }if((*p2)=='Q') { a[16]=a[16]+1; }if((*p2)=='R') { a[17]=a[17]+1; }if((*p2)=='S') { a[18]=a[18]+1; }if((*p2)=='T') { a[19]=a[19]+1; }if((*p2)=='U') { a[20]=a[20]+1; }if((*p2)=='V') { a[21]=a[21]+1; }if((*p2)=='W') { a[22]=a[22]+1; }if((*p2)=='X') { a[23]=a[23]+1; }if((*p2)=='Y') { a[24]=a[24]+1; }if((*p2)=='Z') { a[25]=a[25]+1; } } p1=p1->next; }while(p1!=NULL); int j,max=0; for(i=0;i<26;i++) { if(a[i]>max) { max=a[i]; j=i; } } printf("%c\n",j+65); printf("%d\n",a[j]); p1=head; do { p2=p1->name; for(;(*p2)!='\0';p2++) { if((*p2)==j+65) { printf("%d\n",p1->num); } } p1=p1->next; }while(p1!=NULL); }
2
971
struct book { int num; char name[26]; struct book *next; }; struct book *creat(int m) { struct book *head,*p1,*p2; p1=(struct book *)malloc(sizeof(struct book)); scanf("%d %s",&p1->num,p1->name); int i; for(i=1;i<m;i++) { if(i==1) head=p1; else p2->next=p1; p2=p1; p1=(struct book *)malloc(sizeof(struct book)); scanf("%d %s",&p1->num,p1->name); } p2->next=p1;p1->next=NULL; return(head); } main() { struct book *head,*p; int i,j,m,k,l,max=0; scanf("%d",&m); head=creat(m); int *a; a=(int *)malloc(26*sizeof(int)); for(i=0;i<26;i++) *(a+i)=0; p=head; for(i=0;i<m;i++) { k=strlen(p->name); for(j=0;j<k;j++) for(l=0;l<26;l++) if(*(p->name+j)==l+65) (*(a+l))++; p=p->next; } for(i=0;i<26;i++) if(max<*(a+i)) max=*(a+i); for(i=0;i<26;i++) if(max==*(a+i)) {printf("%c\n%d\n",i+65,max);break;} p=head; for(j=0;j<m;j++) { k=strlen(p->name); for(l=0;l<k;l++) if(*(p->name+l)==i+65) printf("%d\n",p->num); p=p->next; } }
2
972
struct BOOK { int No; char author[27]; }book[999]; int letter[26]={0}; main() { int letter[26]={0}; int count=0; int m,n,s; scanf("%d",&m); int i,j,max; for(i=0;i<m;i++){ scanf("%d%s",&book[i].No,&book[i].author); } for(i=0;i<m;i++){ for(j=0;j<strlen(book[i].author);j++){ n=book[i].author[j]-65; letter[n]++; } } max=letter[0]; for(n=0;n<26;n++){ if(letter[n]>max){ max=letter[n]; } } for(n=0;n<26;n++){ if(max==letter[n]){ s=n; printf("%c\n%d\n",n+65,max); break; } } for(i=0;i<m;i++){ for(j=0;j<strlen(book[i].author);j++){ if(s==book[i].author[j]-65){ printf("%d\n",book[i].No); } } } }
2
973
struct Book { int number; char author[30]; }; void main() { int max=0,len; int sum[30]={0}; int m,i,j; struct Book book[999]; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d %s",&book[i].number,book[i].author); len=strlen(book[i].author); for(j=0;j<len;j++) sum[book[i].author[j]-65]++; } for(i=0;i<26;i++) { if(sum[i]>sum[max]) max=i; } printf("%c\n%d\n",max+65,sum[max]); for(i=0;i<m;i++) { len=strlen(book[i].author); for(j=0;j<len;j++) { if(book[i].author[j]==max+65) { printf("%d\n",book[i].number); break; } } } }
2
974
void main() { int n,i,j,no[1000],shu[26]={0},max=0; char s[1000][20],c; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%s",&no[i],s[i]); for(j=0;j<strlen(s[i]);j++) { shu[s[i][j]-'A']++; } } for(i=0;i<26;i++) { if(shu[i]>max) { max=shu[i]; c='A'+i; } } printf("%c\n%d\n",c,max); for(i=0;i<n;i++) { if(strchr(s[i],c)) printf("%d\n",no[i]); } }
2
975
int main () { int m, i, j, k, n, max, l, y = 0; struct book { int num; char aut[26]; }book[1000]; int a[26] = {0}; char b[26] = {'A','B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'z'}; scanf ("%d", &m); for (i = 0; i < m; i++) { scanf ("%d %s", &book[i].num, book[i].aut); } for (i = 0; i < 26; i++) { for (j = 0; j < m; j++) { l = strlen(book[j].aut); for (k = 0; k < l; k++) { if (book[j].aut[k] == b[i]) { a[i]++; } } } } for (i = m; i > 0; i--) { for (j = 0; j < 26; j++) { if (a[j] == i) { max = a[j]; n = j; printf("%c\n", b[j]); printf ("%d\n", a[j]); y = 1; break; } } if (y == 1) { break; } } for (i = 0; i < m; i++) { l = strlen(book[i].aut); for (j = 0; j < l; j++) { if (book[i].aut[j] == b[n]) { printf("%d\n", book[i].num); } } } return 0; }
2
976
struct book { long int num; char name[26]; }book[1000]; int main() { int m,i,j,r; int writer[26]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%ld ",&book[i].num); scanf("%s",book[i].name); } for(i=0;i<m;i++) { r=strlen(book[i].name); for(j=0;j<r;j++) { writer[book[i].name[j]-'A']++; } } int max=0; char w='A'; for(i=0;i<26;i++) { if(writer[i]>max) { max=writer[i]; w=i+'A'; } } printf("%c\n",w); printf("%d\n",max); for(i=0;i<m;i++) { for(j=0;j<r;j++) { r=strlen(book[i].name); if(book[i].name[j]==w) { printf("%ld\n",book[i].num); } } } return 0; }
2
977
int main() { struct book { int num; char author[26]; }list[999],*p; int n; int count[26]={0}; int i; char k='A'; int max; scanf("%d",&n); for(p=list;p<list+n;p++){ scanf("%d %s",&p->num,p->author); } for(p=list;p<list+n;p++){ for(i=0;;i++){ if(p->author[i]=='\0'){ break; }else{ count[p->author[i]-65]++; } } } max=count[0]; for(i=1;i<26;i++){ if(count[i]>max){ max=count[i]; k=i+65; } } printf("%c\n",k); printf("%d\n",max); for(p=list;p<list+n;p++){ for(i=0;;i++){ if(k==p->author[i]){ printf("%d\n",p->num); } if(p->author[i]=='\0'){ break; } } } return 0; }
2
978
struct book { int num; char ren[26]; } main() { struct book shu[999]; int m,i,j,k,max=0,p; int a[26]={0}; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d %s",&shu[i].num,shu[i].ren); for(j=0;shu[i].ren[j]!='\0';j++) for(k=65;k<91;k++) if(shu[i].ren[j]==k) a[k-65]++; } for(i=0;i<26;i++) if(max<a[i]) max=a[i]; for(i=0;i<26;i++) if(max==a[i]) { p=i+65; printf("%c\n%d\n",p,a[p-65]); } for(i=0;i<m;i++) for(j=0;shu[i].ren[j]!='\0';j++) if(p==shu[i].ren[j]) printf("%d\n",shu[i].num); }
2
979
int main() { char book[1000][20]={'\0'},name[1000][30]={'\0'}; int length,n,i,j,number[30]={0},memory,largest,temp; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s %s",book[i],name[i]); } for(i=0;i<n;i++) { length=strlen(name[i]); for(j=0;j<length;j++) { temp=name[i][j]-'A'; number[temp]+=1; } } largest=0; for(i=0;i<26;i++) { if(number[i]>largest) { largest=number[i]; memory=i; } } printf("%c\n%d\n",'A'+memory,number[memory]); for(i=0;i<n;i++) { length=strlen(name[i]); for(j=0;j<length;j++) { if(name[i][j]=='A'+memory) { printf("%s\n",book[i]); } } } return 0; }
2
980
int main() { struct { int m; char s[26]; }p[999]; int i,j,len,n; int a[26][1000]={0}; int w,t; scanf("%d\n",&n); for(i=0;i<n;i++) { scanf("%d %s",&p[i].m,p[i].s); len=strlen(p[i].s); for(j=0;j<len;j++) { t=(p[i].s)[j]-'A'; a[t][0]+=1; w=a[t][0]; a[t][w]=p[i].m; } } int max=a[0][0]; int k=0; for(i=1;i<26;i++) { if(a[i][0]>max) { max=a[i][0]; k=i; } } printf("%c\n",k+'A'); printf("%d\n",max); for(i=1;i<=max;i++) { printf("%d\n",a[k][i]); } return 0; }
2
981
void main() { struct book { int number; char author[10]; }; struct book a[1000]; int i,n,j,count[26]={0},temp,max,index=0; char c; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d %s",&a[i].number,&a[i].author); for(i=0;i<n;i++) for(j=0;a[i].author[j]!='\0';j++) { temp=(a[i].author[j])-'A'; count[temp]++; } max=count[0]; for(i=1;i<26;i++) if(count[i]>max) {max=count[i]; index=i; } c=index+'A'; printf("%c\n%d\n",c,max); for(i=0;i<n;i++) for(j=0;a[i].author[j]!='\0';j++) if(a[i].author[j]==c) printf("%d\n",a[i].number); }
2
982
void main() { char w[999][26]; char m; int a[999],c[26]; int i,j,n,t,max; scanf("%d",&n); for(i=0;i<=25;i++){ c[i]=0; } for(i=0;i<=n-1;i++){ scanf("%d",&a[i]); scanf("%s",w[i]); } for(i=0;i<=n-1;i++){ for(j=0;w[i][j]!='\0';j++){ c[w[i][j]-65]+=1; } } max=c[0]; m=65; for(i=0;i<=25;i++){ if(c[i]>max){ max=c[i]; m=i+65; } } printf("%c\n",m); printf("%d\n",max); for(i=0;i<=n-1;i++){ for(j=0;w[i][j]!='\0';j++){ if(w[i][j]==m){ printf("%d\n",a[i]); } } } }
2
983
int pp[26]={0}; struct st { char name[27]; int num; struct st *next; }; struct st *creat(int m) { struct st *head,*p1,*p2; int i,j; p1=(struct st *)malloc(sizeof(struct st)); scanf("%d %s",&p1->num,p1->name); for (j=0;;j++) { if (isupper(p1->name[j])) pp[p1->name[j]-65]++; else break; } p2=p1; head=p1; for (i=1;i<m;i++) { p1=(struct st *)malloc(sizeof(struct st)); scanf("%d %s",&p1->num,p1->name); for (j=0;;j++) { if (isupper(p1->name[j])) pp[p1->name[j]-65]++; else break; } p1->next=NULL; p2->next=p1; p2=p1; } return(head); } void main() { struct st *creat(); struct st *head,*p; int n,i,max,j; scanf("%d",&n); head=creat(n); p=head; max=0; for (i=1;i<26;i++) if (pp[i]>pp[max]) max=i; printf("%c\n%d\n",max+65,pp[max]); while(p) { for (j=0;;j++) { if (isupper(p->name[j])) { if (p->name[j]==(max+65)) printf("%d\n",p->num); } else break; } p=p->next; } }
2
984
int main() { struct books { int book; char writer[20]; }bk[1000]; int n,i,j,m,max,k,maxw=0,flag=0,a[26]={0}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %s",&bk[i].book,bk[i].writer); } for(i=0;i<n;i++) { m=strlen(bk[i].writer); for(j=0;j<m;j++) { k=bk[i].writer[j]; a[k-65]++; } } max=a[0]; for(i=1;i<26;i++) { if(a[i]>max) { max=a[i]; maxw=i; } } printf("%c\n%d\n",maxw+65,max); for(i=0;i<n;i++) { m=strlen(bk[i].writer); for(j=0;j<m;j++) { if(maxw+65==bk[i].writer[j]) printf("%d\n",bk[i].book); } } return 0; }
2
985
void main() { struct book { int num; char w[27]; }; struct book b[1000]; int n,i,j,k,c[26]={0},max; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%s",&b[i].num,b[i].w); } for(i='A';i<='Z';i++) { for(j=0;j<n;j++) { for(k=0;k<strlen(b[j].w);k++) { if(i==b[j].w[k]) { c[i-65]++; } } } } max=0; for(i=1;i<26;i++) { if(c[i]>c[max]) max=i; } printf("%c\n",max+65); printf("%d\n",c[max]); for(i=0;i<n;i++) { for(j=0;j<strlen(b[i].w);j++) { if(b[i].w[j]==max+65) { printf("%d\n",b[i].num); break; } } } }
2
986
/* * most books.cpp * ??:????????? * Created on: 2012-12-30 * Author: ??? */ int main() { int m=0,num=0,wnum=0,max=0,i=0,j=0; //??????,??,????,????? int books[26][30]; //??26?????????? char writer[26],name; //???????? memset(books,0,sizeof(books)); //??? cin>>m; for(i=0;i<m;i++) //??????????? { cin>>num>>writer; wnum=strlen(writer); for(j=0;j<wnum;j++) //??????????,????? { books[writer[j]-65][0]++; books[writer[j]-65][books[writer[j]-65][0]]=num; } } for(j=0;j<26;j++) //?? if(max<books[j][0]) { max=books[j][0]; name=j+65; } cout<<name<<endl; cout<<max<<endl; for(j=1;j<=max;j++) cout<<books[name-65][j]<<endl; return 0; }
2
987
main() { struct book { int num; char name[26]; }b[1000]; int m,i,j,n[26]={0},max=0,t; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d %s",&b[i].num,b[i].name); } for(i=0;i<m;i++) { for(j=0;j<strlen(b[i].name);j++) { ++n[b[i].name[j]-65]; } } for(i=0;i<26;i++) { if(n[i]>max) { max=n[i]; t=i+65; } } printf("%c\n",t); printf("%d\n",max); for(i=0;i<m;i++) { for(j=0;j<strlen(b[i].name);j++) { if(b[i].name[j]==t) printf("%d\n",b[i].num); } } }
2
988
struct book { int order; int num; char writer[26]; }b[1000]; int main() { int n,i,j,k,p,q[1000]; scanf("%d",&n); for(i=0;i<=(n-1);i++) { scanf("%d %s",&b[i].num,b[i].writer); b[i].order=i; } char a[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int c[26]; char d[26]; for(j=0;j<=25;j++) { d[j]=0; c[j]=0; } for(k=0;k<=25;k++) { for(i=0;i<=(n-1);i++) { p=strlen(b[i].writer); strcpy(d,b[i].writer); for(j=0;j<=(p-1);j++) { if(d[j]==a[k]) { c[k]=c[k]+1; } } for(j=0;j<=25;j++) { d[j]=0; } } } int max=c[0]; for(i=0;i<=25;i++) { if(c[i]>max) { max=c[i]; } } char x; for(i=0;i<=25;i++) { if(c[i]==max) { x=a[i]; printf("%c\n",a[i]); printf("%d\n",c[i]); } } for(i=0;i<=999;i++) { q[i]=0; } int r=0; char e[26]; for(i=0;i<=25;i++) { e[i]=0; } for(i=0;i<=(n-1);i++) { p=strlen(b[i].writer); strcpy(e,b[i].writer); for(j=0;j<=(p-1);j++) { if(e[j]==x) { q[r]=b[i].num; r=r+1; } } for(j=0;j<=25;j++) { e[j]=0; } } int s=0; for(i=0;i<=999;i++) { if(q[i]!=0) { s=s+1; } } for(i=0;i<=(s-2);i++) { printf("%d\n",q[i]); } printf("%d",q[s-1]); return 0; }
2
989
int main() { int m,i,j; scanf("%d",&m); struct Bookinfo { int number; char auther[27]; }; struct Bookinfo a[1000]; for (i=0;i<m;i++) scanf("%d %s",&a[i].number,a[i].auther); int count[26]={0},max,record; for (i=0;i<m;i++) { int k; k=strlen(a[i].auther); for (j=0;j<k;j++) { count[a[i].auther[j]-'A']++; } } max=count[0]; for (i=0;i<26;i++) if (count[i]>=max) { max=count[i]; record=i; } printf("%c\n%d\n",record+'A',max); for (i=0;i<m;i++) { int n; n=strlen(a[i].auther); for (j=0;j<n;j++) if (a[i].auther[j]==record+'A') { printf("%d\n",a[i].number); break; } } return 0; }
2
990
int main(int argc, char* argv[]) { int N; int a[26]={0}; struct book{ int x; char y[27]; }A[1000]; scanf("%d",&N); int i,j; for(i=0;i<N;i++) { scanf("%d%s",&A[i].x,A[i].y); for(j=0;A[i].y[j]!='\0';j++) { if(A[i].y[j]=='A') { a[0]++; } else if(A[i].y[j]=='B') { a[1]++; } else if(A[i].y[j]=='C') { a[2]++; } else if(A[i].y[j]=='D') { a[3]++; } else if(A[i].y[j]=='E') { a[4]++; } else if(A[i].y[j]=='F') { a[5]++; } else if(A[i].y[j]=='G') { a[6]++; } else if(A[i].y[j]=='H') { a[7]++; } else if(A[i].y[j]=='I') { a[8]++; }else if(A[i].y[j]=='J') { a[9]++; } else if(A[i].y[j]=='K') { a[10]++; } else if(A[i].y[j]=='L') { a[11]++; } else if(A[i].y[j]=='M') { a[12]++; } else if(A[i].y[j]=='N') { a[13]++; } else if(A[i].y[j]=='O') { a[14]++; } else if(A[i].y[j]=='P') { a[15]++; } else if(A[i].y[j]=='Q') { a[16]++; } else if(A[i].y[j]=='R') { a[17]++; } else if(A[i].y[j]=='S') { a[18]++; } else if(A[i].y[j]=='T') { a[19]++; } else if(A[i].y[j]=='U') { a[20]++; } else if(A[i].y[j]=='V') { a[21]++; } else if(A[i].y[j]=='W') { a[22]++; } else if(A[i].y[j]=='X') { a[23]++; } else if(A[i].y[j]=='Y') { a[24]++; } else if(A[i].y[j]=='Z') { a[25]++; } } } int p; int max; p=0; max=a[0]; for (i=0;i<26;i++) { if (a[i]>max) { p=i; max=a[i]; } } char d; d=('A'+p); printf ("%c\n%d\n",d,max); for (i=0;i<N;i++) { for (j=0;A[i].y[j]!='\0';j++) { if (A[i].y[j]==(p+'A')) printf("%d\n",A[i].x); } } return 0; }
2
991
void main() { struct book{int num;char author[26];}b[999]; int a[26]={0},n,i,j,k,max=0; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d %s",&b[i].num,b[i].author); for(i=0;i<26;i++) { for(j=0;j<n;j++) { k=0; while(b[j].author[k]!='\0') {if(b[j].author[k]==i+65)a[i]++; k++;} } } for(i=0;i<26;i++)if(max<a[i])max=a[i]; i=0; while(max!=a[i])i++; printf("%c\n%d\n",i+65,a[i]); for(j=0;j<n;j++) {k=0; while(b[j].author[k]!=i+65&&b[j].author[k]!='\0')k++; if(b[j].author[k]==i+65)printf("%d\n",b[j].num); } }
2
992
struct book { int num; char aut[26]; }b[999]; void main() { int i,j,m,n,k,max,p; int a[26]={0},q[999]={0}; scanf("%d",&m); for(i=0;i<m;i++) scanf("%d %s",&b[i].num,b[i].aut); for(i=0;i<m;i++) { n=strlen(b[i].aut); for(j=0;j<n;j++) { k=b[i].aut[j]; a[k-65]++; } } for(i=1,max=a[0],p=0;i<26;i++) { if(a[i]>max) { p=i; max=a[i]; } } printf("%c\n%d",p+65,max); for(i=0;i<m;i++) { n=strlen(b[i].aut); for(j=0;j<n;j++) if(b[i].aut[j]==(p+65)) q[i]=1; } for(i=0;i<m;i++) if(q[i]==1) printf("\n%d",b[i].num); }
2
993
int main() { int bkn,m=1,n,i,j; char bka[30]; struct author { int num; int p[200]; } a[30]; scanf("%d",&n); for(i=1;i<27;i++) a[i].num=0; for(i=0;i<n;i++) { scanf("%d%s",&bkn,bka); for(j=0;j<strlen(bka);j++) { a[bka[j]-64].num++; a[bka[j]-64].p[a[bka[j]-64].num-1]=bkn; } } for(i=2;i<27;i++) if(a[i].num>a[m].num) m=i; printf("%c\n%d\n",m+64,a[m].num); for(i=0;i<a[m].num;i++) printf("%d\n",a[m].p[i]); return 0; }
2
994
struct shu { int hao; char zuo[26]; struct shu*next; }; int main() { int m,a[26]={0},i,j,b[26][1000],k,max; struct shu*p1,*p2,*head=NULL,*p; scanf("%d",&m); p1=p2=(struct shu*)malloc(len); scanf("%d %s",&p1->hao,p1->zuo); head=p1; for(i=2;i<=m;i++) { p1=(struct shu*)malloc(len); scanf("%d %s",&p1->hao,p1->zuo); p2->next=p1; p2=p1; } p2->next=NULL; for(i=0,max=0;i<=25;i++) { for(p=head,k=1;p!=NULL;p=p->next) { for(j=0;j<=25;j++) if(p->zuo[j]=='A'+i) { a[i]++; b[i][k]=p->hao; k++; } } if(a[i]>max) max=a[i]; } for(i=0;i<=25;i++) { if(a[i]==max) { printf("%c\n%d\n",'A'+i,max); for(k=1;k<=max;k++) printf("%d\n",b[i][k]); break; } } return 0; }
2
995
struct worker { int nm; char name1[26]; struct worker *next; }; struct zuozhe { char nam; int counts; int name[1000]; struct zuozhe *next; }; struct worker *creat1(int n) { struct worker *head,*p1,*p2; int i; head=(struct worker *)malloc(sizeof(struct worker)); p1=p2=head; for(i=0;i<n;i++) { p2=p1; p1=(struct worker *)malloc(sizeof(struct worker)); scanf("%d %s",&p2->nm,p2->name1); p2->next=p1; } p2->next=0; return head; } struct zuozhe *creat2() { struct zuozhe *head,*p1,*p2; int i; head=(struct zuozhe *)malloc(sizeof(struct zuozhe)); p1=p2=head; for(i=0;i<26;i++) { p2=p1; p1=(struct zuozhe *)malloc(sizeof(struct zuozhe)); p2->counts=0; p2->nam='A'+i; p2->next=p1; } p2->next=0; return head; } void main() { int big=0; char zz; int i,j; char c; int m,n; int a[26]={0}; struct worker *head1,*p1,*p2; struct zuozhe *head2,*q1,*q2; scanf("%d",&n); head1=creat1(n); p1=p2=head1; head2=creat2(); q1=q2=head2; while(p1!=0) { i=0; while(p1->name1[i]!='\0') { q1=head2; while(1) { if(q1->nam==p1->name1[i]) { q1->name[q1->counts]=p1->nm; q1->counts++; i++; break; } q1=q1->next; } } p1=p1->next; } q1=head2; while(q1!=0) { if(q1->counts>big) { zz=q1->nam; big=q1->counts; } q1=q1->next; } q1=head2; while(1) { if(q1->nam==zz) { printf("%c\n%d\n",q1->nam,q1->counts); for(i=0;i<q1->counts;i++) { printf("%d\n",q1->name[i]); } break; } q1=q1->next; } }
2
996
void main() { int m,a[1000],l[1000],i,j,k,t,time[26]={0},max,q=0; char name[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char b[1000][26]; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d %s",&a[i],b[i]); l[i]=strlen(b[i]); } for(i=0;i<m;i++) { for(j=0;j<l[i];j++) { for(k=0;k<26;k++) { if(b[i][j]==name[k]) time[k]++; } } } max=time[0]; for(i=1;i<26;i++) { if(time[i]>max) { max=time[i]; t=i; } } printf("%c\n",name[t]); printf("%d\n",max); for(i=0;i<m;i++) { for(j=0;j<l[i];j++) { if(b[i][j]==name[t]) { printf("%d\n",a[i]); } } } }
2
997
struct Book { int id; char author[26]; int flag; }book[1000]; int main() { int n, i, j, l, max, maxnum; int num = 0; int a[26] = {0}; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d %s", &book[i].id, book[i].author); l = strlen(book[i].author); for(j = 0; j < l; j++) a[book[i].author[j] - 65]++; } max = 0; maxnum = 0; for(i = 0; i < 26; i++) { if(a[i] > max) { max = a[i]; maxnum = i; } } printf("%c\n", maxnum+65); for(i = 0; i < n; i++) { book[i].flag = 0; l = strlen(book[i].author); for(j = 0; j < l; j++) if(book[i].author[j] == maxnum+65) { num++; book[i].flag = 1; break; } } printf("%d\n", num); for(i = 0; i < n; i++) if(book[i].flag == 1) printf("%d\n", book[i].id); return 0; }
2
998
struct shu { char xh[100]; /*??*/ char zz[100]; struct shu * next; }; int num[26]={0},m; struct shu *creat(int n) { int i=0; struct shu *p1,*p2,*head; p1=p2=(struct shu *)malloc(sizeof(struct shu )); head=0; while(i<n) { i++; if(i==1) { p1->next=0; head=p1; } else { p2=p1; p1=(struct shu *)malloc(sizeof(struct shu )); p1->next=p2->next; p2->next=p1; } scanf("%s %s",p1->xh,p1->zz); } return head; } void max(struct shu *head) { struct shu *p; char *f; int i,zd=0; for(p=head;p!=0;p=p->next) /*??p++*/ { for(f=p->zz;*f!='\0';f++) { num[*f-65]++; } } for(i=0;i<26;i++) { if(num[i]>zd) { zd=num[i]; m=i; } } printf("%c\n",65+m); printf("%d\n",zd); /*???????*/ } void print(head) { struct shu *p; char *f; for(p=head;p!=0;p=p->next) /*????p++*/ { for(f=p->zz;*f!='\0';f++) { if(*f==65+m) { printf("%s\n",p->xh); break; } } } } void main() { int n; struct shu *head; scanf("%d",&n); head=creat(n); max(head); print(head); }
2
999
struct book { int num; char writer[30]; struct book *next; }; int n; struct book *creat(void) { struct book *head; struct book *p1,*p2; int m=0; p1=p2=(struct book*)malloc(len); scanf("%d %s",&p1->num,p1->writer); head=NULL; while(m<n-1) { m++; if(m==1) head=p1; else p2->next=p1; p2=p1; p1=(struct book*)malloc(len); scanf("%d %s",&p1->num,p1->writer); } p2->next=p1; p2=p1; p2->next=NULL; return (head); } void main() { scanf("%d",&n); struct book * head,*p1; head=creat(); struct book *p; p=head; int i; int sum[27]; memset(sum,0,sizeof(sum)); char m; for(p=head;p!=NULL;p=p->next) {int x; for(i=0;i<strlen(p->writer);i++) { x=p->writer[i]-'A'; sum[x]++; } } int max=sum[0]; for(i=0;i<27;i++) { if(max<sum[i]) max=sum[i]; } for(i=0;i<27;i++) { if(sum[i]==max) {printf("%c\n%d\n",'A'+i,sum[i]);m='A'+i;} } for(p=head;p!=NULL;p=p->next) { for(i=0;i<strlen(p->writer);i++) { if(p->writer[i]==m) {printf("%d\n",p->num);break;} } } }