题解 | #图像相似度#
图像相似度
https://www.nowcoder.com/practice/f2952ee3bb5c48a9be6c261e29dd1092
#include <stdio.h> int main() { int m, n; while (~scanf("%d %d", &m, &n)) { int* arr = (int*)malloc(sizeof(int) * m * n * 2 - 1); int count = 0; for (int i = 0; i < m * n * 2 ; i++) { scanf("%d", &arr[i]); } for (int j = 0; j < m * n; j++) { if (arr[j] == arr[j + m * n]) count++; } printf("%.2f", (float)count / (m * n) * 100); } return 0; }