题解 | #图像相似度#
图像相似度
https://www.nowcoder.com/practice/f2952ee3bb5c48a9be6c261e29dd1092
m, n = map(int, input().split()) val1 = [] val2 = [] cnt = 0 for i in range(m): nums1 = list(map(int, input().split())) val1.append(nums1) for i in range(m): nums2 = list(map(int, input().split())) val2.append(nums2) for i in range(m): for j in range(n): if val1[i][j] == val2[i][j]: cnt += 1 sim = cnt / (m*n) * 100 print("%.2f" % sim)