#include<stdio.h>
typedef struct TrueOrFalse
{
int fullMark;
int rightAns;
}Questions;
int main()
{
int N, M;
scanf("%d%d", &N, &M);
Questions qus[101];
int i, j, stuNum, score=0;
for(i=0; i<M; i++)
scanf("%d", &qus[i].fullMark);
for(i=0; i<M; i++)
scanf("%d", &qus[i].rightAns);
for(j=0; j<N;j++)
{
score = 0;
for(i=0; i<M; i++)
{
scanf("%d", &stuNum);
if(stuNum == qus[i].rightAns)
score += qus[i].fullMark;
}
printf("%d\n", score);
}
}
网友评论