hdu 1236一直re,跪求解释

一直re,求大神解释 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1236

 #include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct student
{
    char kaohao[25];
    int score;
};
bool cmp(student x,student y)
{
    if(x.score!=y.score)return x.score>y.score;
    else return strcmp(x.kaohao,y.kaohao)<=0;
}
int main()
{
    int renshu,tishu,fenxian,ji;
    student a[1005];
    while(scanf("%d",&renshu) && renshu)
    {
        ji = 0;
        memset(a,0,sizeof(a));
        int count,tifen[25];
        scanf("%d%d",&tishu,&fenxian);
        for(int i = 1;i<=tishu;i++)
        {
            scanf("%d",&tifen[i]);
        }
        for(int i = 1;i<=renshu;i++)
        {
            getchar();
            scanf("%s%d",a[i].kaohao,&count);
            for(int j = 1;j<=count;j++)
            {
                int temp;
                scanf("%d",&temp);
                a[i].score += tifen[temp];
            }
            if(a[i].score>=fenxian)
                ji++;
        }
        sort(a+1,a+renshu+1,cmp);
        printf("%d\n",ji);
        for(int i = 1;;i++)
        {
            if(a[i].score<fenxian)
            {break;}
            else printf("%s %d\n",a[i].kaohao,a[i].score);
        }
    }
}

最后输出的时候,如果所有人都过线了,会造成数组越界的情况吧。
另外吐槽一下,这种中文拼音和英文单词掺杂的写法实在太丧病了