1. 程式人生 > >1061. 判斷題(15)--Python

1061. 判斷題(15)--Python

做了兩道題都沒通過,心情鬱悶,弄個簡單的,放鬆下。

num_guys, num_quest = input().split()
num_guys, num_quest = int(num_guys), int(num_quest)
grade_list = input().split()
answer_list = input().split()
list = []
for i in range(num_guys):
	my_grade = 0
	my_answer = input().split()
	
	for j in range(num_quest):
		if my_answer[j] == answer_list[j]:
			my_grade += int(grade_list[j])
			#print(grade_list[i])
	list.append(my_grade)
	
for my in list:
	print(my)