第一题,通过找到每个点的连通是否都红,直接与运算 n,m = (int(i) for i in input().split(" ")) dic = {} for i in range(m): f,t,c = (i for i in input().split(" ")) f = int(f) t = int(t) if dic.get(f) is None: dic[f] = c=="R" else: dic[f] = dic[f] and c=="R" if dic...