pta 乙级1032的第三个测试点是啥啊?

自己写的还有网上复制跑通的代码去测试结果全是第三个测试点出问题
这是我的代码,不知道哪出问题了,希望有人指点下

#include<stdio.h>
#define maxsize 100005
struct data
{
    int num;
   int score;
}max;
int main()
{
    int n;
    data teams[maxsize]={};
    max = {0,0};
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        teams[a].num = a;
        teams[a].score += b;
    }
    for(int k=1;k<n+1;k++)
    {
        if(teams[k].score>max.score)
        {
            max = teams[k];
        }
    }
    printf("%d %d",max.num,max.score);
}


修改后如下:

#include <stdio.h>
#define maxsize 100005
struct data
{
    int num;
    int score;
} max;
int main()
{
    int n;
    struct data teams[maxsize] = {};
    max.num = 0;
    max.score = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        teams[i].num = a;
        teams[i].score = b;
    }
    for (int k = 1; k < n + 1; k++)
    {
        if (teams[k].score > max.score)
        {
            max = teams[k];
        }
       
    }
    printf("%d %d", max.num, max.score);
}