1776. 牛的基因组学
作者:互联网
Powered by:NEFU AB-IN
文章目录
1776. 牛的基因组学
-
题意
-
思路
看每一位基因位有没有不一样的,即判断两个集合是否有交集
-
代码
''' Author: NEFU AB-IN Date: 2022-02-05 17:35:56 FilePath: \ACM\Acwing\1776.py LastEditTime: 2022-02-05 17:52:18 ''' from collections import defaultdict a = [] #不正常 b = [] #正常 if __name__ == "__main__": n, m = map(int, input().split()) for i in range(n): a.append(input()) for i in range(n): b.append(input()) res = 0 for i in range(m): d = defaultdict(int) for j in range(n): d[a[j][i]] += 1 flag = 0 for j in range(n): if d[b[j][i]]: flag = 1 break if not flag: res += 1 print(res)
标签:__,1776,基因组学,res,range,input 来源: https://blog.csdn.net/qq_45859188/article/details/122792768