1 solutions

  • 0
    @ 2024-3-30 17:56:12
    #include<iostream>
    using namespace std;
    int main(){
        struct stu
        {
            char a[20];
            int b;
            int c;
        }
        d[10000];
        int n,m;
        scanf("%d",&n);
        for(int i = 1;i <= n;i++)
          scanf("%s%d%d",d[i].a,&d[i].b,&d[i].c);
        scanf("%d",&m);
        while(m--)
        {
            int x;
            cin>>x;
            for(int i = 1;i <= n;i++)
            {
                if(d[i].b == x)
                {
                    printf("%s %d\n",d[i].a,d[i].c);
                    break;
                }
            }
        }
        return 0;
    }
    
    • 1

    Information

    ID
    241
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    2
    Tags
    # Submissions
    27
    Accepted
    22
    Uploaded By