Information
- ID
- 241
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 2
- Tags
- # Submissions
- 27
- Accepted
- 22
- Uploaded By
#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;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.