题目:https://www.hackerrank.com/challenges/piling-up/problem
题意:有点迷,大意就是是否从两边到中间逐渐减小
思路:list+sorted
其实最简单的是双指针模拟
代码:
'''
-*- coding: utf-8 -*-
@Author : PlayerGuan
@Time : 2017/10/14 23:12
@Software: PyCharm Community Edition
@File : main.py
'''
from collections import deque
T = int(input())
for case in range(T):
n = int(input())
ls = list(map(int,input().split()))
pos = ls.index(min(ls))
left = ls[:pos]
right = ls[pos:]
if left == sorted(left,reverse=True) and right == sorted(right):
print("Yes")
else:
print("No")