problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02988
u276785896
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np = list(map(int, input().split()))\nsum = 0\nfor i in range(1,n):\n if p[i+1]>p[i]>p[i-1] or p[i-1]>p[i]>p[i+1]:\n sum +=1\nprint(sum)\n', 'n=int(input())\np = list(map(int, input().split()))\nsum = 0\nfor i in range(1,n-1):\n if p[i+1]>p[i]>p[i-1] or p[i-1]>p[i]>p[i+1]:\n sum +=1\nprint(sum)...
['Runtime Error', 'Accepted']
['s749907073', 's424858299']
[2940.0, 3060.0]
[20.0, 17.0]
[150, 151]
p02988
u282707041
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\n\nfor i in range(1,n-1):\n\n if (p[i-1]<p[i]<p[i+1]) or (p[i+1]<p[i]<p[i-1]):\n a=1+a\nprint(a)', 'n=int(input())\np=list(map(int,input().split()))\nprint(n)\nprint(p)\na=0\ni=1\n\nfor i in range(1,n-1):\n\n if (p[i-1]<p[i]<p[i+1]) or (p[i+1]<p[i]<p[i-1])...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s596458030', 's917442767', 's218360880']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[148, 224, 226]
p02988
u287500079
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
["\n\nn = int(input())\np = [int(i) for i in input().split()]\n\ncnt = 0\nfor i in range(1,n-1):\n q = [p[i-1],p[i],p[i+1]]\n q.sort()\n if p[i] == q[1]:\n print('y')\n cnt += 1\n\nprint(cnt)", '\n\nn = int(input())\np = [int(i) for i in input().split()]\n\ncnt = 0\nfor i in range(1,n-1):\n q ...
['Wrong Answer', 'Accepted']
['s222267023', 's255978982']
[3060.0, 3060.0]
[17.0, 18.0]
[249, 230]
p02988
u294385082
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\nc = 0\nfor i in range(1,n-1):\n if p[i-1] < p[i] < p[i+1] or (p[i-1] == p[i] and p[i] < p[i+1]):\n c += 1\nprint(c)', 'n = int(input())\np = list(map(int,input().split()))\nc = 0\nfor i in range(1,n-1):\n if p[i-1] < p[i] < p[i+1] or p[i-1] == p[i] < p[i+1]:\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s328577919', 's643008981', 's743879663', 's795670900']
[2940.0, 3064.0, 2940.0, 3064.0]
[17.0, 18.0, 18.0, 17.0]
[167, 156, 129, 153]
p02988
u297046168
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = input()\np = list(map(int, input().split()))\nans = 0\nfor i in p[2:]:\n if p[i] < p[i-1] < p[i-2] or p[i] > p[i-1] > p[i-2]:\n ans +=1\n else:\n continue\nprint(ans)\n', 'n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range(1,n-1):\n if p[i+1] < p[i] < p[i-1] or p...
['Runtime Error', 'Accepted']
['s259505925', 's690064837']
[3060.0, 2940.0]
[20.0, 17.0]
[183, 168]
p02988
u305940825
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
[' n = int(input())\n p_list = list(map(int, input().split()))\n count = 0\n for i in range(len(p_list)-2):\n \tif (p_list[i]<p_list[i+1] and p_list[i+1]<p_list[i+2]) or (p_list[i]>p_list[i+1] and p_list[i+1]>p_list[i+2]):\n \t\tcount += 1\n print(count)', 'n = int(input())\np_list = list(map(int, ...
['Runtime Error', 'Accepted']
['s004244892', 's736462904']
[3064.0, 3060.0]
[17.0, 17.0]
[264, 239]
p02988
u307631662
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\nl = [*map(int, input().split())]\nres = 0\nfor i in range(1,n-1):\n if l[i-1]<l[i] and l[i]<l[i+1] or l[i-1]>l[i]andl[i]>l[i+1]: res+=1\nprint(res)', 'n=int(input())\nl = list(map(int, input().split()))\nres = 0\nfor i in range(1,n-1):\n if l[i-1]<l[i] and l[i]<l[i+1] or l[i-1]>l[i] and l[i]>l[i+1]:...
['Runtime Error', 'Accepted']
['s861973729', 's291430375']
[2940.0, 2940.0]
[17.0, 17.0]
[159, 165]
p02988
u309120194
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input()))\n\nans = 0\nfor i in range(1, n-1):\n if p[i] > p[i-1] and p[i] < p[i+1]: ans += 1\n\nprint(ans)', 'n = int(input())\np = list(map(int, input().split()))\n \nans = 0\nfor i in range(1, n-1):\n if p[i] >= p[i-1] and p[i] <= p[i+1]: ans += 1\n\nprint(ans)', 'n = int(input...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s165715091', 's276738976', 's719112052', 's870291199', 's929643194']
[9168.0, 9072.0, 9136.0, 9016.0, 9172.0]
[25.0, 27.0, 28.0, 24.0, 26.0]
[136, 147, 146, 147, 162]
p02988
u314089899
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['#132b\nN = int(input())\np_list = list(map(int, input().split()))\n\n\n\nans = 0', '#132b\nN = int(input())\np_list = list(map(int, input().split()))\n\n\n\nans = 0\n\nfor i in range(1,N-1):\n #print(p_list[i-1],p_list[i],p_list[i+1])\n if (p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]) or (p_list[i-1] > ...
['Wrong Answer', 'Accepted']
['s466634200', 's086843828']
[2940.0, 3060.0]
[17.0, 17.0]
[211, 427]
p02988
u318127926
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range(n-2):\n for j in range(i+1, n-1):\n for k in range(j+1, n):\n if p[i]<p[j]<p[k] or p[k]<p[j]<p[i]:\n ans += 1\nprint(ans)', 'n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range...
['Wrong Answer', 'Accepted']
['s656348881', 's572657171']
[3060.0, 3060.0]
[19.0, 17.0]
[228, 158]
p02988
u333134020
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=input()\nl=[map(int,input().strip().split())]\nans=0\nfor i in range(1,len(l)-2):\n gc=0;\n lc=0;\n if(l[i] >l[i-1] or l[i]>l[i+1]):\n gc=1\n if(l[i] <l[i-1] or l[i]<l[i+1]):\n lc=1\n ans+=gc & lc', 'n=input()\nl=list(map(int,input().strip().split()))\nans=0\nfor i in range(1,len(l)-1):\n gc=0;\n lc=0...
['Runtime Error', 'Accepted']
['s947560592', 's024576542']
[3064.0, 3064.0]
[17.0, 18.0]
[200, 237]
p02988
u347640436
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = [int(e) for e in input().split()]\nresult = 0\nfor i in range(1, n - 1):\n if p[i - 1] < p[i] < p[i + 1] or p[i + 1] < p[i] < p[i - 1]:\n result += 1\n', 'n = int(input())\np = [int(e) for e in input().split()]\nresult = 0\nfor i in range(1, n - 1):\n if p[i - 1] < p[i] < p[i + 1] or p[i + ...
['Wrong Answer', 'Accepted']
['s944001742', 's676526584']
[2940.0, 3060.0]
[17.0, 17.0]
[171, 185]
p02988
u349091349
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=input()\nP= list(map(int,input().split()))\nx=0\nfor i in range(0,n-2):\n if P[i+1] != max(P[i],P[i+1],P[i+2]) and P[i+1] != min(P[i],P[i+1],P[i+2]):\n x += 1\n \nprint(x)', 'n=int(input())\nP=list(map(int,input().split()))\nx=0\nfor i in range(0,n-2):\n if P[i+1] != max(P[i],P[i+1],P[i+2]) and ...
['Runtime Error', 'Accepted']
['s262004295', 's329493243']
[3060.0, 3060.0]
[17.0, 17.0]
[183, 187]
p02988
u355137116
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nint count = 0\np[] = map(int,input(),split())\nfor (i=0; i < n-2; i++){\n if p[i] < p[i+1] < p[i+2]: count ++;}\nprint(count)', 'n = int(input())\np = list(map(int, input().split()))\nans = sum(1 for i in range(n-2) if p[i] < p[i+1] < p[i+2] or p[i] > p[i+1] > p[i+2])\nprint(ans)']
['Runtime Error', 'Accepted']
['s768397780', 's745637497']
[2940.0, 3064.0]
[18.0, 17.0]
[139, 148]
p02988
u357751375
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\nc = 0\n\nfor i in range(1,n - 1):\n if p[n - 1] < p[n] and p[n] < p[n + 1]:\n c = c + 1\n\nprint(c)', 'n = int(input())\np = list(map(int,input().split()))\nc = 0\n\nfor i in range(1,n - 1):\n if p[i - 1] < p[i] and p[i] < p[i + 1]:\n c = c + 1...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s762586511', 's894781744', 's446146065']
[2940.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0]
[155, 155, 208]
p02988
u358957649
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nlstp = list(map(int, input().split()))\n\ncount = 0\nfor i in range(1, len(lstp)-1):\n lst = list(lstp[i-1], lstp[i], lstp[i+1])\n if (min(lst) != lstp[i]) and (max(lst) != lstp[i]):\n count = count + 1\n\nprint(count)', 'n = int(input())\nlst = list(map(int, input().split()))\n\ncount ...
['Runtime Error', 'Accepted']
['s763065922', 's193281126']
[3316.0, 3060.0]
[20.0, 17.0]
[240, 263]
p02988
u362563655
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\ncount==0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:\n count += 1\nprint(count)', 'n=int(input())\np=list(map(int,input().split()))\ncount=0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:\n count +...
['Runtime Error', 'Accepted']
['s670162309', 's133188353']
[3060.0, 2940.0]
[17.0, 17.0]
[160, 160]
p02988
u363768711
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['A = int(input())\nB = list(map(int, input().split()))\nans = 0\n\nfor i in range(1, A-1):\n if B[i-1] > B[i] > B[i+1]:\n s += 1\n elif B[i-1] < B[i] < B[i+1]:\n s+=1\n \nprint(s)', 'A = int(input())\nB = list(map(int, input().split()))\n\nfor i in range(1,A-1):\n if B[i-1] > B[i] > B[i+1]:\n s += 1\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s010617642', 's962864374', 's181684328']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[179, 178, 158]
p02988
u363836311
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int, input().split()))\nt=0\nfor i in range(n):\n if i!=0 or i!=n-1:\n l=list(p[i-1], p[i], p[i+1])\n l.sort()\n if l[1]==p[i]:\n t+=1\nprint(t)', 'n=int(input())\np=list(map(int, input().split()))\nt=0\nfor i in range(n):\n if i!=0 or i!=n-1:\n l=[p[i-1], p[i], p[i+1]]\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s820937944', 's894295181', 's782494466']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[177, 173, 187]
p02988
u368016155
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\n\np = map(int, input().split())\n\ncount = 0\nfor i in range(n):\n if (p[i+1]>p[i] and p[i]>=p[i-1]) or (p[i-1]>p[i] and p[i]>=p[i+1]):\n count += 1\n \nprint (count)', 'n = int(input())\n\np = map(int, input().split())\n\ncount = 0\n\nfor i in range(1,n-1):\n if p[i+1]>p[i] and p[i]>=p[i-1]...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s086672733', 's319152253', 's344157318', 's421689963', 's524549886', 's340852799']
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[182, 203, 201, 198, 203, 211]
p02988
u369402805
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['def prob_b():\n n = int(input())\n p_list = [int(a) for a in input().split()]\n ans = 0\n for i in range(n - 2):\n if min(p_list[i], p_list[i+2]) < p_list[i+1] < max(p_list[i], p_list[i+2]):\n ans += 1\n return ans\n\nprob_b()', 'def prob_b():\n n = int(input())\n p_list = [int(...
['Wrong Answer', 'Accepted']
['s351384997', 's376702865']
[2940.0, 3060.0]
[18.0, 17.0]
[250, 268]
p02988
u371530330
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\n\ncnt = 0\n\nfor i in range(n-2):\n if p[i] < p[i+1] and p[i+1] < p[i+2]:\n cnt += 1\n \nprint(cnt)\n \n', 'n = int(input())\np = list(map(int,input().split()))\n \ncnt = 0\n\nfor i in range(1,n-1):\n if (p[i] < p[i+1] and p[i+1] < p[i+2]) \n or (p[i] > p[...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s318321906', 's351392719', 's422426284', 's717602334', 's879411833', 's285032812']
[2940.0, 2940.0, 2940.0, 2940.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[153, 197, 198, 194, 191, 191]
p02988
u373047809
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n, *p = map(int, open(0).read().split())\nfor i in range(2, n):\n t = p[i-2:i+1]\n c += sorted(t)[1] == t[1]\nprint(c)', 'n, *p = map(int, open(0).read().split())\nc = 0\nfor i in range(2, n):\n t = p[i-2:i+1]\n c += sorted(t)[1] == t[1]\nprint(c)']
['Runtime Error', 'Accepted']
['s625378031', 's608100692']
[2940.0, 2940.0]
[17.0, 17.0]
[120, 126]
p02988
u374146618
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = input().split()\n\ncnt = 0\nfor i in range(0, n-2):\n print(p[i])\n if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):\n cnt += 1\nprint(cnt)', 'n = int(input())\np = input().split()\n\ncnt = 0\nfor i in range(0, n-2):\n print(p[i])\n if (p[i] < p[i+1] < p[i+2]) or (p[i]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s381657300', 's463162352', 's710046223', 's996161551']
[3064.0, 3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0, 19.0]
[174, 181, 208, 176]
p02988
u375282392
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\n\nc = 0\nfor i in range(1,n+1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n \tc += 1\n elif p[i+1] < p[i] and p[i] < p[i-1]:\n c += 1\n else:\n pass\n\nprint(c)\n ', 'n = int(input())\np = list(map(int, input().split()))\n\nc = 0\nfor i in range(1,n-1):\n ...
['Runtime Error', 'Accepted']
['s318626981', 's325982908']
[3060.0, 3060.0]
[17.0, 17.0]
[211, 211]
p02988
u375500286
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\nlist = list(map(int,input().slice()))\ncnt=0\nfor i in range(1,n-1):\n if list[i-1]<list[i]<list[i+1]:\n cnt+=1\n elif list[i-1]>list[i]>list[i+1]:\n cnt+=1\nprint(cnt)', 'n=int(input())\nli =list(map(int,input().split()))\ncnt=0\nfor i in range(1,n-1):\n if li[i-1]<li[i]<li[i+1...
['Runtime Error', 'Accepted']
['s125556041', 's213393512']
[3060.0, 3060.0]
[17.0, 17.0]
[196, 181]
p02988
u375695365
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\na=list(map(int,input().split()))\nprint (a)\ncount=0\nfor i in range(1,n-1):\n if a[i-1]<a[i]and a[i]<a[i+1] or a[i-1]>a[i]and a[i]>a[i+1]:\n count+=1\nprint(count)', 'n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range(1, n-2+1):\n a = [p[i-1], p[i], p[i+1]]\n ...
['Wrong Answer', 'Accepted']
['s430952422', 's193153871']
[3060.0, 9064.0]
[17.0, 26.0]
[183, 181]
p02988
u385244248
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\nb=list(map(int,input().split()))\nc=0\nd=0\nwhile c<=n-2 :\n if b[c+1]>b[c] and b[c+1]<b[c+2] or b[c+1]<b[c] and b[c+1]>b[c+2]:\n d +=1\n c +=1\n else:\n c+=1\n\nprint(d)\n', 'n=int(input())\nb=list(map(int,input().split()))\nc=0\nd=0\nwhile c<=n-3 :\n if (b[c+1]>b[c] and...
['Runtime Error', 'Accepted']
['s826139771', 's619580864']
[3316.0, 3060.0]
[21.0, 17.0]
[203, 207]
p02988
u390170391
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nl = list(map(int,input().split()))\nc = 0\nfor i in range(1,n-2):\n if l[i] > l[i-1] and l[i] < l[i+1]:\n c = c+1\n elif l[i] < l[i-1] and l[i] > l[i+1]:\n c = c+1\n\nprint(c)', 'n = int(input())\nl = list(map(int,input().split()))\nc = 0\nfor i in range(1,n-2):\n if l[i] > l[i-1] and l[i] ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s418114564', 's634211771', 's671735737']
[3060.0, 3316.0, 3060.0]
[18.0, 20.0, 17.0]
[192, 213, 231]
p02988
u392938961
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['# Your code here!\nimport math\nx = [int(s) for s in input().split()]\nsum = 0\nfor i in range(len(x)-2):\n center = x[i+1]\n three = [x[i], x[i+1], x[i+2]]\n if(x[i+1] == int(sorted(three)[1])):\n sum += 1\n \nprint(sum)', 'import math\nnum = input()\nx = [int(s) for s in input().split()]\ns...
['Wrong Answer', 'Accepted']
['s518781013', 's372719464']
[3060.0, 3064.0]
[17.0, 17.0]
[235, 244]
p02988
u393253137
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\nP=list(map(int,input().split()))\nans=0\nfor i in range(1,n-2):\n if sorted(P[i-1:i+2])[1]==P[i]:ans += 1\nprint(ans)', 'n=int(input())\nP=list(map(int,input().split()))\nans=0\nfor i in range(1,n-1):\n if sorted(P[i-1:i+2])[1]==P[i]: \n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s807908053', 's640185636']
[2940.0, 2940.0]
[17.0, 17.0]
[131, 166]
p02988
u394731058
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
["import sys\n\ninput = sys.stdin.readline\n\ndef main():\n ans = 0\n n = int(input())\n d = list(map(int, input().split()))\n d.sort()\n ans += d[n//2] - d[n//2-1]\n print(ans)\n\nif __name__ == '__main__':\n main()", 'ans = 0\nn = int(input())\na = list(map(int, input().split()))\nfor i in range(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s423833724', 's634794731', 's584192120']
[3060.0, 9180.0, 9144.0]
[17.0, 25.0, 25.0]
[222, 136, 163]
p02988
u397953026
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\ncount=0\n\np=list(map(int,input().split()))\nfor i in range(n-2):\n if p[i]<p[i+1] and p[i+2]>p[i+1]:\n count+=1\nprint(n-count)', 'n = int(input())\ncount=0\n\np=list(map(int,input().split()))\nfor i in range(n-2):\n if (p[i]<p[i+1]<p[i+2]) or (p[i+2]>p[i+1]>p[i]):\n count+=1\np...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s237397469', 's614670986', 's407366714']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 18.0]
[181, 194, 194]
p02988
u404678206
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\nprint(n)\nprint(p)\ni=1\nl=[]\nwhile i<n-1:\n if p[i-1]<p[i]<p[i+1] or p[i-1]>p[i]>p[i+1]:\n l.append(i)\n else:\n pass\n i+=1\nprint(len(l))', 'n=int(input())\np=list(map(int,input().split()))\n#print(n)\n#print(p)\ni=1\nl=[]\nwhile i<n-1:\n if p[i-1]<p[i]<...
['Wrong Answer', 'Accepted']
['s831021208', 's086538688']
[3060.0, 2940.0]
[17.0, 17.0]
[188, 192]
p02988
u407311141
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['s = int(input())\nlist = [int(n) for n in input().split()]\n\nsum = 0\n\nfor i in range(1, s - 1):\n if list[i - 1] < list[i] < list[i + 1]:\n sum += 1\n\nprint(sum)\n', 's = int(input())\nlist = [int(n) for n in input().split()]\n\nsum = 0\n\nfor i in range(1, s - 1):\n if (list[i] - list[i - 1]) * (lis...
['Wrong Answer', 'Accepted']
['s971195318', 's502191860']
[3316.0, 2940.0]
[21.0, 17.0]
[167, 185]
p02988
u407891541
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['import numpy as np\n\nsize=input()\npro=input()\n\np=np.array(pro.split(" "),dtype=np.int32)\np=np.sort(p)\n\nme=int(len(p)/2)\n\nprint(p[me]-p[me-1])\n', 'import numpy as np\n\nsize=input()\npro=input()\n\np=np.array(pro.split(" "),dtype=np.int32)\np=np.sort(p)\n\nme=int(len(p)/2)+1\n\nprint(p[me]-p[me-1])', 'import...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s032224847', 's541843825', 's446427471']
[12468.0, 12468.0, 12508.0]
[148.0, 149.0, 148.0]
[141, 142, 261]
p02988
u408375121
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(N - 2):\n if min(p[i], p[i + 2]) < p[i + 1] < max(p[i], p[i + 2]):\n count += 1\nprint(count)', 'n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(n - 2):\n if min(p[i], p[i + 2]) < p[i + 1] < max(p[i]...
['Runtime Error', 'Accepted']
['s318309687', 's477100384']
[3060.0, 2940.0]
[17.0, 18.0]
[172, 173]
p02988
u408791346
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = map(int,input().split())\nans = 0\nfor i in range(3,n-1):\n if i-1 < i < i+1 :\n ans += 1\n elif i-1 > i > i+1 :\n ans += 1\n else:\n continue\nprint(ans)', 'n = int(input())\np = list(map(int,input().split()))\nans = 0\nfor i in range(n-2):\n if p[i] < p[i+1] < ...
['Wrong Answer', 'Accepted']
['s516357583', 's075334979']
[3060.0, 3060.0]
[17.0, 17.0]
[196, 228]
p02988
u409757418
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\npis = list(map(int, input().split()))\nm = 0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:\n m += 1\nprint(m)', 'n = int(input())\np = list(map(int, input().split()))\nm = 0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:\n m += 1\n...
['Runtime Error', 'Accepted']
['s065000693', 's416161297']
[2940.0, 2940.0]
[17.0, 17.0]
[156, 154]
p02988
u411353821
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N, *L, = [list(map(int, s.split())) for s in open(0)]\nA = L[0]\np\ncnt = 0\nfor i in range(len(A) - 2):\n ma = max(A[i], A[i+1], A[i+2])\n mi = min(A[i], A[i+1], A[i+2])\n if A[i+1] not in [ma, mi]:\n cnt += 1\nprint(cnt)', "def main():\n _ = input()\n A = list(map(int, input().split()))\n ...
['Runtime Error', 'Accepted']
['s747270096', 's843260707']
[3064.0, 2940.0]
[17.0, 17.0]
[230, 264]
p02988
u415905784
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nP = [int(x) for x in input().split()]\ncnt = 0\nfor i in range(1, n - 1):\n if p[i - 1] < p[i] and p[i + 1] < p[i]:\n continue\n if p[i] < p[i - 1] and p[i] < p[i + 1]:\n continue\n cnt += 1\nprint(cnt)', 'n = int(input())\nP = [int(x) for x in input().split()]\ncnt = 0\nfor i in range(1, n...
['Runtime Error', 'Accepted']
['s606443883', 's259585897']
[3060.0, 3064.0]
[17.0, 17.0]
[220, 220]
p02988
u417791069
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
[' n = int(input())\n P = list(map(int, input().split())) \n \n ans = 0\n for i in range(1, n-1):\n if P[i-1] < P[i] < P[i+1] or P[i+1] < P[i] < P[i-1]:\n ans += 1\n \n print(ans)\n ', 'import sys\nn = int(sys.stdin.readline())\np = list(int(sys.stdin.readline().rstrip()....
['Runtime Error', 'Runtime Error', 'Accepted']
['s251409431', 's257317855', 's665975283']
[2940.0, 3060.0, 3188.0]
[26.0, 17.0, 18.0]
[219, 221, 175]
p02988
u424607362
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['\nn = int(input())\nnum_list = list(map(int, input().split()))\n\ncount = 1\n\nfor i in range(n-2):\n num_id = i+1\n temp = [num_list[num_id-1], num_list[num_id], num_list[num_id+1]]\n list_sorted = sorted(temp)\n\n if list_sorted[1] == num_list[num_id]:\n count += 1\n\nprint(count)\n', '\nn = int(...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s001000390', 's283340331', 's544274274', 's788781993', 's138178561']
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 18.0, 17.0]
[289, 319, 336, 332, 303]
p02988
u434872492
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\nans = 0\nfor i in range(1,n-1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n ans += 1\nprint(ans)', 'n = int(input())\np = list(map(int,input().split()))\nans = 0\nfor i in range(1,n-1):\n judge = False\n if p[i-1] < p[i] and p[i] < p[i+1]:\n jud...
['Wrong Answer', 'Accepted']
['s771624664', 's880881869']
[2940.0, 3064.0]
[17.0, 18.0]
[150, 264]
p02988
u439312138
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N = int(input())\nPlist = list(map(int,input().split()))\nctr = 0\n\nfor i in range(0,N-2):\n if (Plist[i] > Plist[i-1]) and (Plist[i] < Plist[i+1]):\n ctr += 1\n\nprint(ctr)', 'N = int(input())\nPlist = list(map(int,input().split()))\nctr = 0\n \nfor i in range(1,N-1):\n if (Plist[i+1] > Plist[i] > Plist[i-1]) ...
['Wrong Answer', 'Accepted']
['s984685743', 's528809233']
[3060.0, 3060.0]
[18.0, 17.0]
[170, 197]
p02988
u440630725
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\nprint(p)\nc=0\nfor i in range(1,n-1):\n if (p[i]-p[i-1])*(p[i+1]-p[i])>0:\n c=c+1\nprint(c)', 'n=int(input())\np=list(map(int,input().split()))\nc=0\nfor i in range(1,n-1):\n if (p[i]-p[i-1])*(p[i+1]-p[i])>0:\n ...
['Wrong Answer', 'Accepted']
['s465334190', 's885911564']
[2940.0, 2940.0]
[17.0, 17.0]
[164, 155]
p02988
u450904670
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['p = list(map(int,input().split()))\nres = 0\nfor i, num in enumerate(p):\n\tif(1 <= i and i <= (len(p) - 2)):\n\t\tli = [p[i-1],p[i],p[i + 1]]\n\t\tli.sort()\n\t\tif((p[i-1] != p[i + 1]) and (p[i-1] != p[i]) and (p[i] != p[i + 1]) and (li[1] == p[i])):\n\t\t\tres = res + 1\nprint(res)', 'p = list(map(int,input().spli...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s467279003', 's700198307', 's747650644', 's813173334', 's780133247']
[3064.0, 3064.0, 3064.0, 3064.0, 3188.0]
[17.0, 17.0, 17.0, 17.0, 19.0]
[267, 242, 242, 220, 279]
p02988
u465190009
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nP_list = list(map(int,(input().split(" "))))\nprint(P_list)\ncount = 0\ni = 1\nfor i in range(n-1):\n if (P_list[i-1] < P_list[i] and P_list[i + 1] > P_list[i]) or (P_list[i-1] > P_list[i] and P_list[i+1] < P_list[i]):\n count = count + 1\n\nprint(n)\nprint(P_list)\nprint(count)\n', 'n = i...
['Wrong Answer', 'Accepted']
['s499278314', 's871827087']
[3064.0, 3060.0]
[17.0, 17.0]
[297, 242]
p02988
u468972478
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n, a* = map(int, open(0).read().split())\nt = 0\nfor i in range(1, n-1):\n if sorted([i-1:i+2]).index(a[i]) == 1:\n t += 1\nprint(t)', 'n, a* = map(int, open(0).read().split())\nt = 0\nfor i in range(1, n-1):\n if sorted(a[i-1:i+2]).index(a[i]) == 1:\n t += 1\nprint(t)', 'n = int(input())\na = list(map(int, i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s303966848', 's443628705', 's425901229']
[8948.0, 8912.0, 9028.0]
[27.0, 25.0, 27.0]
[131, 132, 144]
p02988
u482532694
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nnumber = list(map(int, input().split()))\ncount = 0\nfor i in range(1, len(number)-1):\n if((number[i] > number[i-1]) & (number[i] < number[i+1])):\n count += 1\nprint(count)', 'n = int(input())\nnumber = list(map(int, input().split()))\ncount = 0\nfor i in range(1, len(number)-1):\n if...
['Wrong Answer', 'Accepted']
['s165587732', 's910745647']
[3060.0, 3064.0]
[17.0, 18.0]
[196, 280]
p02988
u488178971
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['#ABC 132 B\nn = int(input())\np= [int(j) for j in input().split()]\nans =0\nfor i in range(0,n-3+1):\n if p[i:i+3][1] ==sorted(p[i:i+3])[1]:\n ans+=1\n print(p[i:i+3])\nprint(ans) ', '#ABC 132 B\nn = int(input())\np= [int(j) for j in input().split()]\nans =0\nfor i in range(0,n-3+1):\n if p[i:i+3...
['Wrong Answer', 'Accepted']
['s941442175', 's490081129']
[3060.0, 3060.0]
[20.0, 17.0]
[190, 175]
p02988
u490642448
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=input()\np=list(map(int,input().split()))\na = 0\nfor i in range(n-2):\n a += 1*(0<((p[i] < p[i+1])*(p[i+1] < p[i+2])))\nprint(a)', 'n=int(input())\np=list(map(int,input().split()))\na = 0\nfor i in range(n-2):\n a += 1*(0<((p[i] < p[i+1])*(p[i+1] < p[i+2])))\nprint(a)', 'n=input()\np=list(map(int,input().spl...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s399329967', 's464151891', 's871343100', 's355296518']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[129, 134, 127, 128]
p02988
u492447501
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['import copy\n\nS = input()\n\nN = int(S)\n\nS = input()\n\nP = list(map(int, S.split()))\n\ncheck = []\n\ncount = 0\n\nfor i in range(0, N-2, 1):\n check = P[i:i+3]\n if (check[1] > check[0]) and (check[1] < check[2]):\n count = count + 1\n\nprint(count)\n', 'n = int(input())\nP = list(map(int, input().s...
['Wrong Answer', 'Accepted']
['s940881356', 's122872076']
[3444.0, 2940.0]
[22.0, 18.0]
[249, 207]
p02988
u493247921
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['a=map(int, input().split())\nb=list(a)\nc=len(b)\n\ncount=0\nfor i in range(1,c-1):\n tree= [b[i-1], b[i], b[i+1]]\n if (min(tree) != b[i]) and (max(tree) != b[i]):\n\n \tcount=count+1\n else:\n \tnext\n \nprint(count)\n\n\n', 'a=map(int, input().split())\nb=list(a)\nc=len(b)\n\ncount=0\nfor i in range(c-1):\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s090013549', 's605320275', 's998738710']
[3060.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[214, 174, 233]
p02988
u496942486
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n r = p[i:i+3]\n if len(r) == 3:\n if max(r)> p[1] < min(r):\n count += 1\n\nprint(str(count))\n', 'n = int(input())\np = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n r = p[i:i+3]\n if ...
['Wrong Answer', 'Accepted']
['s599105054', 's529984411']
[3060.0, 2940.0]
[18.0, 17.0]
[194, 203]
p02988
u501952592
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nP = list(map(int, input().split()))\ncount = 0\nfor i in range(N-2):\n if min(p[i], p[i+2]) < p[i+1] < max(p[i], p[i+2]):\n count += 1\nprint(count)', 'n = int(input())\nP = list(map(int, input().split()))\ncount = 0\nfor i in range(n-2):\n count += (min(p[i], p[i+2]) < p[i+1] < max(p[i], p[i+2...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s246685095', 's472747594', 's877651890', 's816248166']
[3064.0, 3064.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 18.0]
[164, 156, 164, 156]
p02988
u508273185
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\ncount=0\n\nfor i in range(0,n-2):\n #print(i)\n p_list=[p[i],p[i+1],p[i+2]]\n print(p_list)\n p_sorted=sorted(p_list)\n print(p_sorted)\n if p_list[1]==p_sorted[1]:\n count+=1\n\nprint(count)', 'n = int(input())\np = list(map(int,input().s...
['Wrong Answer', 'Accepted']
['s593851191', 's609049451']
[3060.0, 3060.0]
[18.0, 17.0]
[257, 259]
p02988
u514222361
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['# -*- coding: utf-8 -*-\nimport sys\n\nn = int(input())\ns = [int(c) for c in input()]\n\ncount = 0\n\nfor i in range(n-2):\n if s[i] < s[i+1] < s[i+2] or s[i] > s[i+1] > s[i+2]:\n count += 1\n\nprint(count)', "# -*- coding: utf-8 -*-\nimport sys\n\nn = int(input())\ns = [int(c) for c in input().split(' ')]...
['Runtime Error', 'Accepted']
['s506962061', 's715547187']
[3060.0, 3060.0]
[17.0, 17.0]
[205, 216]
p02988
u514652247
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\nprint(p)\n\nc=0\nfor i in range(1,n-1):\n if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):\n c=c+1\n\nprint(c)', 'n=int(input())\np=list(map(int,input().split()))\n\nc=0\nfor i in range(1,n-1):\n if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):\n c=c+1\n\npr...
['Wrong Answer', 'Accepted']
['s669768858', 's330144503']
[2940.0, 3060.0]
[18.0, 17.0]
[156, 147]
p02988
u516554284
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\na=list(map(int,input().split()))\nc=0\nfor i in range(1,n-1):\n if a[i]<a[i+1] and a[i+1]<a[i+2]:\n c+=1\nprint(c)', 'n=int(input())\na=list(map(int,input().split()))\nc=0\nfor i in range(1,n-1):\n if a[i]<a[i+1] and a[i+1]<a[i+2]:\n c+=1\n elif a[i]>a[i+1] and a[i+1]>a[i+2]:\n c+=1\nprint...
['Runtime Error', 'Runtime Error', 'Accepted']
['s310523604', 's900934755', 's195555248']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[128, 176, 175]
p02988
u527261492
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\ncnt=0\nfor i in range(n-2):\n lst=[p[i],p[i+1],p[i+2]]\n m=min(lst)\n P=p[i+1]\n del m\n if min(lst)==P:\n cnt+=1\nprint(cnt)\n', 'n=int(input())\np=list(map(int,input().split()))\ncnt=0\nfor i in range(n-2):\n lst=[p[i],p[i+1],p[i+2]]\n m=max(lst)\n P=p[i+...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s252808280', 's284411860', 's656937813', 's920982964']
[3060.0, 3064.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0]
[174, 173, 185, 190]
p02988
u527379148
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nnums = list(map(int, input().split()))\n\nindex = 0\ncount = 0\nwhile index < n - 2:\n mini_list = nums[index:index + 3]\n print(mini_list)\n if mini_list[1] == sorted(mini_list)[1]:\n count += 1\n index += 1\nprint(count)', 'n = int(input())\np_list = list(map(int, input().split(...
['Wrong Answer', 'Accepted']
['s689814064', 's305681856']
[3060.0, 3060.0]
[17.0, 17.0]
[248, 235]
p02988
u528439890
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['def calc(n, p):\n count = 0\n for i in range(1, n-1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n count += 1\n continue\n if p[i-1] > p[i] and p[i] > p[i+1]:\n count += 1\n continue\n\n return count\nprint(calc(input(), list(input().split())))', 'def calc...
['Runtime Error', 'Accepted']
['s976840497', 's395912431']
[3060.0, 3064.0]
[17.0, 17.0]
[295, 311]
p02988
u536177854
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\nl = list(map(int,input().split()))\nsum=0\nprint(l)\nfor i in range(n-2):\n if l[i]<l[i+1]<l[i+2] or l[i]>l[i+1]>l[i+2]:\n sum+=1\nprint(sum)', 'n=int(input())\nl = list(map(int,input().split()))\nsum=0\nfor i in range(n-2):\n if l[i]<l[i+1]<l[i+2] or l[i]>l[i+1]>l[i+2]:\n sum+=1\nprint(sum)']
['Wrong Answer', 'Accepted']
['s175530362', 's279956328']
[3060.0, 3060.0]
[17.0, 17.0]
[154, 145]
p02988
u536560967
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nA = list(map(int, input().split()))\n\ncnt = 0\n\nfor num in range(0, n-2):\n print(num)\n if A[num+1] > A[num] and A[num+1] < A[num+2]:\n cnt += 1\n print(num+1, num, num+2)\n elif A[num+1] < A[num] and A[num+1] > A[num+2]:\n cnt +=1\n\nprint(cnt)', 'n = int(input())\nA = list(map(int, ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s349250397', 's588943958', 's705424325']
[3188.0, 3060.0, 3060.0]
[18.0, 17.0, 18.0]
[265, 236, 210]
p02988
u536685012
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\n\na = 0\n\nfor i in range(n - 1):\n p_l = [p[i], p[i + 1], p[i + 2]]\n p_l2 = sorted(p_l)\n if p_l2[1] == p_l[1]:\n a += 1\n \nprint(int(a))', 'n = int(input())\np = list(map(int, input().split()))\n\na = 0\n\nfor i in range(n - 2):\n p_l = [p[i], p[i +...
['Runtime Error', 'Accepted']
['s461796566', 's943827030']
[3060.0, 3060.0]
[18.0, 17.0]
[193, 193]
p02988
u542506429
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\n\ncount = 0\nfor i in range(1, n-2):\n if (p[i] > p[i+1]) and (p[i] < p[i-1]):\n count += 1\n elif (p[i] > p[i-1]) and (p[i] < p[i+1]):\n count += 1\n\nprint(count)', 'n = int(input())\np = list(map(int, input().split()))\n\ncount = 0\nfor i i...
['Wrong Answer', 'Accepted']
['s411227781', 's360252447']
[3060.0, 3060.0]
[18.0, 17.0]
[229, 230]
p02988
u546686251
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(1, n - 2):\n if p[i - 1] < p[i] < p[i + 1]:\n count += 1\nprint(count)\n', 'n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(1, n - 1):\n if p[i - 1] < p[i] < p[i + 1]:\n count += 1\npr...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s383951410', 's645953286', 's719846344', 's730502247']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0, 17.0]
[156, 156, 152, 212]
p02988
u546853743
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=map(int,input().split())\ncount=0\nfor i in range(0,n-3):\n if (p[i]<p[i+1] and p[i+1]<p[i+2]) or (p[i]>p[i+1] and p[i+1]>p[i+2]):\n count += 1\nprint(count)', 'n=int(input())\np=map(int,input().split())\ncount=0\nfor i in range(0,n-2):\n if (p[i]<p[i+1] and p[i+1]<p[i+2]) or (p[i]>p[i+...
['Runtime Error', 'Runtime Error', 'Accepted']
['s838920923', 's857025962', 's477220919']
[9180.0, 9124.0, 9080.0]
[29.0, 24.0, 26.0]
[179, 180, 185]
p02988
u547608423
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\np=list(map(int,input().split()))\n\ncount=0\n\nfor i in range(n-2):\n print(q)\n if q[1]==p[i+1]:\n count+=1\n\nprint(count)', 'n=int(input())\np=list(map(int,input().split()))\n\ncount=0\n\nfor i in range(n-2):\n q=sorted(p[i:i+3])\n print(q)\n if q[1]==p[i+1]:\n count+=1...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s373978562', 's870008680', 's366612921']
[3060.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[143, 166, 153]
p02988
u551066908
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = [int(i) for i in input().split()]\n\ncount = 0\nfor i in range(n-2):\n a = p[i]\n b = p[i+1]\n c = p[i+2]\n if b > a and b < c:\n count+=1\n else b > c and b < a:\n count+=1\nprint(count)', 'n = int(input())\np = [int(i) for i in input().split()]\n\ncount = 0\nfor i in range(n-2):\n ...
['Runtime Error', 'Accepted']
['s158950590', 's690648658']
[2940.0, 3060.0]
[17.0, 17.0]
[208, 208]
p02988
u555947166
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nplist = list(map(int, input().split()))\ncounter = 0\n\nfor i in range(2, n):\n a, b, c = plist[i - 1:i + 2]\n if a < b < c or c < b < a:\n counter += 1\n\nprint(counter)', 'n = int(input())\nplist = list(map(int, input().split()))\ncounter = 0\n\nfor i in range(2, n):\n a = plist[i ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s170453967', 's604030703', 's884470290']
[3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[192, 217, 191]
p02988
u558493745
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = input()\na = list( input().split())\ncnt = 0\nfor i in range ( 1, len(a)-1):\n if (a[i-1]<a[i]<a[i+1]) or (a[i+1]<a[i]<a[i-1]):\n cnt += 1\n \nif len(a) = 3:\n if a[1] = 2:\n cnt = 1\n \nprint (cnt) ', 'n = input()\na = list( input().split())\ncnt = 0\nfor i in range ( 1, len(a)-1):\n if (a[i-1]...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s062728318', 's169671468', 's228341223', 's331891635', 's393689485', 's535391035', 's547280449', 's553218784', 's713985464', 's735983991', 's772654054', 's886204304', 's974185636', 's449671005']
[2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 3060.0, 3064.0, 2940.0, 3060.0, 3064.0, 2940.0, 2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 19.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[209, 207, 219, 231, 175, 220, 331, 209, 232, 332, 180, 164, 220, 181]
p02988
u565924121
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\nm=0\n\nfor i in range(2,n):\n if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):\n m +=1\n else:\n m +=0\n\n \nprint(m)\n\n', 'n = int(input())\np = list(map(int,input().split()))\nm=0\n\nfor i in range(2,n):\n if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s547201133', 's695854369', 's018524014']
[2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[173, 171, 175]
p02988
u581187895
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nA = list(map(int, input().split()))\ncount = 0\nfor i in range(1, n-1):\n pA = sorted(A[i-1:i+2]) \n print(pb)\n if pA[1] == A[i]:\n count += 1\nprint(count) ', 'N = int(input())\nP = list(map(int, input().split()))\nans = 0\nfor i in range(1, N-1):\n if P[i-1] < P[i] < P[i+1]:\n ans +...
['Runtime Error', 'Accepted']
['s116801486', 's132551741']
[3060.0, 3060.0]
[18.0, 17.0]
[178, 185]
p02988
u583276018
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\na = list(map(int ,input().split()))\ncnt = 0\nfor i in range(1, n-1):\n if(max(a[i-1:i+1]) != a[i] and min(a[i-1:i+1] != a[i]):\n cnt += 1\nprint(cnt)', 'n = int(input())\na = list(map(int ,input().split()))\ncnt = 0\nfor i in range(1, n-1):\n hoge = [a[i-1], a[i], a[i+1]]\n if(max(hoge) != a...
['Runtime Error', 'Accepted']
['s495563529', 's443595816']
[2940.0, 3060.0]
[17.0, 17.0]
[167, 188]
p02988
u597455618
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int. input().split()))\nans = 0\nfor i in range(1, n-1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n ans += 1\nprint(ans)', 'n = int(input)\np = list(map(int. input().split()))\nans = 0\nfor i in range(1, n-1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n ans += 1\nprint(ans)...
['Runtime Error', 'Runtime Error', 'Accepted']
['s240119547', 's660274356', 's966443641']
[2940.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[152, 150, 191]
p02988
u603324902
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\n\nL = [int(i) for i in input().split()]\n\nfor i in range(n-2):\n if L[i]<L[i+1] and L[i+1]<L[i+2]:\n Answer = Answer + 1\n continue\n if L[i+2]<L[i+1] and L[i+1]<L[i]:\n Answer = Answer + 1\n continue\nprint(Answer)', 'n = int(input())\n\nL = ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s244107600', 's303232061', 's319859480', 's489822999', 's951013734']
[3060.0, 3188.0, 2940.0, 2940.0, 3060.0]
[18.0, 18.0, 17.0, 17.0, 17.0]
[279, 204, 201, 202, 252]
p02988
u609814378
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\n\nans = 0\n\n\nfor i in range(n):\n\tif p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:\n\t\tans = ans + 1\n\nprint(ans)', 'n = int(input())\np = list(map(int, input().split()))\n\nans = 0\n\n\nfor i in range(n-2):\n\tif p[i] < p[i + 1] < p[i + 2] or p[...
['Runtime Error', 'Accepted']
['s592459315', 's315616554']
[3060.0, 3060.0]
[17.0, 17.0]
[238, 240]
p02988
u610473220
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n - int(input())\nP = list(map(int, input().split()))\nans = 0\nfor i in range(n-2):\n if (P[i] < P[i+1]) and (P[i+1] < P[i+2]):\n ans += 1\n elif (P[i] > P[i+1]) and (P[i+1] > P[i+2]):\n ans += 1\nprint(ans)', 'n = int(input())\nP = list(map(int, input().split()))\nans = 0\nfor i in range(n-2):\n if (P[i] <...
['Runtime Error', 'Accepted']
['s480059059', 's276912752']
[3060.0, 3316.0]
[17.0, 19.0]
[208, 208]
p02988
u611090896
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int,input().split()))\ncount=0\nif n == 3:\n if p[0] < p[1] < p[2] or p[2] < p[1] < p[0]:\n count+=1\nelse:\n for i in range(n-2):\n pp = p[0+i:3+i]\n if pp[0] < pp[1] < pp[2] or p[2] < p[1] < p[0]:\n count+=1\nprint(count)\n', 'n = int(input())\np = list(map(int,input()...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s222039870', 's999928700', 's818688494']
[9084.0, 8952.0, 9184.0]
[27.0, 28.0, 30.0]
[260, 215, 163]
p02988
u613401788
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['\nn = int(input())\np = input().split()\n\nprint(p)\ncnt = 0\n\nfor i in range(1,n-1):\n if( (p[i-1] < p[i] and p[i] <= p[i+1] ) or (p[i-1] >= p[i] and p[i] > p[i+1]) or (p[i-1] == p[i+1] and p[i] > p[i-1]) ):\n cnt += 1\n \nprint(cnt)', 'n = int(input())\np = input().split()\n\n \np_int = [int(s) for s ...
['Wrong Answer', 'Accepted']
['s552020409', 's518986493']
[3064.0, 3064.0]
[17.0, 18.0]
[237, 321]
p02988
u619878272
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['def myInput():\n n=input()\n s=input()\n return(n,[int(i) for i in s.split()])\n\ndef func():\n n, lst1 = nyInput()\n cnt = 0\n for i in range(1, int(n)-1):\n if min(lst[i+1],max(lst1[i],lst1[i-1])) == lst1[i]:\n cnt+=1\n elif min(lst1[i-1], max(lst1[i],lst1[i+1])) == lst1[i]:\n cnt+=1\n return...
['Runtime Error', 'Accepted']
['s766638078', 's453426177']
[3064.0, 3064.0]
[18.0, 18.0]
[323, 332]
p02988
u625963200
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N = [int(i) for i in input().split()][0]\nP = [i for i in input().split()]\n\ncount=0\nfor i in range(0,N-2):\n tmp = [P[i],P[i+1],P[i+2]]\n tmp.sort()\n print(tmp)\n if P[i+1]==tmp[1]:\n count+=1\n elif tmp[0]==tmp[1] or tmp[1]==tmp[2] or tmp[0]==tmp[2]:\n count+=1\n\nprint(count)', 'N = [int(i) for i in ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s235372956', 's484562489', 's330993157']
[3064.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[280, 264, 254]
p02988
u632423548
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N = int(input())\nnump = input().split()\nnump = [int(i) for i in nump]\n\ncount = 0\nfor i in range(1,8):\n p = nump[i]\n tmp = sorted([p[i-1],p[i],[i+1]])\n if tmp[1] == p:\n count+=1\nprint(count)\n', 'N = int(input())\nnump = input().split()\nnump = [int(i) for i in nump]\n\ncount = 0\nfor i in range(1,8):\...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s072366749', 's073487315', 's260094309', 's964199755', 's274173657']
[3060.0, 3060.0, 3064.0, 3060.0, 3064.0]
[17.0, 18.0, 17.0, 17.0, 17.0]
[196, 193, 208, 206, 196]
p02988
u640603056
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nx = list(map(int, input().split()))\ncnt = 0\nfor i in range(n-2):\n y = sorted(x[i:i+3])\n print(y)\n if x[i+1] == y[1]:\n cnt += 1\n\nprint(cnt)', 'n = int(input())\nx = list(map(int, input().split()))\ncnt = 0\nfor i in range(n-2):\n y = sorted(x[i:i+3])\n if x[i+1] == y[1]:...
['Wrong Answer', 'Accepted']
['s656092377', 's870243849']
[3060.0, 2940.0]
[18.0, 17.0]
[171, 158]
p02988
u641722141
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['cnt = int(input())\nl = list(map(int, input().split()))\ncount = 0\n \nfor i in range(cnt-2):\n a,b, c = l[i], l[i+1], l[i+2]\n if a < b and b < c:\n count += 1\nprint(count)', 'cnt = int(input())\nl = list(map(int, input().split()))\ncount = 0\n \nfor i in range(cnt-2):\n a,b, c = l[i], l[i+1], l[i+2]\n if (a...
['Wrong Answer', 'Accepted']
['s878914465', 's958679299']
[3060.0, 3060.0]
[17.0, 17.0]
[171, 191]
p02988
u643679148
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nps = list(map(int, input().split()))\nans = 0\n\nfor i in range(1, len(ps)-1):\n if ps[i] == min(ps[i-1], ps[i], ps[i+1]):\n ans += 1\nprint(ans)\n', 'n = int(input())\nps = list(map(int, input().split()))\nans = 0\n\nfor i in range(1, len(ps)-1):\n s1 = ps[i-1] < ps[i] and ps[i+1] > ps...
['Wrong Answer', 'Accepted']
['s616442630', 's249691623']
[9044.0, 9136.0]
[26.0, 27.0]
[167, 229]
p02988
u646130340
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\n\nli = list(map(int, input().split()))\ncnt = 0\nfor i in range(n+1):\n li2 = li[i-2: i+1]\n if li2[1] == sorted(li2)[1]:\n cnt += 1\n\nprint(cnt)', 'n = int(input())\n\nli = list(map(int, input().split()))\ncnt = 0\nfor i in range(n):\n li2 = li[i-2: i+1]\n if li2[1] == sorted(li...
['Runtime Error', 'Runtime Error', 'Accepted']
['s321215567', 's723265187', 's745921358']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[168, 166, 171]
p02988
u648212584
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\n\nX = list(map(int,input().split()))\n\nans = 0\nfor i in range(len(X) - 2):\n if (X[i] > X[i+1] > X[i+2]) or (X[i] < X[i+1] < X[i+2])\n \tans += 1\n\nprint(ans)', 'n = int(input())\n\nX = list(map(int,input().split()))\n\nans = 0\nfor i in range(len(X) - 2):\n if (X[i] > X[i+1] > X[i+2]) or (X[i...
['Runtime Error', 'Accepted']
['s872321497', 's491165126']
[2940.0, 3060.0]
[17.0, 18.0]
[171, 172]
p02988
u652656291
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor i in range(n):\n if a[i] < a[i+1] < a[i+2]:\n ans += 1\nprint(ans)\n ', 'n = int(input())\ns = list(map(int,input().split()))\nans = 0\nfor i in range(n-2):\n a,b,c=p[i:i+3]\n if a<b<c or c<b<a: ans += 1\nprint(ans)\n', 'n = int(input())\n...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s553354635', 's798896509', 's885030603', 's288523525']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0, 18.0]
[134, 144, 134, 146]
p02988
u655048024
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N = int(input())\np = list(int,input().split())\nans = 0\nfor i in range(1,N-1):\n if (p[i]<p[i+1])and(p[i]>p[i-1]):\n ans += 1\n elif(p[i]>p[i+1])and(p[i]<p[i-1]):\n ans += 1\n else:\n None\nprint(ans)', 'N = int(input())\np = list(map(int,input().split()))\nans = 0\nfor i in range(1,N-1):\n if (p[i]<p[...
['Runtime Error', 'Accepted']
['s026613682', 's297730259']
[3064.0, 3064.0]
[17.0, 17.0]
[204, 209]
p02988
u657541767
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = [int(x) for x in input().split()]\ncount = 0\nfor i in range(1,n-1):\n sor = sorted(p[i-1:i+2])\n print(sor)\n if p[i] == sor[1]:\n count += 1\n\nprint(count)', 'n = int(input())\np = [int(x) for x in input().split()]\ncount = 0\nfor i in range(1,n-1):\n sor = sorted(p[i-1:i+2])\n if p[i...
['Wrong Answer', 'Accepted']
['s477551170', 's166544957']
[3060.0, 3060.0]
[17.0, 17.0]
[177, 164]
p02988
u659563289
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['def main():\n n = int(input())\n ans = []\n p = list(map(int,input().split()))\n cnt = 0\n\n for i in range(1,len(p)-2):\n if p[i] < p[i+1] and p[i] > p[i-1]:\n cnt += 1\n elif p[i] > p[i+1] and p[i] < p[i-1]:\n cnt += 1\n\n print(cnt)\n\n\n\nmain()', 'def main():...
['Wrong Answer', 'Accepted']
['s107842056', 's184833439']
[3060.0, 3060.0]
[17.0, 17.0]
[287, 272]
p02988
u663014688
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nl = list(input)\ncnt = 0\nfor i in range(1,n):\n three = [l[i-1],l[i],l[i+1]]\n three.sort()\n if three[1] == list[i]:\n cnt += 1\n\nprint(cnt)\n\n', 'n = int(input())\ncnt = 0\nfor i in range(1,n):\n three = [i-1,i,i+1]\n three.sort()\n if three[1] == i:\n cnt += 1\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s869093071', 's993416656', 's803590917']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[170, 139, 224]
p02988
u665038048
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\ncnt = 0\nfor i in range(2, n):\n p_n = p[i-2:i]\n if min(p_n) == p_n[1]:\n cnt += 1\nprint(cnt)', 'n = int(input())\np = list(map(int, input().split()))\ncnt = 0\nfor i in range(2, n):\n p_n = p[i-2:i+1]\n p_n_sort = sorted(p_n)\n if p_n_sor...
['Wrong Answer', 'Accepted']
['s741221952', 's509255408']
[3060.0, 3060.0]
[19.0, 19.0]
[156, 188]
p02988
u667024514
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\nlis = list(map(int,input().split()))\nans = 0\nfor i in range(1,n-1):\n lis = sorted([lis[i-1],lis[i],lis[i+1]])\n if lis[1] == lis[i]:\n ans += 1\nprint(ans)', 'n = int(input())\nlis = list(map(int,input().split()))\nans = 0\nfor i in range(1,n-1):\n li = sorted([lis[i-1],lis[i],lis[i+1]])\n ...
['Runtime Error', 'Accepted']
['s945359178', 's974406344']
[3060.0, 3060.0]
[17.0, 17.0]
[174, 172]
p02988
u668503853
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['N = int(input())\nP= [int(x) for x in input().split]\n\nanswer=0\nfor i in range(1,N-1):\n a,b,c=P[i-1:i+2]\n if b != max(a,b,c) and b!= min(a,b,c):\n answer+=1\n\nprint(answer)\n', 'N = int(input())\nP= [int(x) for x in input().split()]\n\nanswer=0\nfor i in range(1,N-1):\n a,b,c=P[i-1:i+2]\n if b != max(a,b,...
['Runtime Error', 'Accepted']
['s252240083', 's319914803']
[2940.0, 2940.0]
[18.0, 17.0]
[174, 176]
p02988
u668705838
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2]:\n count += 1\n else:\n pass\n \nprint(count)', 'n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(n-2):\n if p[i] < p[i+1] < p[i+2]:\n count += 1\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s048657730', 's553993612', 's051178868']
[2940.0, 2940.0, 3060.0]
[17.0, 18.0, 17.0]
[160, 144, 187]
p02988
u684330841
2,000
1,048,576
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
['n=int(input())\n\np=input().split()\n\nA=0\n\nfor i in range(1,n-2):\n if p[i-1]<p[i]<p[i+1] or p[i-1]>p[i]>p[i+1]:\n A=A+1\n\nprint(A)\n', 'n=int(input())\n\np=list(map(int,input().split()))\n\nA=0\n\nfor i in range(1,n-1):\n if p[i-1]<p[i]<p[i+1] :\n A=A+1\n elif p[i-1]>p[i]>p[i+1]:\n ...
['Wrong Answer', 'Accepted']
['s751441544', 's956813205']
[2940.0, 3064.0]
[17.0, 17.0]
[136, 173]