# 将每个圆环的数据排序并合并
def con(amatrix):
for i,num in enumerate(amatrix):
con = ''
temp = sorted(num)
for j in temp:
con += str(j)
amatrix[i] = con
# 比较每组测试数据是否有相同的圆环
def compare(T,alist,amatrix):
start = 0
res = []
for i in range(T):
my_dic = {}
flag = False
for k in range(start,start+alist_num[i]):
print(amatrix[k])
if amatrix[k] in my_dic:
res.append("YES")
flag = True
break
else:
my_dic[amatrix[k]] = 1
if flag == False:
res.append("NO")
start += alist_num[i]
return res
if __name__ == '__main__':
T = int(input())
alist_num = []
amatrix = []
# 保存输入数据
for i in range(T):
c_nums = int(input())
alist_num.append(c_nums)
for i in range(c_nums):
amatrix.append(list(map(int, input().split())))
con(amatrix)
res = compare(T, alist_num, amatrix)
for r in res:
print(r)
菜到扣jio🙃
全部评论
(1) 回帖