标签:splay split span tmp star form col art sort
t = int(input()) for _ in range(1, t + 1): n=int(input()) ans=[] num = [int(s) for s in input().split(" ")] tmp=[] for i in range(n): tmp.append(num[i]) n1=len(tmp) tmp.sort() for val in tmp: if val<n1: n1-=1 else: continue ans.append(n1) y=‘ ‘.join(str(i) for i in ans) print("Case #{}: {}".format(_, y))
times = int(input()) for ti in range(times): n=int(input()) str1 = input() ans=[] num = [int(nt) for nt in str1.split()] tmp=[] for i in range(n): tmp.append(num[i]) n1=len(tmp) tmp.sort() for val in tmp: if val<n1: n1-=1 else: continue ans.append(n1) y=‘ ‘.join(str(i) for i in ans) print("Case #{}: {}".format(ti+1, y), flush=True)
标签:splay split span tmp star form col art sort
原文地址:https://www.cnblogs.com/Marigolci/p/11884376.html