奇安信机器学习笔试
奇安信机器学习笔试第二题:受感染节点
n=int(input()) arr=[[0] * n for _ in range(n)] for i in range(n): arr[i]=list(map(int,input().split(' '))) nums=list(map(int,input().split(' '))) res=[n]*n for i in range(len(nums)): lis=nums[0:i]+nums[i+1:] brr=lis for j in brr: for k in range(n): if arr[j][k]==1 and k not in brr: brr.append(k) res[i]=len(brr) a=[i for i in range(len(nums)) if min(res)==res[i] ] print(a[0])a了75%,有大佬帮忙看看是哪种情况没考虑到么?