题解 | #图像相似度#

图像相似度

http://www.nowcoder.com/practice/f2952ee3bb5c48a9be6c261e29dd1092

既然都是0和1,为什么不用异或呢?

#include <iostream>
using namespace std;
int main()
{
    int m,n,tmp,count=0;
    cin>>m>>n;
    int a[m*n];
    for(int i=0; i<m*n; i++)
    {
        cin>>a[i];
    }
    for(int j=0; j<m*n; j++)
    {
        cin>>tmp;
        if(!tmp^a[j])
            count++;
    }
    printf("%.2f",100.0*count/(m*n));
    return 0;
}

如果你觉得够新颖,请点个赞吧

全部评论
顶一下自己
点赞 回复 分享
发布于 2022-01-25 11:51

相关推荐

挣K存W养DOG:我记得好多人说这个公司就是白嫖方案的,现在有大体方案要让你给他展示实现细节了,也是无敌了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务