https://pintia.cn/problem-sets/994805260223102976/problems/994805268817231872
#include <iostream>
using namespace std;
int main(){
int N, M, score[100] = {0}, answer[100] = {0};
cin >> N >> M;
for(int i = 0; i < M; i++)
cin >> score[i];
for(int i = 0; i < M; i++)
cin >> answer[i];
for(int i = 0; i < N; i++){
int sum = 0, tmp;
for(int j = 0; j < M; j++){
cin >> tmp;
if(!(tmp^answer[j]))
sum += score[j];
}
cout << sum << endl;
}
return 0;
}