N = int(input())
X = [''] * N
for a in range(N):
X[a] = int(input())
a = 0
c, b, e, f = 0, 0, 0, N + 1
g, h = 0, 0
while a < N - 2:
a += 1
e += 1
b, c = X[a], b
if c < b:
while a < N - 1:
d = X[a]
if d < b:
if e < f:
g, h = a - e + 1, a + 1
f = e
break
elif d == b:
continue
else:
e = 0
if g == 0 and h == 0:
print(0)
else: print(g, h)
Объяснение:
на
N = int(input())
X = [''] * N
for a in range(N):
X[a] = int(input())
a = 0
c, b, e, f = 0, 0, 0, N + 1
g, h = 0, 0
while a < N - 2:
a += 1
e += 1
b, c = X[a], b
if c < b:
while a < N - 1:
a += 1
e += 1
d = X[a]
if d < b:
if e < f:
g, h = a - e + 1, a + 1
f = e
break
elif d == b:
continue
else:
break
e = 0
if g == 0 and h == 0:
print(0)
else: print(g, h)
Объяснение:
на
N = int(input())
X = [''] * N
for a in range(N):
X[a] = int(input())
a = 0
c, b, e, f = 0, 0, 0, N + 1
g, h = 0, 0
while a < N - 2:
a += 1
e += 1
b, c = X[a], b
if c < b:
while a < N - 1:
a += 1
e += 1
d = X[a]
if d < b:
if e < f:
g, h = a - e + 1, a + 1
f = e
break
elif d == b:
continue
else:
break
e = 0
if g == 0 and h == 0:
print(0)
else: print(g, h)
Объяснение: