题解 | #小美的排列询问#
小美的排列询问
http://www.nowcoder.com/questionTerminal/42c9fc45859b44af9cb14efc1269b75f
python题解
n = int(input())
res = 0
m = list(map(int, input().split()))
l, r = list(map(int, input().split()))
for i in range(1, n):
if m[i] == l:
if m[i - 1] == r:
res = 1
if m[i] == r:
if m[i - 1] == l:
res = 1
if res:
print("Yes")
else:
print("No")