id
int32 0
32.5k
| code
stringlengths 95
8.4k
| label
stringclasses 65
values |
---|---|---|
700 | void main()
{
int n,a[1000]={0},c[27]={0},i,j,k,m,p,d[1000]={0};
char b[1000][30]={{0}};
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<26;j++)
{
for(k=1;k<=26;k++)
{
if(b[i][j]==64+k)c[k]=c[k]+1;
}
}
}
m=c[1];
p=1;
for(i=1;i<27;i++)
{
if(c[i]>m)
{
m=c[i];
p=i;
}
}
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(b[i][j]==64+p)d[i]=1;
}
}
printf("%c\n",64+p);
printf("%d\n",m);
for(i=0;i<1000;i++)
{
if(d[i]==1)printf("%d\n",a[i]);
}
}
| 2 |
701 | int n=1,m;
struct zuozhe
{int num;
char ren[26];
struct zuozhe *next;
};
struct zuozhe *ap()
{
struct zuozhe * head,*nw,*tn;
do
{
nw=(struct zuozhe *)malloc(sizeof(struct zuozhe));
scanf("%d%s",&nw->num ,nw->ren );
if(n==1)
{
head=nw;
tn=head;
}
else
tn->next=nw;
if(n<=m)
{
tn=nw;
n++;
}
}while(n<=m);
tn->next =NULL;
return head;
}
int main()
{
int i,max=0,a[26]={0},j,w,l;
char z;
struct zuozhe *head,*p;
scanf("%d",&m);
head=ap();
p=head;
for(;p!=NULL;p=p->next )
{
l=strlen(p->ren );
for(i=0;i<l;i++)
{
j=p->ren [i]-65;
a[j]++;
}
}
for(i=0;i<26;i++)
{
if(max<a[i])
{
max=a[i];
w=i;
}
}
z=65+w;
printf("%c\n%d\n",z,max);
p=head;
for(;p!=NULL;p=p->next )
{
l=strlen(p->ren );
for(i=0;i<l;i++)
{
if(p->ren [i]==z)
{
printf("%d\n",p->num );
break;
}
}
}
} | 2 |
702 | int main ()
{
int n,i,a[1000],m[1000];
struct {
char b[26];
}p[1000];
int j,k;
scanf("%d",&n);
char c[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 num[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};
for (i=0;i<n;i++)
{
scanf("%d %s",&a[i],p[i].b);
m[i]=strlen(p[i].b);
for (k=0;k<26;k++)
for (j=0;j<m[i];j++)
{
if (p[i].b[j]==c[k])
num[k]++;
}
}
int max=0,local=0;
for (k=0;k<26;k++)
{
if (num[k]>max)
{
max=num[k];
local=k;
}
}
printf("%c\n",c[local]);
printf("%d\n",max);
for (i=0;i<n;i++)
{
for (j=0;j<m[i];j++)
{
if (p[i].b[j]==c[local])
printf("%d\n",a[i]);
}
}
return 0;
} | 2 |
703 | void main ()
{
int n,a[1000],i,l,j,max,s[26]={0};
char c[1000][27],w;
scanf ("%d",&n);
for (i=0;i<n;i++)
{
scanf ("%d%s",&a[i],c[i]);
l=strlen(c[i]);
for (j=0;j<l;j++)
{
s[c[i][j]-65]++;
}
}
max=s[0];
w='A';
for (i=1;i<26;i++)
{
if (s[i]>max)
{
max=s[i];
w=i+65;
}
}
printf ("%c\n%d\n",w,max);
for (i=0;i<n;i++)
{
for (j=0;c[i][j]!='\0';j++)
{
if (c[i][j]==w)
{
printf ("%d\n",a[i]);
break;
}
}
}
}
| 2 |
704 |
struct book
{
int num;
char author[27];
}book[1000];
int main()
{
int n, i, a, max=0, alp[26]={0};
char *j;
scanf("%d", &n);
for(i=0;i<n;i++)
{
scanf("%d %s", &book[i].num, book[i].author);
int len=strlen(book[i].author);
for(j=book[i].author;j<(book[i].author+len);j++)
{
int x=*j;
++*(alp+x-65);
if(*(alp+x-65)>max)
{
max=*(alp+x-65);
a=x;
}
}
}
printf("%c\n%d\n", a, max);
for(i=0;i<n;i++)
{
int len=strlen(book[i].author);
for(j=book[i].author;j<(book[i].author+len);j++)
{
if((int)*j==a)
printf("%d\n", book[i].num);
}
}
return 0;
}
| 2 |
705 | 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 |
706 | struct book
{
int no;
char author[26];
}ji[1000];
main()
{
int n,i,j,len,a[26][1000],e,b[26]={0},max=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%s",&ji[i].no,ji[i].author);
len=strlen(ji[i].author);
for(j=0;j<len;j++)
{
e=ji[i].author[j];
e=e-65;
a[e][b[e]]=ji[i].no;
b[e]=b[e]+1;
}
}
for(i=0;i<26;i++)
if(b[max]<b[i])
max=i;
printf("%c\n%d\n",max+65,b[max]);
for(i=0;i<b[max];i++)
printf("%d\n",a[max][i]);
return 0;
} | 2 |
707 | void main()
{
int max(int b[26]);
int n,a[100]={0},b[26]={0},i,j,m;
char zuo[26]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char shu[100][10]={0},c;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&a[i],shu[i]);
}
for(i=0;i<26;i++)
{
for(j=0;j<n;j++)
{
if(strchr(shu[j],zuo[i])) b[i]=b[i]+1;
}
}
m=max(b);
for(i=0;i<26;i++)
{
if(b[i]==m)
{
printf("%c\n",zuo[i]);
printf("%d\n",b[i]);
c=zuo[i];
}
}
for(i=0;i<n;i++)
{
if(strchr(shu[i],c))
{
printf("%d\n",a[i]);
}
}
}
int max(int b[26])
{
int i,m=0;
for(i=0;i<26;i++)
{
if(m<b[i])m=b[i];
}
return(m);
} | 2 |
708 |
struct BOOK
{
int num;
char author[26];
};
char maxbook(int a[])
{
int i,j,bookmax=0;
for(i=0;i<26;i++){
if(bookmax<a[i]){
bookmax=a[i];
j=i;
}
}
printf("%c\n%d\n",'A'+j,bookmax);
return 'A'+j;
}
int contain(char author[],char max)
{
char *c=author;
while(*c){
if(*c==max) return 1;
c++;
}
return 0;
}
void main()
{
struct BOOK book[1000];
int m,i,j;
char c,max;
int AtoZ[26]={0};
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&book[i].num);
getchar();
j=0;
while((c=getchar())!='\n'){
book[i].author[j]=c;
AtoZ[c-'A']++;
j++;
}
book[i].author[j]='\0';
}
max=maxbook(AtoZ);
for(i=0;i<m;i++){
if(contain(book[i].author,max))
printf("%d\n",book[i].num);
}
}
| 2 |
709 | int main()
{
int m,i,b[26],p,max,j,c;
scanf ("%d",&m);
struct point
{
int n;
char s[26];
}a[999];
for (i=0;i<m;i++)
{
scanf ("%d %s",&a[i].n,a[i].s);
}
for (i=0;i<26;i++)
{
b[i]=0;
}
for (i=0;i<m;i++)
{
for (j=0;a[i].s[j]!='\0';j++)
{
if (a[i].s[j]=='A')
b[0]++;
else if (a[i].s[j]=='B')
b[1]++;
else if (a[i].s[j]=='C')
b[2]++;
else if (a[i].s[j]=='D')
b[3]++;
else if (a[i].s[j]=='E')
b[4]++;
else if (a[i].s[j]=='f')
b[5]++;
else if (a[i].s[j]=='G')
b[6]++;
else if (a[i].s[j]=='H')
b[7]++;
else if (a[i].s[j]=='I')
b[8]++;
else if (a[i].s[j]=='J')
b[9]++;
else if (a[i].s[j]=='K')
b[10]++;
else if (a[i].s[j]=='L')
b[11]++;
else if (a[i].s[j]=='M')
b[12]++;
else if (a[i].s[j]=='N')
b[13]++;
else if (a[i].s[j]=='O')
b[14]++;
else if (a[i].s[j]=='P')
b[15]++;
else if (a[i].s[j]=='Q')
b[16]++;
else if (a[i].s[j]=='R')
b[17]++;
else if (a[i].s[j]=='S')
b[18]++;
else if (a[i].s[j]=='T')
b[19]++;
else if (a[i].s[j]=='U')
b[20]++;
else if (a[i].s[j]=='V')
b[21]++;
else if (a[i].s[j]=='W')
b[22]++;
else if (a[i].s[j]=='X')
b[23]++;
else if (a[i].s[j]=='Y')
b[24]++;
else if (a[i].s[j]=='Z')
b[25]++;
}
}
p=0;
max=b[0];
for (i=0;i<26;i++)
{
if (b[i]>max)
{
p=i;
max=b[i];
}
}
c=(p+'A');
printf ("%c\n%d\n",c,max);
for (i=0;i<m;i++)
{
for (j=0;a[i].s[j]!='\0';j++)
{
if (a[i].s[j]==(p+'A'))
printf("%d\n",a[i].n);
}
}
return 0;
}
| 2 |
710 |
int main()
{
char m = 0;
int cnt[255], i, j, n;
struct {
int id;
char au[32];
} bk[1000];
memset(cnt, 0, sizeof(cnt));
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d%s", &bk[i].id, bk[i].au);
for (j = 0; bk[i].au[j]; j++)
if (++cnt[bk[i].au[j]] > cnt[m])
m = bk[i].au[j];
}
printf("%c\n%d\n", m, cnt[m]);
for (i = 0; i < n; i++)
if (strchr(bk[i].au, m))
printf("%d\n", bk[i].id);
return 0;
}
| 2 |
711 | int main()
{
int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;
char name[1002][27], a, max ;
cin >> m;
for (i = 0; i < m; i++)
{
cin >> book[i];
cin >> name[i];
l = strlen(name[i]);
for (j = 0; j < l; j++)
{
a = name[i][j];
cnt[a - 'A']++;
}
}
for (i = 0; i < 26; i++)
{
if (cnt[i] > n)
{
n = cnt[i];
max = i + 'A';
}
}
cout << max << endl;
cout << n << endl;
for (i = 0; i < m; i++)
{
l = strlen (name[i]);
for (j = 0; j < l; j++)
{
if (name[i][j] == max)
{
cout << book[i] << endl;
break;
}
}
}
return 0;
} | 2 |
712 | struct book
{int num;
char name[27];
struct book *next;
};
main()
{
struct book *p1,*p2,*head=NULL;
int i,j,n,m,k,a[26],max,first;
scanf("%d",&m);
for(i=0;i<m;i++)
{
p1=(struct book*)malloc(sizeof(struct book));
scanf("%d%s",&p1->num,p1->name);
if(i==0) head=p1;
else p2->next=p1;
p2=p1;
}
p2->next=NULL;
p1=head;
for(i=0;i<26;i++)
a[i]=0;
for(i=0;i<m;i++)
{
n=strlen(p1->name);
for(j=0;j<n;j++)
{k=p1->name[j]-'A';a[k]++;
}
p1=p1->next;
}
max=a[0];
first=0;
for(k=1;k<26;k++)
{if(a[k]>max) {max=a[k];
first=k;}
}
printf("%c\n",'A'+first);
printf("%d\n",max);
p1=head;
for(i=0;i<m;i++)
{
n=strlen(p1->name);
for(j=0;j<n;j++)
{
if(p1->name[j]=='A'+first) {printf("%d\n",p1->num);
break;}
}
p1=p1->next;
}
}
| 2 |
713 |
int main(int argc, char* argv[])
{char s[999][3][27];
int m,i,j,k,Nn[27],ctrl;
/*11111*/
scanf("%d",&m);
for(k=1;k<=m;k++){
scanf("%s",s[k][1]);
scanf("%s",s[k][2]);
}
/*2222*/
for(i=1;i<=26;i++)
Nn[i]=0;
for(i=1;i<=m;i++){
for(j=0;s[i][2][j]!='\0';j++){
if(s[i][2][j]=='A')Nn[1]++;
else if(s[i][2][j]=='B')Nn[2]++;
else if(s[i][2][j]=='C')Nn[3]++;
else if(s[i][2][j]=='D')Nn[4]++;
else if(s[i][2][j]=='E')Nn[5]++;
else if(s[i][2][j]=='F')Nn[6]++;
else if(s[i][2][j]=='G')Nn[7]++;
else if(s[i][2][j]=='H')Nn[8]++;
else if(s[i][2][j]=='I')Nn[9]++;
else if(s[i][2][j]=='J')Nn[10]++;
else if(s[i][2][j]=='K')Nn[11]++;
else if(s[i][2][j]=='L')Nn[12]++;
else if(s[i][2][j]=='M')Nn[13]++;
else if(s[i][2][j]=='N')Nn[14]++;
else if(s[i][2][j]=='O')Nn[15]++;
else if(s[i][2][j]=='P')Nn[16]++;
else if(s[i][2][j]=='Q')Nn[17]++;
else if(s[i][2][j]=='R')Nn[18]++;
else if(s[i][2][j]=='S')Nn[19]++;
else if(s[i][2][j]=='T')Nn[20]++;
else if(s[i][2][j]=='U')Nn[21]++;
else if(s[i][2][j]=='V')Nn[22]++;
else if(s[i][2][j]=='W')Nn[23]++;
else if(s[i][2][j]=='X')Nn[24]++;
else if(s[i][2][j]=='Y')Nn[25]++;
else if(s[i][2][j]=='Z')Nn[26]++;
}
}
/*33333*/int Nmax=0,zimuxu;
for(i=1;i<=26;i++){
if (Nn[i]>Nmax){Nmax=Nn[i];zimuxu=i;}
}
/*4444444*/
printf("%c\n",'A'+zimuxu-1);
printf("%d\n",Nmax);
/*5555*/
for(j=1;j<=m;j++){
ctrl=0;
for(k=0;s[j][2][k]!='\0';k++){
if(s[j][2][k]=='A'+zimuxu-1)ctrl++;
}
if(ctrl!=0)printf("%s\n",s[j][1]);
}
return 0;
}
| 2 |
714 | 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 |
715 | void main()
{
int n,i,best=0,max=0,a[26]={0},num[100],l,j,k;
char 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'},
writer[100][26];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&num[i],&writer[i]);
}
for(i=0;i<n;i++)
{
l=strlen(writer[i]);
for(j=0;j<l;j++)
{
for(k=0;k<26;k++)
{
if(writer[i][j]==letter[k]) {a[k]++;break;}
}
}
}
for(i=0;i<26;i++)
{
if(max<a[i])
{
best=i;max=a[i];
}
}
printf("%c\n",letter[best]);
printf("%d\n",max);
for(i=0;i<n;i++)
{
l=strlen(writer[i]);
for(j=0;j<l;j++)
{
if(writer[i][j]==letter[best])
{
printf("%d\n",num[i]);;break;
}
}
}
} | 2 |
716 | struct book{
int name;
char writer[100];
struct book *next;
};
int a[26];
struct book *creat(int n)
{
struct book *p1,*p2,*xhead;
p1=(struct book*)malloc(len);
scanf("%d %s",&p1->name,p1->writer);
p2=p1;
xhead=p1;
while(n-1)
{
n--;
p1=(struct book *)malloc(len);
scanf("%d %s",&p1->name,p1->writer);
p2->next=p1;
p2=p1;
}
p2->next=NULL;
return xhead;
}
void find(struct book*head)
{
struct book *p;
int i;
char s[100];
p=head;
while(p)
{
i=0;
strcpy(s,p->writer);
while(s[i]!='\0')
{a[s[i]-'A']++;
i++;
}
p=p->next;
}
}
void print(struct book *head,int max)
{
struct book *p;
p=head;
while(p)
{
if(strchr(p->writer,max+'A')) printf("%d\n",p->name);
p=p->next;
}
}
void main()
{
int i,max=0,n;
struct book *head;
memset(a,0,sizeof(a));
scanf("%d",&n);
head=creat(n);
find (head);
for(i=0;i<26;i++)
if(a[i]>a[max]) max=i;
printf("%c\n",max+'A');
printf("%d\n",a[max]);
print(head,max);
}
| 2 |
717 | 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 |
718 | struct
{int no;
char wri[27];
} book[1000];
void main()
{
int n,i,j,k=0,a[26]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&book[i].no,book[i].wri);
for(i=0;i<n;i++)
for(j=0;book[i].wri[j]!='\0';j++)
a[book[i].wri[j]-'A']++;
for(i=0;i<26;i++)
if(a[i]>a[0]){a[0]=a[i];k=i;}
printf("%c\n%d\n",'A'+k,a[0]);
for(i=0;i<n;i++)
for(j=0;book[i].wri[j]!='\0';j++)
if(book[i].wri[j]=='A'+k){printf("%d\n",book[i].no);break;}
} | 2 |
719 |
int main()
{
char mname[999][26], name;
int i, j, m, len, max = 0;
int num[999], count[26] = {0};
cin >> m;
for (i = 0; i < m; i++)
{
cin >> num[i] >> mname[i];
len = strlen(mname[i]);
for (j = 0; j < len; j++)
{
count[mname[i][j] - 'A']++;
}
}
for (i = 0; i < 26; i++)
{
if (count[i] > max)
{
max = count[i];
name = i + 'A';
}
}
cout << name << endl << max << endl;
for (i = 0; i < m; i++)
{
len = strlen(mname[i]);
for (j = 0; j < len; j++)
{
if (mname[i][j] == name)
{
cout << num[i] << endl;
break;
}
}
}
return 0;
}
| 2 |
720 | void main()
{
char book[1000][30];
int n,i,j,k,r,len[1000],a[26][1000]={0},b[26]={0},max,s,c[26];
scanf("%d",&n);
for(i=0;i<=n;i++)
{
gets(book[i]);
scanf("\n");
}
for(i=0;i<=n;i++)
for(j=0;book[i][j]!=' ';j++)
len[i]=j;
for(k=0;k<26;k++)
{
r=0;
for(i=0;i<=n;i++)
{
for(j=len[i]+1;j<strlen(book[i]);j++)
{
if(book[i][j]==k+65)
{
b[k]++;
a[k][r]=i;
r++;
}
}
}
c[k]=r;
}
max=b[0];
for(i=1;i<26;i++)
{
if(b[i]>=max)
{
max=b[i];
s=i;
}
}
printf("%c\n",s+65);
printf("%d\n",max);
for(i=0;i<c[s];i++)
{
for(j=0;j<=len[a[s][i]];j++)
printf("%c",book[a[s][i]][j]);
printf("\n");
}
}
| 2 |
721 | struct book
{
int num;
char w[100];
}book[100];
void main()
{
int i,j,k,l,m,n,p,b[26]={0};
scanf ("%d\n",&n);
for (i=0;i<n;i++)
{
scanf ("%d %s",&book[i].num,book[i].w);
}
for (i=0;i<n;i++)
{
for (j=0;book[i].w[j]!='\0';j++)
{
if (book[i].w[j]=='A') b[0]++;
else if (book[i].w[j]=='B') b[1]++;
else if (book[i].w[j]=='C') b[2]++;
else if (book[i].w[j]=='D') b[3]++;
else if (book[i].w[j]=='E') b[4]++;
else if (book[i].w[j]=='F') b[5]++;
else if (book[i].w[j]=='G') b[6]++;
else if (book[i].w[j]=='H') b[7]++;
else if (book[i].w[j]=='I') b[8]++;
else if (book[i].w[j]=='J') b[9]++;
else if (book[i].w[j]=='K') b[10]++;
else if (book[i].w[j]=='L') b[11]++;
else if (book[i].w[j]=='M') b[12]++;
else if (book[i].w[j]=='N') b[13]++;
else if (book[i].w[j]=='O') b[14]++;
else if (book[i].w[j]=='P') b[15]++;
else if (book[i].w[j]=='Q') b[16]++;
else if (book[i].w[j]=='R') b[17]++;
else if (book[i].w[j]=='S') b[18]++;
else if (book[i].w[j]=='T') b[19]++;
else if (book[i].w[j]=='U') b[20]++;
else if (book[i].w[j]=='V') b[21]++;
else if (book[i].w[j]=='W') b[22]++;
else if (book[i].w[j]=='X') b[23]++;
else if (book[i].w[j]=='Y') b[24]++;
else if (book[i].w[j]=='Z') b[25]++;
}
}
for (i=0;i<=25;i++)
{
for (j=0;j<26;j++)
{
if (b[i]<b[j])
break;
}
if (j==26)
{
printf ("%c\n%d\n",65+i,b[i]);
break;
}
}
for (j=0;j<n;j++)
{
for (l=0;book[j].w[l]!='\0';l++)
{
if (book[j].w[l]==65+i)
{
printf ("%d\n",book[j].num);
break;
}
}
}
} | 2 |
722 |
int main()
{
int num[110],m,ni = 0,n = 0,maxn[30]={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,0,0,0,0};
char au[110][30],max[30];
cin >> m;
int i,j;
for (i = 0; i < m; i ++)
{
cin >> num[i];
cin >> au[i];
}
for (i = 0; i < m; i ++)
{
for (j = 0; au[i][j] != '\0';j++)
{
if (au[i][j] == 'A') maxn[0] ++;
if (au[i][j] == 'B') maxn[1] ++;
if (au[i][j] == 'C') maxn[2] ++;
if (au[i][j] == 'D') maxn[3] ++;
if (au[i][j] == 'E') maxn[4] ++;
if (au[i][j] == 'F') maxn[5] ++;
if (au[i][j] == 'G') maxn[6] ++;
if (au[i][j] == 'H') maxn[7] ++;
if (au[i][j] == 'I') maxn[8] ++;
if (au[i][j] == 'J') maxn[9] ++;
if (au[i][j] == 'K') maxn[10] ++;
if (au[i][j] == 'L') maxn[11] ++;
if (au[i][j] == 'M') maxn[12] ++;
if (au[i][j] == 'N') maxn[13] ++;
if (au[i][j] == 'O') maxn[14] ++;
if (au[i][j] == 'P') maxn[15] ++;
if (au[i][j] == 'Q') maxn[16] ++;
if (au[i][j] == 'R') maxn[17] ++;
if (au[i][j] == 'S') maxn[18] ++;
if (au[i][j] == 'T') maxn[19] ++;
if (au[i][j] == 'U') maxn[20] ++;
if (au[i][j] == 'V') maxn[21] ++;
if (au[i][j] == 'W') maxn[22] ++;
if (au[i][j] == 'X') maxn[23] ++;
if (au[i][j] == 'Y') maxn[24] ++;
if (au[i][j] == 'Z') maxn[25] ++;
}
}
for (i = 0; i < 26; i ++)
{
if (maxn[i] > n) {n = maxn[i];ni = i;}
}
cout << (char)(ni+65) << endl;
cout << n << endl;
for (i = 0 ; i < m; i ++)
{
for ( j = 0;au[i][j] != '\0';j ++)
{
if (au[i][j] == 65+ni) cout << num[i] << endl;
}
}
return 0;
} | 2 |
723 | struct author
{
char name[26];
int num;
struct author *next;
};
void main()
{
int i,n,a[26],j,t;
struct author *head;
struct author *p1,*p2;
p1=p2=(struct author *)malloc(LEN);
head=NULL;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&p1->num,p1->name);
if(i==0) head=p1;
else p2=p1;
if(i!=(n-1)) p1=p2->next=(struct author*)malloc(LEN);
else {p2->next=NULL;}
}
for(i=0;i<26;i++)
{
a[i]=0;
}
p1=head;
for(p1=head;p1!=NULL;p1=p1->next)
{
for(j=0;j<strlen(p1->name);j++)
{
a[p1->name[j]-'A']++;
}
}
t=0;
for(i=0;i<26;i++)
{
if(a[i]>a[t]) t=i;
}
printf("%c\n%d\n",t+'A',a[t]);
for(p1=head;p1!=NULL;p1=p1->next)
{
for(j=0;j<strlen(p1->name);j++)
{
if(p1->name[j]==t+'A') printf("%d\n",p1->num);continue;
}
}
}
| 2 |
724 |
void main()
{
int num=0,n,a[26],name[1000],name2[1000],i,j,k,max=0,maxi=0;
char wr[1000][27];
char q;
scanf("%d",&n);
for (i=0;i<26;i++)
{
a[i]=0;
}
for(i=0;i<n;i++)
{
scanf("%d%s",&(name[i]),wr[i]);
for (j=0;j<26;j++)
{
for (k=0;k<26;k++)
{
if (wr[i][j]=='A'+k) a[k]++;
}
}
}
for (i=0;i<26;i++)
{
if (a[i]>max)
{
max=a[i];
maxi=i;
}
}
q='A'+maxi;
printf("%c\n",q);
for (i=0;i<n;i++)
{
for (j=0;j<26;j++)
{
if (wr[i][j]==q)
{
name2[num]=name[i];
num++;
}
}
}
printf("%d\n",num);
for (i=0;i<num;i++) printf("%d\n",name2[i]);
} | 2 |
725 |
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 |
726 | void main()
{
struct book
{
int num;
char author[27];
struct book *next;
}*head = 0,*p1,*p2;
int total,i,j,sumbook[26]={0},len,max;
scanf("%d",&total);
for(i=0;i<total;i++)
{
p1=(struct book *)malloc(sizeof(struct book));
if(p1==0)
{
printf("Memory request failed!\n");
exit(-1);
}
scanf("%d %s",&p1->num,p1->author);
len = strlen(p1->author);
for(j = 0;j<len;j++)
sumbook[p1->author[j]-'A']++;
if(head)
p2->next=p1;
else
head=p1;
p2=p1;
}
p1->next=0;
len = 0;
for(i = 0;i<26;i++)
{
if(sumbook[i]>len)
{
len = sumbook[i];
max = i;
}
}
printf("%c\n%d\n",max+'A',sumbook[max]);
max += 'A';
for(p1=head;p1;p1=p1->next)
{
len = strlen(p1->author);
for(i = 0;i<len;i++)
{
if(p1->author[i]==max)
{
printf("%d\n",p1->num);
break;
}
}
}
} | 2 |
727 |
struct book
{
int num;
char name[100];
struct book *next;
};
struct book *creat(int n)
{
int k=1;
struct book *head,*p1,*p2,*p;
p1=(struct book *)malloc(sizeof(struct book));
head=p1;p2=p1;p=p1;
scanf("%d %s",&p1->num,p1->name);
p1->next=NULL;
do
{
p1=(struct book *)malloc(sizeof(struct book));
scanf("%d %s",&p1->num,p1->name);
p2->next=p1;
p2=p1;
p1->next=NULL;
k++;
}while(k<n);
return head;
}
int main(void)
{
struct book *head,*p;
char *q;
int *s;
int n,i,j,max=0;
s=(int *)malloc(26*sizeof(int));
for(i=0;i<26;i++)
*(s+i)=0;
scanf("%d",&n);
head=creat(n);
p=head;
while(p)
{
q=p->name;
while(*q!='\0')
{ *(s+*(q)-'A')+=1;q++;}
p=p->next;
}
max=0;
for(i=0;i<26;i++)
if(*(s+i)>max)
max=*(s+i);
for(i=0;i<26;i++)
if(*(s+i)==max) break;
printf("%c\n%d\n",'A'+i,max);
p=head;
while(p)
{
q=p->name;
if(strchr(q,'A'+i)!=NULL)
printf("%d\n",p->num);
p=p->next;
}
}
| 2 |
728 | int main ()
{
int n,i,j,m,t,g,max;
char q;
int d[26];
struct
{
int a;
char b[26];
}s[999];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%s",&s[i].a,s[i].b);
}
for(i=0;i<26;i++)
{
d[i]=0;
}
for(i=0;i<n;i++)
{
m=strlen(s[i].b);
for(j=0;j<m;j++)
{
t=s[i].b[j]-'A';
d[t]++;
}
}
max=0;
for(j=0;j<25;j++)
{
if(d[j]>max)
{
max=d[j];
g=j;
}
}
q='A'+g;
printf("%c\n%d\n",q,max);
for(i=0;i<n;i++)
{
m=strlen(s[i].b);
for(j=0;j<m;j++)
{
if(s[i].b[j]-'A'==g)
{
printf("%d\n",s[i].a);
}
}
}
return 0;
}
| 2 |
729 | 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 |
730 | int main()
{
int n,d,i,j,l;
struct a
{
char name[27];
int c;
}m[1000];
struct b
{
int num,book[1000];
char t;
};
struct b author[27];
for(i=1;i<=26;i++)
{
author[i].t=i+64;
}
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&m[i].c);
scanf("%s",m[i].name);
}
for(i=1;i<=n;i++)
{
l=strlen(m[i].name);
for(j=0;j<=l-1;j++)
{
d=m[i].name[j]-64;
author[d].num++;
author[d].book[author[d].num]=m[i].c;
}
}
for(i=1;i<=25;i++)
{
if(author[i].num>author[i+1].num)
author[i+1]=author[i];
}
printf("%c\n",author[26].t);
printf("%d\n",author[26].num);
for(i=1;i<=author[26].num;i++)
{
printf("%d\n",author[26].book[i]);
}
return 0;
}
| 2 |
731 |
int main()
{
int a;
scanf("%d",&a);
char zuozhe[100][100];
int shuhao[100];
int zuo[200];
int shu[200][200];
int n=0,p,i,j;
int m[200];
for(i=0;i<200;i++)
{ zuo[i]=0;
m[i]=0;
}
for(i=0;i<a;i++)
{
scanf("%d %s",&shuhao[i],zuozhe[i]);
}
for(i=0;i<a;i++)
{
for(j=0;(zuozhe[i][j])!='\0';j++)
{
zuo[(zuozhe[i][j])]=zuo[(zuozhe[i][j])]+1;
shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])]=shuhao[i];
m[(zuozhe[i][j])]=m[(zuozhe[i][j])]+1;
}
}
for(i=65;i<=90;i++)
{
if(zuo[i]>n)
{
n=zuo[i];
p=i;
}
}
printf("%c\n",p);
printf("%d\n",zuo[p]);
for(i=0;i<m[p];i++)
{
printf("%d\n",shu[p][i]);
}
return 0;
}
| 2 |
732 | 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 |
733 | int main()
{
struct book
{
int No;
char name[27];
}b[1000];
int i,j,m;
scanf("%d",&m);
printf("\n");
for(i=0;i<m;i++){
scanf("%d ",&b[i].No);
scanf("%s",b[i].name);
}
int n,l,a[26]={0};
for(i=0;i<m;i++){
l=strlen(b[i].name);
for(j=0;j<l;j++){
n=b[i].name[j];a[n-65]++;
}
}
int max=0,x;
for(i=0;i<26;i++){
if(a[i]>max){max=a[i];x=i;}
}
printf("%c\n%d",x+65,max);
for(i=0;i<m;i++){
l=strlen(b[i].name);
for(j=0;j<l;j++){
if(b[i].name[j]==x+65){printf("\n%d",b[i].No);break;}
}
}
return 0;
}
| 2 |
734 | //
// main.cpp
// ????
//
// Created by ???? on 13-12-25.
// Copyright (c) 2013? ????. All rights reserved.
//
int main()
{
struct author_book
{
int count;
int book[999];
} au[26];
for(int k=0;k<26;k++)
{
au[k].count=0;
}
int m;
cin>>m;
for(int i=1;i<=m;i++)
{
int num;
char a[26];
cin>>num;
cin.get();
cin.getline(a,26);
for(int k=0;k<strlen(a);k++)
{
int author_r=(int)(a[k]-'A');//?????
au[author_r].book[ au[author_r].count ]=num;
au[author_r].count++;
}
}
//find the max
int max=0;
int the_one=0;
for(int i=0;i<26;i++)
{
//cout<<au[i].count<<endl;
if(au[i].count>max)
{
max=au[i].count;
the_one=i;
}
}
//cout author
char maxau='A'+the_one;
cout<<maxau<<endl;
cout<<au[the_one].count<<endl;
//cout his books
for(int i=0;i<au[the_one].count;i++)
{
cout<<au[the_one].book[i]<<endl;
}
return 0;
} | 2 |
735 | 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 |
736 | struct book
{
char num[500];
char s[50];
struct book *next;
};
void main()
{
struct book *head;
struct book *p1,*p2;
int m,mi,i,j,k,max,found;
int aut[26]={0};
scanf("%d",&m);
p1=(struct book*)malloc(LEN);
scanf("%s %s",p1->num,p1->s);
for(i=0;i<strlen(p1->s);i++)
aut[(p1->s)[i]-'A']++;
p1->next=NULL;
head=p2=p1;
for(mi=2;mi<=m;mi++)
{
p1=(struct book*)malloc(LEN);
scanf("%s %s",p1->num,p1->s);
for(i=0;i<strlen(p1->s);i++)
aut[(p1->s)[i]-'A']++;
p2->next=p1;
p2=p1;
}
p2->next=NULL;
max=0;
for(i=0;i<26;i++)
if(aut[i]>max)
{
k=i;
max=aut[i];
}
printf("%c\n",k+65);
printf("%d\n",aut[k]);
p1=head;
for(i=1;i<=m;i++)
{
found=0;
for(j=0;j<strlen(p1->s);j++)
if((p1->s)[j]==k+65)
{
found=1;
break;
}
if(found==1) printf("%s\n",p1->num);
p1=p1->next;
}
} | 2 |
737 |
struct record
{
int id;
};
struct YyxNode
{
struct record m_rec;
struct YyxNode *next;
};
struct YyxLink
{
int n;
struct YyxNode *head;
struct YyxNode *tail;
};
struct YyxLink *CreateNewLink()
{
struct YyxLink *newLn;
struct YyxNode *newNd;
if(((newLn=(struct YyxLink*)malloc(sizeof(struct YyxLink)))==NULL)
||((newNd=(struct YyxNode*)malloc(sizeof(struct YyxNode)))==NULL)){
printf("Error: memory out! (1)");
exit(-1);
}
newLn->n = 0;
newLn->head = newNd;
newNd->next = NULL;
newLn->tail = newNd;
return newLn;
}
struct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec)
{
struct YyxNode *newNd;
if((newNd=(struct YyxNode*)malloc(sizeof(struct YyxNode)))==NULL){
printf("Error: memory out! (2)");
exit(-1);
}
newNd->m_rec = *rec;
newNd->next = NULL;
ln->tail->next = newNd;
ln->tail = newNd;
ln->n ++;
return ln;
}
struct YyxLink *ClearLink(struct YyxLink *ln)
{
struct YyxNode *delNd, *nextNd;
delNd = ln->head->next;
for(; delNd!=NULL; delNd=nextNd){
nextNd = delNd->next;
free(delNd);
}
ln->n = 0;
ln->head->next = NULL;
return ln;
}
void FreeLink(struct YyxLink *ln)
{
ClearLink(ln);
free(ln->head);
free(ln);
}
int main()
{
struct YyxLink **total;
int m;
struct record rec;
char author[27];
int i;
char *pch;
struct YyxNode *nd;
if((total=(struct YyxLink**)malloc(26*sizeof(struct YyxLink*)))==NULL){
printf("Error: memory out! (3)\n");
exit(-1);
}
for(i=0; i<26; i++){
total[i] = CreateNewLink();
}
scanf("%d", &m);
for(; m>0; m--){
scanf("%d %s", &rec.id, author);
pch = author;
for(; *pch!='\0'; pch++){
AddNode(total[*pch-'A'], &rec);
}
}
m = 0;
for(i=1; i<26; i++){
if(total[m]->n<total[i]->n)
m = i;
}
printf("%c\n%d\n", m+'A', total[m]->n);
nd = total[m]->head->next;
for(; nd!=NULL; nd=nd->next){
printf("%d\n", nd->m_rec);
}
return 0;
} | 2 |
738 |
char f(int y);
int main()
{
int m,i,j,number[1000],auther[26],total=0;
char name[1000][27];
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d %s",&number[i],name[i]);
int n;
n=strlen(name[i]);
for(j=0;j<n;j++){
switch(name[i][j]){
case'A':auther[0]++;break;
case'B':auther[1]++;break;
case'C':auther[2]++;break;
case'D':auther[3]++;break;
case'E':auther[4]++;break;
case'F':auther[5]++;break;
case'G':auther[6]++;break;
case'H':auther[7]++;break;
case'I':auther[8]++;break;
case'J':auther[9]++;break;
case'K':auther[10]++;break;
case'L':auther[11]++;break;
case'M':auther[12]++;break;
case'N':auther[13]++;break;
case'O':auther[14]++;break;
case'P':auther[15]++;break;
case'Q':auther[16]++;break;
case'R':auther[17]++;break;
case'S':auther[18]++;break;
case'T':auther[19]++;break;
case'U':auther[20]++;break;
case'V':auther[21]++;break;
case'W':auther[22]++;break;
case'X':auther[23]++;break;
case'Y':auther[24]++;break;
case'Z':auther[25]++;break;
}
}
}
int max=auther[0],k,t=0;
for(k=1;k<26;k++){
if(auther[k]>max){
max=auther[k];
t=k;
}
}
printf("%c\n",f(t));
for(i=0;i<m;i++){
int q;
q=strlen(name[i]);
for(j=0;j<q;j++){
if(name[i][j]==f(t))
total++;
}
}
printf("%d\n",total);
for(i=0;i<m;i++){
int p;
p=strlen(name[i]);
for(j=0;j<p;j++){
if(name[i][j]==f(t))
printf("%d\n",number[i]);
}
}
return 0;
}
char f(int y){
char x;
switch(y){
case 0:x='A';break;
case 1:x='B';break;
case 2:x='C';break;
case 3:x='D';break;
case 4:x='E';break;
case 5:x='F';break;
case 6:x='G';break;
case 7:x='H';break;
case 8:x='I';break;
case 9:x='J';break;
case 10:x='K';break;
case 11:x='L';break;
case 12:x='M';break;
case 13:x='N';break;
case 14:x='O';break;
case 15:x='P';break;
case 16:x='Q';break;
case 17:x='R';break;
case 18:x='S';break;
case 19:x='T';break;
case 20:x='U';break;
case 21:x='V';break;
case 22:x='W';break;
case 23:x='X';break;
case 24:x='Y';break;
case 25:x='Z';break;
}
return x;
}
| 2 |
739 | 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 |
740 |
struct author
{
int number;
char name[26];
}
author[999];
struct single
{
char letter[1];
int number;
}
single[26];
int main(int argc, char* argv[])
{
int n, i, m, j, p, k, book[999];
for(i=0;i<26;i++)
{
single[i].letter[0]=65+i;
single[i].number=0;
}
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&author[i].number,&author[i].name);
}
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
for(k=0;k<26;k++)
{
if(single[k].letter[0]==author[i].name[j])
single[k].number++;
}
}
}
m=0;
p=single[0].number;
for(i=1;i<26;i++)
{
if(p<single[i].number)
{
p=single[i].number;
m=i;
}
}
k=0;
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(author[i].name[j]==single[m].letter[0])
{
book[k]=author[i].number;
k++;
}
}
}
printf("%c\n",single[m].letter[0]);
printf("%d\n",k);
for(i=0;i<k;i++)
{
printf("%d\n",book[i]);
}
return 0;
}
| 2 |
741 | 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 |
742 |
int main()
{
int m;
int book[1020];
scanf("%d",&m);
int i;
char c;
int a[27]={0};
int b[27][1000]={0};
for(i=1;i<=m;i++)
{
scanf("%d",&book[i]);
getchar();
for(;;)
{
scanf("%c",&c);
if(c=='\n') break;
a[c-64]+=1;
b[c-64][i]=1;
}
}
int max=0,p;
for(i=1;i<27;i++)
{
if(a[i]>max)
{
max=a[i];
p=i;
}
}
printf("%c\n%d\n",p+64,max);
for(i=0;i<1000;i++)
{
if(b[p][i]==1) printf("%d\n",book[i]);
}
return 0;
} | 2 |
743 |
void main()
{
int m,t,len,a[26][MAX]={0},n[26]={0},max=0,num;
int i,j;
char s[27];
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d %s",&t,s);
len=strlen(s);
for(j=0;j<len;j++){
n[s[j]-65]++;
a[s[j]-65][i]=t;
}
}
for(j=0;j<26;j++){
if(n[j]>max){
max=n[j];
num=j;
}
}
printf("%c\n%d\n",num+65,n[num]);
for(i=0;i<m;i++){
if(a[num][i]!=0)
printf("%d\n",a[num][i]);
}
} | 2 |
744 |
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 |
745 | int main()
{
int x[26]={0};
char c;
struct books
{
int number;
char name[27];
};
struct books book[1000];
int n,i,j,t,max=0;
struct books *p;
scanf("%d",&n);
for(p=book;p<book+n;p++)
scanf("%d%s",&p->number,p->name);
for(p=book;p<book+n;p++)
for(j=0;j<26;j++)
for(i=65;i<=90;i++)
if(p->name[j]==i)
x[i-65]++;
for(i=0;i<26;i++)
if(x[i]>max)
max=x[i];
for(i=0;i<26;i++)
if(x[i]==max)
break;
c=i+65;
printf("%c\n%d\n",c,max);
for(i=0;i<n;i++)
for(j=0;j<26;j++)
if(book[i].name[j]==c)
{
printf("%d\n",book[i].number);
break;
}
return 0;
}
| 2 |
746 |
struct bo{
char id[10];
char au[100];
};
int main(){
int n,i,j,max;
char maxa;
struct bo *book;
int auth[26];
memset(auth,0,sizeof(int)*26);
scanf("%d",&n);
book=(struct bo *)malloc(sizeof(struct bo)*n);
for(i=0;i<n;i++){
scanf("%s%s",book[i].id,book[i].au);
for(j=0;book[i].au[j];j++){
auth[book[i].au[j]-'A']++;
}
}
max=0;
for(i=0;i<26;i++)
{
if(max<auth[i]) {
max=auth[i];
maxa=i+'A';
}
}
printf("%c\n",maxa);
printf("%d\n",max);
for(i=0;i<n;i++){
if(strchr(book[i].au,maxa))
printf("%s\n",book[i].id);
}
return 0;
} | 2 |
747 | int main()
{
int m,i,j,max=0;
int Q[26]={0};
struct
{
int num;
char name[27];
}book[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d %s",&book[i].num,book[i].name);
for(i=0;i<m;i++)
{
for(j=0;j<strlen(book[i].name);j++)
{
switch(book[i].name[j])
{
case 'A':
Q[0]++;
break;
case 'B':
Q[1]++;
break;
case 'C':
Q[2]++;
break;
case 'D':
Q[3]++;
break;
case 'E':
Q[4]++;
break;
case 'F':
Q[5]++;
break;
case 'G':
Q[6]++;
break;
case 'H':
Q[7]++;
break;
case 'I':
Q[8]++;
break;
case 'J':
Q[9]++;
break;
case 'K':
Q[10]++;
break;
case 'L':
Q[11]++;
break;
case 'M':
Q[12]++;
break;
case 'N':
Q[13]++;
break;
case 'O':
Q[14]++;
break;
case 'P':
Q[15]++;
break;
case 'Q':
Q[16]++;
break;
case 'R':
Q[17]++;
break;
case 'S':
Q[18]++;
break;
case 'T':
Q[19]++;
break;
case 'U':
Q[20]++;
break;
case 'V':
Q[21]++;
break;
case 'W':
Q[22]++;
break;
case 'X':
Q[23]++;
break;
case 'Y':
Q[24]++;
break;
case 'Z':
Q[25]++;
break;
}
}
}
for(i=1;i<26;i++)
{
if(Q[i]>Q[max])
max=i;
}
printf("%c\n%d\n",max+65,Q[max]);
for(i=0;i<m;i++)
{
for(j=0;j<strlen(book[i].name);j++)
{
if(book[i].name[j]==max+65)
{
printf("%d\n",book[i].num);
break;
}
}
}
return 0;
} | 2 |
748 |
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 |
749 |
struct node //??????
{
int num;
char name[26];
struct node *next;
};
int n=1,m;
struct zuozhe
{
char name;
int books[300];
int num;
}zuozhe[26];
struct node *getlinked()
{
struct node *head,*newnode,*thisnode;
// printf("Please input the number and data (-1 -1 to end):\n");
do
{
newnode=(struct node *)malloc(sizeof(struct node)); //??????????
if(newnode==NULL) //malloc???
{
printf("malloc failed");
exit(-1);
}
scanf("%d%s",&newnode->num,&newnode->name);
newnode->next=NULL;
if(n==1) //???????????thisnode?head????newnode
{
thisnode=newnode;
head=newnode;
}
else //?????????????
{
thisnode->next=newnode;
}
if(n<=m)
{
thisnode=newnode; //????
n++; //????
}
}while(n<=m);
return head;
}
void tongji(struct node *p,int n)
{
int i,j;
for(i=1;i<=n;i++)
{
for(j=0;j<strlen(p->name);j++)
{
zuozhe[(p->name)[j]-'A'].books[zuozhe[(p->name)[j]-'A'].num]=p->num;
zuozhe[(p->name)[j]-'A'].num++;
}
p=p->next;
}
}
void bubble(struct zuozhe array[],int n)
{
int i=0,pass;
struct zuozhe temp;
for(pass=1;pass<=n;pass++)
{
for(i=0;i<n-pass;i++)
{
if(array[i].num<array[i+1].num)
{
temp=array[i];
array[i]=array[i+1];
array[i+1]=temp;
}
}
}
return;
}
void main()
{
struct node *p;
int i;
scanf("%d",&m);
p=getlinked();
for(i=0;i<26;i++)
{
zuozhe[i].name='A'+i;
zuozhe[i].num=0;
}
tongji(p,m);
bubble(zuozhe,26);
printf("%c\n%d\n",zuozhe[0].name,zuozhe[0].num);
for(i=0;i<zuozhe[0].num;i++)
{
printf("%d\n",zuozhe[0].books[i]);
}
} | 2 |
750 | 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 |
751 | int main()
{
char a[1000][26], t;
int b[1000], num[26] = {0}, n, i, j, k, max, l[1000];
cin >> n;
max = 0;
for (i = 1; i <= n; i++)
{
cin >> b[i];
gets(a[i]);
l[i] = strlen(a[i]);
for (j = 1; j <= l[i]; j++)
num[a[i][j] - 'A']++;
}
for (i = 0; i <= 25; i++)
if (num[i] > max)
{
max = num[i];
t = i + 'A';
}
cout << t << endl;
cout << max << endl;
for (i = 1; i <= n; i++)
for (j = 1; j <= l[i]; j++)
if (a[i][j] == t)
cout << b[i] << endl;
return 0;
} | 2 |
752 |
int main(){
struct book {
char z[27];
int no;
};
struct book a[1000];
int m, i, x, p, j ;
scanf("%d", &m);
for (i=0; i<m; i++){
scanf("%d%s", &a[i].no, a[i].z);
}
int memo[26]={0};
for (i=0; i<m; i++){
for (j=0; j<26; j++){
if (a[i].z[j]=='\0')
break;
x=(a[i].z[j])-65;
memo[x]++;
}
}
x=0;
p=0;
for (i=0; i<26; i++){
if (memo[i]>x){x=memo[i];
p=i;
}
}
printf("%c\n", p+65);
int n=0;
for (i=0; i<m; i++){
for (j=0; j<26; j++){
if (a[i].z[j]=='\0')
break;
if (a[i].z[j]==p+65)
n++;
}
}
printf("%d\n", n);
for (i=0; i<m; i++){
for (j=0; j<26; j++){
if (a[i].z[j]=='\0')
break;
if (a[i].z[j]==p+65){
printf("%d\n", a[i].no);
break;}
}
}
return 0;
}
| 2 |
753 | int main()
{
struct fy{
int x;
char y[26];
int s[26];
struct fy *z;
}sl[1000],*p;
int n,i,j,b[26]={0};
char a[100];
p=&sl[0];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&sl[i].x,sl[i].y);
for(j=0;j<strlen(sl[i].y);j++)
{
sl[i].s[sl[i].y[j]-'A']=1;
b[sl[i].y[j]-'A']++;
}
sl[i].z=&sl[i+1];
}
sl[n-1].z=NULL;
for(i=0;i<26;i++)
{
for(j=0;j<26;j++)
if(b[i]<b[j])
break;
if(j==26)
{
j=i;
break;
}
}
printf("%c\n%d\n",i+'A',b[j]);
while(p!=NULL)
{
if(p->s[i]==1)
printf("%d\n",p->x);
p=p->z;
}
return 0;
} | 2 |
754 | void main()
{
int len[1000];
int b[26];
int a[1000];
char str[1000][26];
int m,i,j,max,num;
char c;
int pos,temp;
scanf("%d",&m);
for(i=0;i<26;i++)
b[i]=0;
for(i=0;i<m;i++)
{
scanf("%d ",&a[i]);
scanf("%s",str[i]);
len[i]=strlen(str[i]);
for(j=0;j<len[i];j++)
{
temp=str[i][j]-'A';
b[temp]++;
}
}
max=b[0];
pos=0;
for(i=1;i<26;i++)
{
if(b[i]>max)
{
max=b[i];
pos=i;
}
}
c=pos+'A';
printf("%c\n",c);
printf("%d\n",max);
num=0;
for(i=0;i<m;i++)
for(j=0;j<len[i];j++)
if(str[i][j]==c)
{
num++;
if(num<max)
printf("%d\n",a[i]);
else printf("%d",a[i]);
}
} | 2 |
755 | 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 |
756 | void main()
{
int n,i,j;
int max,p;
int mwj;
int shu[1000];
char zuo[1000][30];
int w[26];
for(i=0;i<26;i++)
w[i]=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&shu[i],zuo[i]);
for(j=0;j<strlen(zuo[i]);j++)
{
w[(zuo[i][j]-65)]=w[(zuo[i][j]-65)]+1;
}
}
max=w[0];p=0;
for(i=0;i<26;i++)
{
if(w[i]>max)
{
max=w[i];
p=i;
}
}
printf("%c\n",p+65);
printf("%d\n",max);
for(i=0;i<n;i++)
{
for(j=0;j<strlen(zuo[i]);j++)
{
mwj=zuo[i][j];
if(mwj==p+65)
{
printf("%d\n",shu[i]);
break;
}
}
}
}
| 2 |
757 |
int main(){
int n,i,j,k,b[999],max=0,a[27],x;
char w,c[999][26],d[27];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %s",&b[i],c[i]);
}
for(i=0;i<27;i++)
{a[i]=0;}
for(i=0;i<n;i++){
for(j=0;j<26;j++){
for(k=65;k<91;k++){
if(c[i][j]==k)
a[k-64]++;
}
}
}
for(i=1;i<27;i++){
if(a[i]>max)
{max=a[i];
x=i;}
}
w=x+64;
printf("%c\n",w);
printf("%d\n",max);
for(i=0;i<n;i++){
for(j=0;j<26;j++){
if(c[i][j]==x+64)
{printf("%d\n",b[i]);
break;}
}
}
return 0;
}
| 2 |
758 | void main()
{
int n,i,j,l,a[100],b[26],s,max;
char c[100][50],m;
for(i=0;i<=25;i++)
b[i]=0;
scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
scanf("%d%s",&a[i],c[i]);
l=strlen(c[i]);
for(j=0;j<=l-1;j++)
{s=(int)c[i][j]-65;
b[s]=b[s]+1;}}
max=b[0];
j=0;
for(i=0;i<=25;i++)
{ if(b[i]>max)
{max=b[i];
j=i;}}
m=j+65;
printf("%c\n",m);
printf("%d\n",max);
for(i=0;i<=n-1;i++)
{ l=strlen(c[i]);
for(j=0;j<=l-1;j++)
if(c[i][j]==m)
printf("%d\n",a[i]);
}
}
| 2 |
759 | void main()
{
int n,m,i,j,k,t,max=0;
int a[1000],b[26]={0};
char s[1000][30];
char c;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&a[i],s[i]);
for(i=0;i<n;i++)
{
m=strlen(s[i]);
for(j=0;j<m;j++)
{
t=s[i][j]-65;
b[t]++;
}
}
for(i=0;i<26;i++)
if(b[i]>=max) max=b[i];
for(i=0;i<26;i++)
{
if(b[i]==max)
{
k=i;
c=i+65;
printf("%c\n",c);
printf("%d\n",max);
}
}
for(i=0;i<n;i++)
{
m=strlen(s[i]);
for(j=0;j<m;j++)
if(s[i][j]==65+k) printf("%d\n",a[i]);
}
} | 2 |
760 | int main()
{
int n,i,j;
cin >> n;
char number[1000][5]={' '};
char authors[1000][30]={' '};
int author[30]={0};
for (i=0;i<=n-1;i++)
{
cin >> number[i] >> authors[i];
int len1=strlen(authors[i]);
for (j=0;j<=len1-1;j++)
{
author[authors[i][j]-'A']++;
}
}
int k,kmax=0;
int max=author[0];
for (k=1;k<=25;k++)
{
if (author[k]>max)
{
max=author[k];
kmax=k;
}
}
char writer=kmax+'A';
cout << writer << endl;
cout << max << endl;
for (i=0;i<=n-1;i++)
{
for (j=0;j<=25;j++)
{
if (authors[i][j]-'A'==kmax)
{
cout << number[i] << endl;
break;
}
}
}
return 0;
} | 2 |
761 | 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 |
762 |
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 |
763 |
int main()
{
struct book
{
int No;
char author[27];
int yes;
struct book *next;
};
struct book*head,*p;
int m,i,*max;
int *count;
count=(int*)malloc(26*sizeof(int));
for(i=0;i<26;i++)
*(count+i)=0;
p=(struct book*)malloc(sizeof(struct book));
head=p;
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d%s",&p->No,p->author);
if(i==m-1) p->next=NULL;
else p->next=(struct book*)malloc(sizeof(struct book));
p=p->next;
}
p=head;
while(p!=NULL)
{
char *point;
point=p->author;
while(*point!='\0')
{
(*(count+((*point)-65)))++;
point++;
}
p=p->next;
}
max=count;
for(i=0;i<26;i++)
if(*(count+i)>*max) max=count+i;
printf("%c\n",max-count+65);
printf("%d\n",*max);
p=head;
while(p!=NULL)
{
char *point;
point=p->author;
while(*point!='\0')
{
if(*point==max-count+65) printf("%d\n",p->No);
point++;
}
p=p->next;
}
return 0;
} | 2 |
764 | int main()
{
struct tushu
{
int bianhao;
char zuozhe[26];
};
int i,j,n,q=0;
int count[26]={0};
scanf("%d",&n);
struct tushu *pp;
pp=(struct tushu *)malloc(sizeof(tushu)*n);
int *m;
m=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++)
{
scanf("%d %s",&((pp+i)->bianhao),(pp+i)->zuozhe);
}
for(i=0;i<n;i++)
{
m[i]=strlen(pp[i].zuozhe);
for(j=0;j<m[i];j++)
{
count[pp[i].zuozhe[j]-'A']++;
}
}
int max=0;
for(i=0;i<26;i++)
{
if(count[i]>max){max=count[i];q=i;}
}
printf("%c\n%d\n",'A'+q,max);
for(i=0;i<n;i++)
{
for(j=0;j<m[i];j++)
{
if(pp[i].zuozhe[j]==('A'+q))printf("%d\n",pp[i].bianhao);
}
}
return 0;
}
| 2 |
765 |
int main()
{
struct bookst
{
int Num;
char name[26];
};
struct bookst *book;
int cnt[26], num, i, j, max=0, max_idx=0;
for(i=0;i<26;i++)
cnt[i]=0;
scanf("%d",&num);
book=(struct bookst *)malloc(num*sizeof(struct bookst));
for(i=0;i<num;i++)
{
scanf("%d%s",&book[i].Num,book[i].name);
for(j=0;book[i].name[j]!=0;j++)
{
cnt[book[i].name[j]-'A']++;
}
}
for(i=0;i<26;i++)
{
if(cnt[i]>max)
{
max=cnt[i];
max_idx=i;
}
}
printf("%c\n%d\n",'A'+max_idx,max);
for(i=0;i<num;i++)
{
for(j=0;book[i].name[j]!=0;j++)
{
if(book[i].name[j]=='A'+max_idx)
printf("%d\n",book[i].Num);
}
}
return 0;
} | 2 |
766 |
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);
struct Author
{
int count;
int number[1000];
};
struct Author b[26];
for(i=0;i<26;i++) b[i].count=0;
int max,record;
for (i=0;i<m;i++)
{
int k;
k=strlen(a[i].auther);
for (j=0;j<k;j++)
{
b[a[i].auther[j]-'A'].number[b[a[i].auther[j]-'A'].count]=a[i].number;
b[a[i].auther[j]-'A'].count++;
}
}
max=b[0].count;
for (i=0;i<26;i++)
if (b[i].count>=max)
{
max=b[i].count;
record=i;
}
printf("%c\n%d\n",record+'A',max);
for (i=0;i<max;i++)
printf("%d\n",b[record].number[i]);
return 0;
} | 2 |
767 |
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 |
768 |
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 |
769 | void main()
{
struct book
{
char num[100],wri[26];
} bo[1000];
int i,j,k,l,n,m=0,a[26]={0},mw;
scanf("%d\n",&n);
for (i=0;i<n;i++)
{
scanf("%s %s",bo[i].num,bo[i].wri);
l=strlen(bo[i].wri);
for (j=0;j<l;j++) a[bo[i].wri[j]-65]++;
}
for (i=0;i<26;i++) if(a[i]>m) {m=a[i];mw=65+i;}
printf("%c\n%d\n",mw,m);
for (i=0;i<n;i++)
{
l=strlen(bo[i].wri);
for (j=0;j<l;j++) if(bo[i].wri[j]==mw) {puts(bo[i].num);break;}
}
} | 2 |
770 | int c[26];
char b[1000][100];
char out;
int main(int argc, char* argv[])
{
int n,i,j,tmp=0,tmp1=0,tmp2;
int a[1000];
out='A';
scanf ("%d",&n);
for (i=0;i<n;i++)
{
scanf ("%d %s",&a[i],b[i]);
for (j=0;j<strlen(b[i]);j++)
{
if (b[i][j]=='A') c[0]++;if (b[i][j]=='B') c[1]++;if (b[i][j]=='C') c[2]++;if (b[i][j]=='D') c[3]++;
if (b[i][j]=='E') c[4]++;if (b[i][j]=='F') c[5]++;if (b[i][j]=='G') c[6]++;if (b[i][j]=='H') c[7]++;
if (b[i][j]=='I') c[8]++;if (b[i][j]=='J') c[9]++;if (b[i][j]=='K') c[10]++;if (b[i][j]=='L') c[11]++;
if (b[i][j]=='M') c[12]++;if (b[i][j]=='N') c[13]++;if (b[i][j]=='O') c[14]++;if (b[i][j]=='P') c[15]++;
if (b[i][j]=='Q') c[16]++;if (b[i][j]=='R') c[17]++;if (b[i][j]=='S') c[18]++;if (b[i][j]=='T') c[19]++;
if (b[i][j]=='U') c[20]++;if (b[i][j]=='V') c[21]++;if (b[i][j]=='W') c[22]++;if (b[i][j]=='X') c[23]++;
if (b[i][j]=='Y') c[24]++;if (b[i][j]=='Z') c[25]++;
}
}
for (i=0;i<26;i++)
{
if (c[i]>tmp)
{
tmp=c[i];
tmp1=i;
}
}
printf ("%c\n%d\n",out+tmp1,tmp);
for (i=0;i<n;i++)
{
for (j=0;b[i][j]!='\0';j++)
{
tmp2=b[i][j];
if (tmp2==(out+tmp1))
{
printf("%d\n",a[i]);
break;
}
}
}
return 0;
} | 2 |
771 | struct book{
int num;
char writer[28];
}bo[1000];
int main()
{
int i,j,k,n,a,b;
int max=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %s",&bo[i].num,bo[i].writer);
}
for(i='Z';i>='A';i--){
a=0;
for(k=0;k<n;k++){
for(j=0;j<27;j++){
if(bo[k].writer[j]==i){
a++;
}
}
}
if(a>max){
max=a;
b=i;
}
}
printf("%c\n%d\n",b,max);
for(j=0;j<n;j++){
for(i=0;i<28;i++){
if(bo[j].writer[i]==b){
printf("%d\n",bo[j].num);
}
}
}
return 0;
} | 2 |
772 | main()
{
int amount_temp=0,amount_most=0;
char most,temp;
int i,j,k,s,p;
int m;
char jiancha[27];
struct xinxi
{
int bianhao;
char zuozhe[27];
};
struct xinxi shuru[999];
scanf("%d",&m);
for(p=0;p<m;p++)
{
scanf("%d %s",&shuru[p].bianhao,shuru[p].zuozhe);
}
for(temp='A';temp<='Z';temp++)
{
for(i=0;i<m;i++)
{
strcpy(jiancha,shuru[i].zuozhe);
for(j=0;j<strlen(jiancha);j++)
{
if(jiancha[j]==temp)
{
amount_temp++;
}
}
}
if(amount_temp>amount_most)
{
amount_most=amount_temp;
most=temp;
amount_temp=0;
}
else
{
amount_temp=0;
}
}
printf("%c\n%d\n",most,amount_most);
for(i=0;i<m;i++)
{
strcpy(jiancha,shuru[i].zuozhe);
for(j=0;j<strlen(jiancha);j++)
{
if(jiancha[j]==most)
{
printf("%d\n",shuru[i].bianhao);
break;
}
}
}
}
| 2 |
773 |
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 |
774 | 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 |
775 | void main()
{
int m,t,b[1000],a[26]={0},max;
char str[1000][30];
int i,j;
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d %s",&b[i],str[i]);
for(j=0;str[i][j]!='\0';j++)
{
t=str[i][j]-'A';
a[t]++;
}
}
t=0;
max=a[0];
for(i=0;i<26;i++)
{
if(max<a[i])
{
max=a[i];
t=i;
}
}
printf("%c\n",'A'+t);
printf("%d\n",a[t]);
for(i=0;i<m;i++)
{
for(j=0;str[i][j]!='\0';j++)
{
if(str[i][j]=='A'+t)
printf("%d\n",b[i]);
}
}
} | 2 |
776 | 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 |
777 |
struct book
{
int id;
char c[27];
};
int main()
{
void number_of_books(int n,int *p,struct book book[1000]);
char max(int n,int *p,struct book book[1000]);
void name_of_book(int n,int *p,struct book book[1000],int m);
int *p;
char s[100],m;
struct book book[1000];
int n,i;
p=(int *)calloc(257,sizeof(int));
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&book[i].id,&book[i].c);
}
number_of_books(n,p,book);
m=max(n,p,book);
printf("%c\n%d\n",m,(*(p+m)));
name_of_book(n,p,book,m);
return 0;
}
void number_of_books(int n,int *p,struct book book[1000])
{
int i,j;
for(i=65;i<91;i++)
{
(*(p+i))=0;
}
for(i=0;i<n;i++)
{
for(j=0;book[i].c[j]!='\0';j++)
{
(*(p+book[i].c[j]))++;
}
}
}
char max(int n,int *p,struct book book[1000])
{
int i,k=0;
char m;
for(i=65;i<91;i++)
{
if((*(p+i))>k)
{
k=(*(p+i));
m=i;
}
}
return (m);
}
void name_of_book(int n,int *p,struct book book[1000],int m)
{
int i,j;
for(i=0;i<n;i++)
{
for(j=0;book[i].c[j]!='\0';j++)
{
if((book[i].c[j])==m)
{
printf("%d\n",book[i].id);
break;
}
}
}
} | 2 |
778 | //????????????
//???2013.12.21
//****************************
int main()
{
int n=0,i=0,j=0,num[100],k=0,count[26]={0},max=0;
char nam[100][30]={NULL};
cin>>n;
for(i=0;i<n;i++)
{
cin>>num[i];
cin.get();
gets(nam[i]);
for(j=0;j<strlen(nam[i]);j++)
count[nam[i][j]-'A']++;
}
max=count[0];
for(i=0;i<26;i++)
{
if(max<count[i])
{ max=count[i];k=i; }
else
continue;
}
j=0;
cout<<(char)(k+'A')<<endl;
cout<<max<<endl;
for(i=0;i<n;i++)
for(j=0;;j++)
{
if(nam[i][j]==k+'A')
{ cout<<num[i]<<endl;break; }
if(nam[i][j]==NULL)
break;
}
return 0;
} | 2 |
779 | struct book{
int num;
char writer[26];
struct book *next;
};
void main()
{
int n,i,j,a[26]={0},max,temp; /*a[i]???????0*/
char c;
struct book *p,*head,*tail;
scanf("%d",&n);
head=NULL;tail=NULL;
for(i=0;i<n;i++){
p=(struct book*)malloc(len);
scanf("%d %s",&p->num,p->writer);
if(head==NULL) /*???????????=??????????????????*/
head=tail=p;
else{
tail->next=p;
tail=p;
}
}
for(c='A';c<='Z';c++){
for(i=0,p=head;i<n;i++,p=p->next)
{
for(j=0;p->writer[j]!='\0';j++)
if(p->writer[j]==c)
a[c-'A']++; /*????break,??????*/
} /*??a[26]????????????????????????????????????????????????????????????*/
}
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)
break;
c=i+'A';
printf("%c\n",c);
printf("%d\n",a[i]);
for(i=0,p=head;i<n;i++,p=p->next)
{
for(j=0;p->writer[j]!='\0';j++)
if(p->writer[j]==c){
printf("%d\n",p->num);break;
}
}
} | 2 |
780 | int main()
{
int n,book[1000],cnt[60],max;
char author[1000][26],p;
int b[60][1000];
cin>>n;
for(int i=0;i<60;i++)
cnt[i]=0;
for(int i=0;i<n;i++)
{
cin>>book[i];
cin.get();
cin.getline(author[i],26);
}
for(int i=0;i<n;i++)
{
for(int j=0;author[i][j]!='\0';j++)
{
int k=author[i][j]-'0';
b[k][cnt[k]++]=book[i];//?i???K????
}
}
max=cnt[17];
p='A';
for(int i=17;i<=42;i++)
{
if(cnt[i]>max)
{
max=cnt[i];
p=i+'0';
}
}
cout<<p<<endl;
cout<<max<<endl;
for(int m=0;m<max;m++)
cout<<b[p-'0'][m]<<endl;
return 0;
}
| 2 |
781 | void main()
{
int n,a[1000],i,b[26]={0},m,j,max=0,k;
char str[1000][30];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%s",&a[i],str[i]);
}
for(i=0;i<n;i++)
{
m=strlen(str[i]);
for(j=0;j<m;j++)
{
if(str[i][j]=='A')
b[0]++;
if(str[i][j]=='B')
b[1]++;
if(str[i][j]=='C')
b[2]++;
if(str[i][j]=='D')
b[3]++;
if(str[i][j]=='E')
b[4]++;
if(str[i][j]=='F')
b[5]++;
if(str[i][j]=='G')
b[6]++;
if(str[i][j]=='H')
b[7]++;
if(str[i][j]=='I')
b[8]++;
if(str[i][j]=='J')
b[9]++;
if(str[i][j]=='K')
b[10]++;
if(str[i][j]=='L')
b[11]++;
if(str[i][j]=='M')
b[12]++;
if(str[i][j]=='N')
b[13]++;
if(str[i][j]=='O')
b[14]++;
if(str[i][j]=='P')
b[15]++;
if(str[i][j]=='Q')
b[16]++;
if(str[i][j]=='R')
b[17]++;
if(str[i][j]=='S')
b[18]++;
if(str[i][j]=='T')
b[19]++;
if(str[i][j]=='U')
b[20]++;
if(str[i][j]=='V')
b[21]++;
if(str[i][j]=='W')
b[22]++;
if(str[i][j]=='X')
b[23]++;
if(str[i][j]=='Y')
b[24]++;
if(str[i][j]=='Z')
b[25]++;
}
}
for(i=0;i<26;i++)
{
if(b[i]>max)
{
max=b[i];
k=i;
}
}
printf("%c\n%d\n",k+65,max);
for(i=0;i<n;i++)
{
m=strlen(str[i]);
for(j=0;j<m;j++)
{
if(str[i][j]==k+65)
printf("%d\n",a[i]);
}
}
}
| 2 |
782 | int main()
{
int m,i,num[26]={0},index1;
scanf("%d",&m);
struct f
{
int index;
char writer[27];
};
struct f *p;
p=(struct f *)malloc(m*sizeof(struct f));//???????
char *p1;
for(i=0;i<m;i++)
{
scanf("%d %s",&(p+i)->index,(p+i)->writer);//????
}
for(i=0;i<m;i++)
{
p1=(p+i)->writer;
for(;*p1;p1++)
{ index1=(int)*p1-'A';//??????????????????
(*(num+index1))++;}
}
int max=0,k;
for(i=0;i<26;i++)
if(max<*(num+i)) {max=*(num+i);k=i;}//?????????
char wr;
wr=(char)k+'A';
printf("%c\n%d\n",wr,max);
int flag;
for(i=0;i<m;i++)
{
p1=(p+i)->writer;
flag=1;
for(;*p1&&flag==1;p1++)
if(*p1==wr) flag=0;
if(flag==0) printf("%d\n",(p+i)->index);//??????????????????????
}
} | 2 |
783 | struct Student
{char name[26];
int a;
};
int main()
{
int n,i,k,l,m;
char j,t;
int b[26]={0};
scanf ("%d",&n);
struct Student stu[999];
for (i=0;i<n;i++)
{
scanf ("%d %s",&stu[i].a,stu[i].name);
}
for (j='A',k=0;j<='Z';j++,k++)
for (i=0;i<n;i++)
for (l=0;l<26;l++)
if (stu[i].name[l]==j)
b[k]++;
for (j='A',k=0,m=0;j<='Z';j++,k++)
if (b[k]>m)
{
m=b[k];
t=j;
}
printf ("%c\n%d",t,m);
for (i=0;i<n;i++)
for (l=0;l<26;l++)
if (stu[i].name[l]==t)
printf ("\n%d",stu[i].a);
return 0;
} | 2 |
784 | 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 |
785 | 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 |
786 | void main()
{
struct
{
int NO;
char AUT[27];
}book[999];
int i,j,k,m,n,d,max;
int a[26]={0},b[26][999];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d ",&book[i].NO);
gets(book[i].AUT);
for(j=0;book[i].AUT[j]!='\0';j++)
{
d=book[i].AUT[j]-65;
b[d][a[d]]=book[i].NO;
a[d]=a[d]+1;
}
}
max=0;
for(i=0;i<26;i++)
{
if(a[i]>max)
{
max=a[i];
k=i;
}
}
printf("%c\n%d\n",k+65,max);
for(i=0;i<a[k]-1;i++)
{
printf("%d\n",b[k][i]);
}
printf("%d",b[k][a[k]-1]);
} | 2 |
787 | /*????????m?10 ? m ? 999??????????n?2 ? n ? 26?
????????????????m?????????1?999???????????'A'?'Z'??
??????????????????????????????*/
void main()
{
int i,j,n,m,x[26]={0},y=0,z;
char a[100][4],b[100][10],c;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s %s",a[i],b[i]);
}
for(i=0;i<n;i++)
{
m=strlen(b[i]);
for(j=0;j<m;j++)
{
x[b[i][j]-65]++;
}
}
for(i=0;i<26;i++)
{
if(y<x[i])
{
y=x[i];
z=i;
}
}
c=z+65;
printf("%c\n%d\n",c,y);
for(i=0;i<n;i++)
{
m=strlen(b[i]);
y=0;
for(j=0;j<m;j++)
{
if(b[i][j]==c)y=1;
}
if(y==1)printf("%s\n",a[i]);
}
} | 2 |
788 | struct book
{
int num;
char name[27];
struct book *next;
};
int m;
struct book *head;
struct book *setup()
{ int t=0;
struct book *head,*p1,*p2;
head=p1=p2=(struct book *)malloc(sizeof (struct book));
scanf("%d %s",&p1->num,p1->name);
while(t<m-1)
{ t++;
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);
}
int k=0,max=0;
void found(struct book *p)
{ int i,j;
p=head;
int *pi;
pi=(int *)malloc(sizeof(int)*26);
for(i=0;i<26;i++) *(pi+i)=0;
for(i=0;i<m;i++)
{
for(j=0;p->name[j]!='\0';j++)
{
(*(pi+(p->name[j]-'A')))++;
}
p=p->next;
}
for(j=0;j<26;j++)
{
if(*(pi+j)>max){
max=*(pi+j);
k=j;
}
}
}
int main()
{ int i,j;
scanf("%d",&m);
struct book *p;
head=p=setup();
found(p);
printf("%c\n%d\n",(k+'A'),max);
p=head;
for(i=0;i<m;i++)
{for(j=0;p->name[j]!='\0';j++)
if(p->name[j]==k+'A'){
printf("%d\n",p->num);
break;
}
p=p->next;
}
}
| 2 |
789 | 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 |
790 | void main()
{
struct book
{
int num;
char auth[26];
int inf[26];
struct book *next;
};
struct book *head,*p1,*p2,*t1,*t2;
head=(struct book *)malloc(sizeof(struct book));
int m,i,k,l,j,max;
int authnum[26]={0};
scanf("%d",&m);
p1=head;
p2=p1;
for (i=0;i<(m-1);i++)
{
scanf("%d %s",&(p1->num),p1->auth);
p2=(struct book *)malloc(sizeof(struct book));
p1->next=p2;
p1=p2;
}
scanf("%d %s",&(p1->num),p1->auth);
p2=NULL;
p1->next=p2;
p1=head;
p2=p1;
while(p1!=NULL)
{
l=strlen(p1->auth);
for(j=0;j<l;j++)
{
p1->inf[(*((p1->auth)+j))-65]=1;
authnum[(*((p1->auth)+j))-65]++;
}
p2=p1->next;
p1=p2;
}
max=0;
for(i=1;i<26;i++)
{
if (authnum[i]>authnum[max]) max=i;
}
printf("%c\n",(max+65));
printf("%d\n",authnum[max]);
p1=head;
p2=p1;
while(p1!=NULL)
{
if ((p1->inf[max])>0)
printf("%d\n",p1->num);
p2=p1->next;
p1=p2;
}
p1=head;
p2=p1;
while(p1!=NULL)
{
p2=p1->next;
free(p1);
p1=p2;
}
} | 2 |
791 | void main()
{
int n,i,j,card[1000],num[26]={0},max=0,k=0;
char s[1000][27];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&card[i],s[i]);
for(i=0;i<n;i++)
for(j=0;s[i][j]!='\0';j++)
num[s[i][j]-'A']++;
for(i=0;i<26;i++)
if(num[i]>max)
{max=num[i];k=i;}
printf("%c\n%d\n",k+'A',max);
for(i=0;i<n;i++)
for(j=0;s[i][j]!=0;j++)
if(s[i][j]==k+'A')
{printf("%d\n",card[i]);break;}
}
| 2 |
792 | 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 |
793 | 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;
}
}
}
| 2 |
794 | 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 |
795 |
int main()
{
int n;
scanf("%d",&n);
if(n>0){
struct a
{
char y[30];
int x,l;
}a[1000];
struct b
{
char y;
int x;
}b[26];
int i,j,p;
char k;
for(i=0;i<n;i++)
{
scanf("%d %s",&a[i].x,&a[i].y);
a[i].l=strlen(a[i].y);
}
for(i=0;i<=25;i++)
{
b[i].y=i+65;
b[i].x=0;
}
for(i=0;i<n;i++)
{
for(j=0;j<a[i].l;j++)
{
for(k=65;k<=90;k++)
{
if(a[i].y[j]==k)b[k-65].x=b[k-65].x+1;
}
}
}
int max=b[0].x;
for(i=0;i<=25;i++)
{
if(b[i].x>max)max=b[i].x;
}
for(i=0;i<=25;i++)
{
if(b[i].x==max)
{
printf("%c\n",b[i].y);
printf("%d\n",b[i].x);
for(j=0;j<n;j++)
{
for(p=0;p<a[j].l;p++)
{
if(a[j].y[p]==b[i].y)
{printf("%d\n",a[j].x);break;}
}
}
break;
}
}
}
return 0;
} | 2 |
796 | void main()
{
struct b
{
int num;
char str[27];
}b[100];
int n,i,m,j,max,nmax;
int a[26]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&b[i].num,b[i].str);
m=strlen(b[i].str);
for(j=0;j<m;j++)
{
a[b[i].str[j]-65]++;
}
}
max=a[0];
nmax=0;
for(i=0;i<26;i++)
{
if(a[i]>max) {max=a[i];nmax=i;}
}
printf("%c\n%d\n",nmax+65,max);
for(i=0;i<n;i++)
{
m=strlen(b[i].str);
for(j=0;j<m;j++)
{
if(b[i].str[j]==nmax+65)
printf("%d\n",b[i].num);
}
}
} | 2 |
797 | struct shu
{int num;
char author[26];
};
void main()
{
struct shu shu[999];
int n,i,j,k,m;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&shu[i].num,shu[i].author);
int a[26]={0};
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(shu[i].author[j]=='A') a[0]=a[0]+1;
else if(shu[i].author[j]=='B') a[1]=a[1]+1;
else if(shu[i].author[j]=='C') a[2]=a[2]+1;
else if(shu[i].author[j]=='D') a[3]=a[3]+1;
else if(shu[i].author[j]=='E') a[4]=a[4]+1;
else if(shu[i].author[j]=='F') a[5]=a[5]+1;
else if(shu[i].author[j]=='G') a[6]=a[6]+1;
else if(shu[i].author[j]=='H') a[7]=a[7]+1;
else if(shu[i].author[j]=='I') a[8]=a[8]+1;
else if(shu[i].author[j]=='J') a[9]=a[9]+1;
else if(shu[i].author[j]=='K') a[10]=a[10]+1;
else if(shu[i].author[j]=='L') a[11]=a[11]+1;
else if(shu[i].author[j]=='M') a[12]=a[12]+1;
else if(shu[i].author[j]=='N') a[13]=a[13]+1;
else if(shu[i].author[j]=='O') a[14]=a[14]+1;
else if(shu[i].author[j]=='P') a[15]=a[15]+1;
else if(shu[i].author[j]=='Q') a[16]=a[16]+1;
else if(shu[i].author[j]=='R') a[17]=a[17]+1;
else if(shu[i].author[j]=='S') a[18]=a[18]+1;
else if(shu[i].author[j]=='T') a[19]=a[19]+1;
else if(shu[i].author[j]=='U') a[20]=a[20]+1;
else if(shu[i].author[j]=='V') a[21]=a[21]+1;
else if(shu[i].author[j]=='W') a[22]=a[22]+1;
else if(shu[i].author[j]=='X') a[23]=a[23]+1;
else if(shu[i].author[j]=='Y') a[24]=a[24]+1;
else if(shu[i].author[j]=='Z') a[25]=a[25]+1;
}
}
k=a[0],m=0;
for(i=0;i<26;i++)
{
if(k<a[i])
{
k=a[i];
m=i;
}
}
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'};
printf("%c\n",b[m]);
printf("%d\n",k);
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(shu[i].author[j]==b[m])
{
printf("%d\n",shu[i].num);
break;
}
}
}
} | 2 |
798 | void main()
{
int m,num[1000],i,k,l=0,a[26]={0};
char nam[1000][10],j;
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d%s",&num[i],nam[i]);
for(j='A';j<='Z';j++)
for(i=0;i<m;i++)
if(strchr(nam[i],j))
a[j-65]++;
for(i=0,k=a[0];i<26;i++)
if(a[i]>k)
{
k=a[i];
l=i;
}
printf("%c\n",l+65);
printf("%d\n",k);
for(i=0;i<m;i++)
{
if(strchr(nam[i],l+65))
printf("%d\n",num[i]);
}
}
| 2 |
799 | int main()
{
int n;
cin>>n;
int a[26],max,num[n],i,j,s;
char maxname,name[n][10];
memset(a,0,sizeof(a));
for(i=0;i<n;i++)
{
cin>>num[i]>>name[i];
s=strlen(name[i]);
for(j=0;j<s;j++)
a[name[i][j]-'A']++;
}
max=a[0],maxname='A';
for(i=1;i<26;i++)
if(a[i]>max)
{
max=a[i],maxname='A'+i;
}
cout<<maxname<<endl<<max<<endl;
for(i=0;i<n;i++)
{
s=strlen(name[i]);
for(j=0;j<s;j++)
if(name[i][j]==maxname)
cout<<num[i]<<endl;
}
return 0;
} | 2 |