Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Наибольшая пилообразная подпоследовательность
a guest
Jan 12th, 2020
35
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
n=int(input())
a=[]*n
f=0
a = list(map(int, input().split()))
for i in range(1,n-2):
if a[i]>a[i+1] and a[i]>a[i-1] or a[i]<a[i+1] and a[i]<a[i-1]:
f+=0
else:
f+=1
print(f)
Add Comment
Please,
Sign In
to add comment
Public Pastes
Anti Lock 67su
Lua | 5 min ago | 2.14 KB
Vampirism code
Ruby | 51 min ago | 0.68 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 💰
GetText | 52 min ago | 0.38 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 1 hour ago | 0.39 KB
2024-05-07_stats.json
JSON | 1 hour ago | 4.32 KB
2024-05-07_stats.json
JSON | 1 hour ago | 4.30 KB
2024-05-07_stats.json
JSON | 1 hour ago | 4.27 KB
unpackisf.py
Python | 1 hour ago | 3.66 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!