3 3 3 121 32 3我的思路:data=[3,3,12]color=["white","white","white"]// 使用字典保存树,存储所有的联通对的下标(减1变为index)Tree={ 0:{2}, 1:{2}, 2:{0,1} }count=0for node,nextnodes in Tree.items(): for nextnode in nextnodes: if color[node]=="white" and color[nextnode]=="white": v1,v2=data[node],data[nextnode] multi=v1*v2 if int(math.sqrt(multi))**2 == multi: count+=2 color[node],color[nextnode]="red","red"return count我感觉思路没问题,测试用例也过了但只能c 20%,不知道哪里错了,求大佬帮忙指教#美团##美团信息集散地##笔试##算法#