题解 | #有序序列判断#
有序序列判断
http://www.nowcoder.com/practice/22e87f8a8d764a6582710f38d1b40c6e
n = int(input()) b = list(map(int, input().split())) c, d = sorted(b), sorted(b, reverse=True) if b == c or b == d: print('sorted') else: print('unsorted')
有序序列判断
http://www.nowcoder.com/practice/22e87f8a8d764a6582710f38d1b40c6e
n = int(input()) b = list(map(int, input().split())) c, d = sorted(b), sorted(b, reverse=True) if b == c or b == d: print('sorted') else: print('unsorted')
相关推荐