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
u687443343
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()))\nfor x in range(N-2):\n for y in range(x+1,x+1):\n for z in range(x+2,x+2):', 'n = int(input())\np = list(map(int,input().split()))\nans = 0\nfor x in range(n-2):\n for y in range(x+1,x+2):\n for z in range(x+2,x+3):\n if p[x] >= p[y] and p[y] >= p[z]:...
['Runtime Error', 'Accepted']
['s344674162', 's294584358']
[2940.0, 3064.0]
[17.0, 17.0]
[128, 259]
p02988
u687929074
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-1):\n if p[i-1] < p[i] and p[i] < p[i+1]:\n count += 1\nprint(count)', '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] and p[i] < p[i+1]) or (p[i-1] > p[i] and p[i] > p...
['Wrong Answer', 'Accepted']
['s036999949', 's631484534']
[2940.0, 3060.0]
[17.0, 17.0]
[150, 190]
p02988
u688375653
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}.
['input()\na = list(map(int,input().split()))\n\ncount=0\nfor i in range(0,len(a)-2):\n print(i)\n if a[i] < a[i+1] < a[i+2]:\n count+=1\n if a[i] > a[i+1] > a[i+2]:\n count+=1\nprint(count)', 'input()\na = list(map(int,input().split()))\n\ncount=0\nfor i in range(0,len(a)-2):\n if a[i] < a[i+...
['Wrong Answer', 'Accepted']
['s918219544', 's191561282']
[3060.0, 3060.0]
[17.0, 17.0]
[201, 188]
p02988
u693953100
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 solve():\n n = int(input())\n p = list(map(int,input().split()))\n cnt = 0\n for i in range(1,n-1):\n if p[i-1]<p[i]<p[i+1]:\n cnt+=1\n print(cnt)\nif __name__=='__main__':\n solve()", "def solve():\n n = int(input())\n p = list(map(int,input().split()))\n cnt = 0\n ...
['Wrong Answer', 'Accepted']
['s476169823', 's158940592']
[3060.0, 3060.0]
[18.0, 18.0]
[213, 235]
p02988
u695644361
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}.
['input()\np=list(map(int,input().split()))\na=0\nfor i in range(1,n-1):\n\ta+=p[i]>min(p[i-1],p[i+1]) and p[i]<max(p[i-1],p[i+1])\nprint(a)', 'n=int(input())\np=list(map(int,input().split()))\na=0\nfor i in range(1,n-1):\n\ta+=p[i]>min(p[i-1],p[i+1]) and p[i]<max(p[i-1],p[i+1])\nprint(a)']
['Runtime Error', 'Accepted']
['s945547152', 's899392080']
[2940.0, 2940.0]
[17.0, 17.0]
[132, 139]
p02988
u696499790
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()))\nans=0\nfor i in range(1,n-1):\n pre=p[i-1]\n cur=p[i]\n nex=p[i+1]\n if (pre<cur and cur<nex) or(pre>cur and cur>nex):\n ans+=1\nprint(ans)', 'n=int(input())\np=list(map(int,input().split()))\nans=0\nfor i in range(1,n-1):\n pre=p[i-1]\n cur=p[i]\n nex=p[i+1]\n if ...
['Runtime Error', 'Accepted']
['s200687496', 's464161632']
[3064.0, 3060.0]
[17.0, 18.0]
[179, 187]
p02988
u708890186
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()]\ncnt=0\nfor i in range(1,N-1):\n if p[i-1]<p[i] and p[i]<p[i+1]:\n cnt+=1\nprint(cnt)', 'n=int(input())\np=[int(i) for i in input().split()]\ncnt=0\nfor i in range(1,n-1):\n if p[i-1]<p[i] and p[i]<p[i+1]:\n cnt+=1\n elif p[i-1]>p[i] and p[i]>p[i+1]:\n c...
['Runtime Error', 'Accepted']
['s275436565', 's224422390']
[2940.0, 3060.0]
[17.0, 17.0]
[135, 182]
p02988
u719886494
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())\nnum = list(map(int, input().split()))\ncnt = 0\nfor i in range(1, n) :\n if num[i - 1] > num[i] & num[i] > num[i + 1] :\n cnt += 1\n elif num[i - 1] < num[i] & num[i] < num[i + 1] :\n cnt += 1\nprint(cnt)', 'n = int(input())\nnum = list(map(int, input().split()))\ncnt = 0\nfor i in range(1, ...
['Runtime Error', 'Accepted']
['s682263427', 's811335938']
[3060.0, 3060.0]
[18.0, 17.0]
[222, 227]
p02988
u720065198
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 = map(int, input().split())\nans = 0\nfor i in range(1:n-1):\n if a[i-1]<a[i]<a[i+1] :\n ans+=1 \nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in range(1,n-1):\n if a[i-1]<a[i]<a[i+1] or a[i-1]>a[i]>a[i+1] :\n ans+=1 \nprint(ans)']
['Runtime Error', 'Accepted']
['s695318345', 's020505699']
[2940.0, 3060.0]
[17.0, 17.0]
[121, 154]
p02988
u723345499
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\nfor i in range(1, n):\n if (p[i] - p[i - 1] > 0 and p[i + 1] - p[i] >= 0) or (p[i] - p[i - 1] <= 0 and p[i + 1] - p[i] < 0):\n print("==", i, "==")\n cnt += 1\nprint(cnt)\n', 'n = int(input())\np = list(map(int, input().split()))\n\ncn...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s297009565', 's531540237', 's543945480', 's321304577']
[9128.0, 9116.0, 9120.0, 9124.0]
[23.0, 28.0, 22.0, 28.0]
[246, 245, 216, 220]
p02988
u729133443
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=open(0);*p,=map(int,p.split());print(sum(a<b<c for a,b,c in zip(p,p[1:],p[2:])))', '_,p=open(0);p=p.split();print(sum(sorted(a,key=int)[1]==a[1]for a in zip(p,p[1:],p[2:])))']
['Wrong Answer', 'Accepted']
['s005123721', 's886235899']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 89]
p02988
u729300713
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\nresult=0\nfor i in range(1,n-1):\n if max(p[i-1:i+1]) != p[i] and min(p[i-1:i+1]) != p[i]:\n result +=1\nprint(result)', 'n = int(input())\np = list(map(int, input().split()))\n\nresult=0\nfor i in range(1,n-1):\n if max(p[i-1:i+2]) != p[i] and min(p[i-1:i...
['Wrong Answer', 'Accepted']
['s122513742', 's847047301']
[3060.0, 2940.0]
[17.0, 17.0]
[172, 173]
p02988
u731362892
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}.
['#5\n#1 3 5 4 2\n#2\nN=int(input())\nnum=list(map(int,input().split()))\ncnt=0\nfor i in range(N-2):\n if li[i]<li[i+1]<li[i+2] or li[i+2]<li[i+1]<li[i]:\n cnt+=1\nprint(cnt) \n ', '#5\n#1 3 5 4 2\n#2\nN=int(input())\nli=list(map(int,input().split()))\ncnt=0\nfor i in range(N-2):\n if li[i]<li[i+1]<li[i+2] ...
['Runtime Error', 'Accepted']
['s785352261', 's370373756']
[2940.0, 3060.0]
[21.0, 17.0]
[177, 171]
p02988
u737840172
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}.
['# Vicfred\n\n# implementation\nn = int(input())\np = list(map(int,input()))\n\nanswer = 0\nfor i in range(1, n-1):\n if p[i-1] < p[i] < p[1+1] or p[i-1] > p[i] > p[i+1]:\n answer += 1\n\nprint(answer)\n\n', '# Vicfred\n\n# implementation\nn = int(input())\np = list(map(int,input().split()))\n\nanswer = 0\nf...
['Runtime Error', 'Accepted']
['s082240959', 's021728612']
[9140.0, 9024.0]
[23.0, 29.0]
[252, 260]
p02988
u739815962
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\nfrom collections import Counter\nfrom operator import itemgetter, attrgetter\nn=0\n \nn = input()\nd_list= list(map(int, input().split()))\ncnt=0\nfor i in range(1,len(d_list)-1):\n print(d_list[i])\n b=d_list[i-1]\n m=d_list[i]\n a=d_list[i+1]\n if (b< m <a) or (a< m< b):\n cnt+=1\n...
['Wrong Answer', 'Accepted']
['s830409627', 's835467253']
[3316.0, 3316.0]
[20.0, 21.0]
[327, 306]
p02988
u745097373
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 unittest\n\n\nclass TestB(unittest.TestCase):\n def test_1(self):\n self.assertEqual(think([1, 3, 5, 4, 2]), 2)\n\n def test_2(self):\n self.assertEqual(think([9, 6, 3, 2, 5, 8, 7, 4, 1]), 5)\n\n\ndef solve():\n p = read()\n result = think(p)\n write(result)\n\n\ndef read():\n n...
['Runtime Error', 'Accepted']
['s317031887', 's093831029']
[5744.0, 5612.0]
[47.0, 42.0]
[936, 975]
p02988
u747427153
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 range(n)]\ns = 0\nfor i in range(1,n-1):\n l1 = p[i-1,i+2]\n l2 = l1.copy()\n l2.sort()\n if l1[1] == l2[2]:\n s += 1\nprint(s)\n ', 'n = int(input())\np = [int(i) for i in input().split()]\ns = 0\nfor i in range(1,n-1):\n l1 = p[i-1:i+2]\n l2 = l1.copy()\n l2.sort()\...
['Runtime Error', 'Accepted']
['s203794083', 's969159165']
[2940.0, 2940.0]
[18.0, 17.0]
[167, 176]
p02988
u757030836
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 = [int(i) for i in input().split()]\nans = 0\n\nfor i in range(n):\n if i == 0 or i == n-1:\n continue\n x = p[i-1:i+2]\n y = sorted(x)\n\n if print(y[1]) == p[i]:\n ans +=1\n \nprint(ans)', 'n = int(input())\np = [int(i) for i in input().split()]\nans = 0\n\nfor i in range(n):\n i...
['Wrong Answer', 'Accepted']
['s929149844', 's041069917']
[3060.0, 3060.0]
[17.0, 17.0]
[209, 205]
p02988
u759412327
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()))\nc = 0\n\nfor i in range(a-2):\n if b[i]<b[i+1]<b[i+2]:\n c+=1\nelse:\n print(c)', 'N = int(input())\nP = list(map(int,input().split()))\na = 0\n\nfor n in range(N-2):\n if P[n]<P[n+1]<P[n+2] or P[n+2]<P[n+1]<P[n]:\n a+=1\n\nprint(a)']
['Wrong Answer', 'Accepted']
['s431460995', 's697061906']
[3060.0, 9120.0]
[19.0, 28.0]
[130, 145]
p02988
u763177133
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}.
['count = 0\nnum = int(input())\np = list(map(int, input().split()))\n\nfor i in range(len(p)-2):\n q = sorted(p[i:i+3])\n print(q)\n if q[1] == p[i+1]:\n count += 1\n \nprint(count)', 'count = 0\nnum = int(input())\np = list(map(int, input().split()))\n\nfor i in range(len(p)-2):\n q = sorted...
['Wrong Answer', 'Accepted']
['s876249992', 's564619982']
[9120.0, 9180.0]
[27.0, 25.0]
[193, 181]
p02988
u764956288
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 code_for_B(test=None):\n\n n = int(input)\n list_p = list(map(int, input().split()))\n \n pre = list_p[0]\n count = 0\n\n for i in range(1,n-1):\n cur = list_p[i]\n nxt = list_p[i+1]\n \n if pre >= cur > nxt:\n count += 1\n elif pre < cur < nxt:\n ...
['Runtime Error', 'Accepted']
['s742433205', 's639820181']
[3064.0, 3060.0]
[17.0, 17.0]
[391, 374]
p02988
u768890894
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 p[i-1]<p[i]<p[i+1]:\n ans+=1\n else :\n ans+=0\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]<p[i+1] or p[i+1]<p[i]<p[i-1]:\n ans+=1\n ...
['Wrong Answer', 'Accepted']
['s996602923', 's188204602']
[2940.0, 3060.0]
[17.0, 17.0]
[155, 177]
p02988
u769698512
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(intput())\np = list(map(int, input().split()))\ncnt = 0\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]):\n cnt += 1\nprint(cnt)\n', 'n = int(input())\np = list(map(int, input().split()))\ncnt = 0\nfor i in range(1, n-1):\n if (p[i-1] < p[i] and p[i] ...
['Runtime Error', 'Accepted']
['s645758028', 's141924369']
[2940.0, 3060.0]
[17.0, 17.0]
[187, 192]
p02988
u773686010
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())\nN_List = list(map(int,input().split()))\nct = 0\nfor i in range(1,N-1):\n print(N_List[i])\n if (N_List[i] > N_List[i-1]) & (N_List[i] < N_List[i+1]):\n ct += 1\n elif (N_List[i] < N_List[i-1]) & (N_List[i] > N_List[i+1]):\n ct += 1\n\n\nprint(ct)\n', 'N = int(input())\nN_List...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s337997218', 's563650377', 's886779696', 's891522191']
[9192.0, 9172.0, 9084.0, 9128.0]
[26.0, 27.0, 29.0, 26.0]
[278, 186, 184, 257]
p02988
u776864893
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}.
['_ = int(input())\ninput_arr = [int(x) for x in input().split()]\n\nfor i_ in range(len(input_arr)-2):\n arr_list = [input_arr[i] for i in range(i_,i_+3)]\n sorted_arr = sorted(arr_list)\n if sorted_arr[1] == arr_list[1]:\n print("Yes")', 'num_input = int(input())\ninput_arr = [int(x) for x in input()....
['Wrong Answer', 'Accepted']
['s560669248', 's683057395']
[3060.0, 3060.0]
[17.0, 17.0]
[244, 301]
p02988
u778700306
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}.
['input()\nps = map(int, input().split())\n\ndef count(ps):\n if len(ps) <= 2:\n return 0\n qs = sorted(ps[0:3])\n res = 1 if qs[1] == ps[1] else 0\n return res + count(ps[1:])\n\nprint(count(ps))\n', 'input()\nps = list(map(int, input().split()))\n\ndef count(ps):\n if len(ps) <= 2:\n retu...
['Runtime Error', 'Accepted']
['s401529747', 's676319124']
[3056.0, 3064.0]
[17.0, 17.0]
[204, 210]
p02988
u779728630
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\nfor i in range(N-2):\n if P[i] > P[i+1] and P[i+1] > P[i+2]:\n ans += 1\n\nprint(ans)', 'N = int(input())\nP = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(N-2):\n if P[i] > P[i+1] and P[i+1] > P[i+2] or P[i] < P[i+1] and P[i+1] ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s828362658', 's835587240', 's159050195']
[9204.0, 8884.0, 9124.0]
[29.0, 29.0, 23.0]
[148, 190, 186]
p02988
u792843593
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()\nnumbers = input().split()\n\nresult = 0\n\nif n >= "3":\n\tnumber_list = []\n\n\tfor i in numbers:\n\t\tnumber_list.append(i)\n\t\tif len(number_list) < 3:\n\t\t\tcontinue\n\t\telif len(number_list) > 3:\n\t\t\tnumber_list.pop(0)\n\n\t\tsorted_list = sorted(number_list)\n\t\tprint(sorted_list, number_lis...
['Wrong Answer', 'Accepted']
['s482499640', 's870890880']
[3060.0, 3060.0]
[17.0, 17.0]
[356, 352]
p02988
u797016134
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 li = sorted(p[i-1:i+2])\n print(li)\n if li[1] == p[i]:\n ans += 1\nprint(ans)', 'n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range(1,n-1):\n li = sorted(p[i-1:i+2])\n if li[1] =...
['Wrong Answer', 'Accepted']
['s387815194', 's096412345']
[3060.0, 3060.0]
[17.0, 17.0]
[175, 161]
p02988
u799428010
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(0,n):\n if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):\n ans=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]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):\n ans=a...
['Runtime Error', 'Accepted']
['s038081499', 's881381514']
[9152.0, 9168.0]
[25.0, 28.0]
[158, 161]
p02988
u804505290
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()))\ni=0\nfor x in range(0,n-2):\n if p[x]>p[x+1] and p[x+1]>p[x+2]:\n i=i+1\n if p[x]<p[x+1] and p[x+1]<p[x+2]:\n i=i+1\n if p[x]==p[x+1] and p[x+1]<p[x+2]:\n i=i+1\n if p[x]>p[x+1] and p[x+1]==p[x+2]:\n i=i+i\nprint(i)\n', 'n=int(i...
['Runtime Error', 'Accepted']
['s360655811', 's271053554']
[2940.0, 3064.0]
[17.0, 18.0]
[294, 295]
p02988
u805552010
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\nfor i in range(1,n-1):\n if p[i-1]<p[i]<p[i+1] or p[i-1]>p[i]>i[i+1]:\n ans += 1\nprint(ans)', 'n = int(input())\np = list(map(int,input().split()))\nans = 0\n\nfor i in range(1,n-1):\n a,b,c = p[i-1:i+2]\n if b != min(a,b,c,) and b !=...
['Runtime Error', 'Accepted']
['s090751541', 's600381263']
[3060.0, 2940.0]
[18.0, 17.0]
[161, 179]
p02988
u812817085
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()\nps=input()\n\nn=int(n[0])\nps=ps.split()\nps=[int(ps) for ps in ps]\n\noutput=0\nfor i-1 in range(n-2):\n if ps[i-1]<ps[i] and ps[i]<ps[i+1]:\n output=output+1\n elif ps[i+1]<ps[i] and ps[1]<ps[i-1]:\n output=output+1\n else:output=output+0\n \nprint(output)', 'n=input()\np=input(...
['Runtime Error', 'Accepted']
['s265895809', 's079441796']
[3064.0, 3064.0]
[17.0, 17.0]
[280, 288]
p02988
u812867074
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().split()))\nans=0\nfor i in range(1,n-1):\n if list[i-1] < list[i] <list[i+1]:\n ans += 1\nprint(ans)', 'n=int(input())\nlist=list(map(int,input().split()))\nans=0\nfor i in range(1,n-1):\n if list[i-1] <= list[i] <=list[i+1]:\n ans += 1\nprint(ans)\n', 'n=int(input())...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s215093772', 's571428344', 's224897680']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 18.0]
[140, 143, 178]
p02988
u813452457
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()))\n\nco = 0\n\nfor i in range(1,len(li)-1):\n a = li[i-1]\n b = li[i]\n c = li[i+1]\n \n if a < b and b < c:\n co += 1\nprint(co)', 'n = int(input())\n\nli = list(map(int,input().split()))\n\nco = 0\n\nfor i in range(1,len(li)-1):\n work = sort([li[i-1],l...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s433917558', 's582512835', 's226401316']
[3060.0, 3060.0, 3060.0]
[17.0, 18.0, 17.0]
[178, 182, 184]
p02988
u816935184
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(input().split())\ncnt=0\nprint(p)\nfor i in range(1,n-1):\n if p[i]!=max(p[i-1],max(p[i],p[i+1])) and p[i]!=min(p[i-1],min(p[i],p[i+1])):\n cnt+=1\n elif p[i+1]==p[i-1] and p[i-1]>p[i]:\n cnt+=1\n\nprint(cnt)', 'n=int(input())\np=list(input().split())\np=[int(i) for i in p]\...
['Wrong Answer', 'Accepted']
['s033483074', 's485632208']
[3064.0, 3060.0]
[17.0, 18.0]
[241, 188]
p02988
u822738981
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 p1, p2, p3 = p[i], p[i+1], p[i+2]\n aaa = [p1,p2,p3]\n aaa.sort()\n print(p1,p2,p3)\n if aaa[1] == p2:\n ans += 1\nprint(ans)\n', 'n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor i in range...
['Wrong Answer', 'Accepted']
['s662112339', 's385740318']
[3060.0, 3060.0]
[17.0, 17.0]
[225, 205]
p02988
u823885866
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\nimport math\nimport itertools\nimport collections\nimport heapq\nimport re\nimport numpy as np\n\nrr = lambda: sys.stdin.readline().rstrip()\nrs = lambda: sys.stdin.readline().split()\nri = lambda: int(sys.stdin.readline())\nrm = lambda: map(int, sys.stdin.readline().split())\nrl = lambda: list(map(int, s...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s134359534', 's942035977', 's974528397']
[27140.0, 27196.0, 27152.0]
[114.0, 119.0, 116.0]
[487, 489, 516]
p02988
u825378567
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()\nS=list(input().split())\ncount=0\nfor i in range(1,len(S)-1):\n if (S[i-1]<S[i] and S[i+1]>S[i]):\n count+=1\n break\n if(S[i-1]>S[i] and S[i+1]<S[i]):\n count+=1\nprint(count)', 'n=input()\nif n>20 or n<2:\n print(0)\nelse:\n S=list(input().split())\n count=0\n for i in rang...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s418955568', 's553853047', 's790246366', 's959321797', 's015700710']
[3060.0, 3064.0, 3064.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0, 17.0, 17.0]
[205, 256, 210, 187, 216]
p02988
u825440127
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(n-2):\n a = p[i:i+3]\n b = sorted.(a)\n if a[1] == b[1]:\n c += 1\nprint(c)\n', 'n = int(input())\np = list(map(int, input().split()))\n\ncount = 0\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...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s001822580', 's250001808', 's541532213', 's721884088', 's787386676', 's605696433']
[2940.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0, 17.0, 17.0]
[162, 168, 178, 185, 184, 161]
p02988
u830301612
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}.
['inp0=input()\ninp=[int(x) for x in input().split(" ")]\n \nans=0\nfor index in range(1,len(inp)-1):\n a =sorted([inp[index-1],inp[index],inp[index+1]])\n chk =list(set(a))\n if not len(chk)==1:\n if inp[1]==a[1]:\n ans =ans+1\nprint(ans)', 'inp0=input()\ninp=[int(x) for x in input().split(" ")]\n\nans=0\nf...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s812016300', 's930636900', 's461591919']
[3060.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[238, 192, 394]
p02988
u831752983
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(1,n-1):\n max = max(p[i-1],p[i],p[i+1])\n min = min(p[i-1],p[i],p[i+1])\n if p[i] != max and p[i] != min:\n ans += 1\nprint(ans)', 'n=int(input())\np=list(map(int,input().split()))\nans=0\nfor i in range(1,n-1):\n maxi = max(p[i-1],p[i],p[...
['Runtime Error', 'Accepted']
['s039080266', 's173300565']
[3060.0, 3060.0]
[18.0, 17.0]
[198, 204]
p02988
u832158848
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-1):\n\tif p[i]>p[i-1] and p[i]<p[i+1]:\n\t\tcount+=1\nprint('{}'.format(count))", "n=int(input())\np=list(map(int,input().split()))\ncount=0\nfor i in range(1,n-1):\n\tif (p[i]>p[i-1] and p[i]<p[i+1]) or (p[i]<p[i-1] and p[i]>p[i+1]):\n\t\t...
['Wrong Answer', 'Accepted']
['s242128930', 's538377026']
[2940.0, 3060.0]
[17.0, 24.0]
[148, 183]
p02988
u835732324
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\nnum = 0\nfor i in range(n):\n list_i = P[i:i+3]\n if list_i[1] == sorted(list_i)[-2]:\n num += 1\n else:\n num += 0\n\nprint(num)', 'n = int(input())\nP = list(map(int, input().split()))\n\nnum = 0\nfor i in range(n-2):\n list_i = P[i:...
['Runtime Error', 'Accepted']
['s203950355', 's161795096']
[3064.0, 3060.0]
[18.0, 17.0]
[198, 200]
p02988
u840988663
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())\nx = list(map(int, input().split()))\ncount=0\nfor i in range(A-2):\n b=x[i:i+3]\n a=sorted(b)\n print(a)\n if a[1] == b[1]:\n count=count+1\nprint(count)\n', 'A = int(input())\nx = list(map(int, input().split()))\ncount=0\nfor i in range(A-2):\n b=x[i:i+3]\n a=sorted(b)\n ...
['Wrong Answer', 'Accepted']
['s765438573', 's639927072']
[3060.0, 3060.0]
[17.0, 18.0]
[182, 168]
p02988
u842388336
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())\nnum_list = list(map(int,input().split()))\n\ncnt=0\nfor i in range(1,N-1):\n temp_list = num_list[i-1:i+2]\n print(temp_list)\n sort_list = sorted(temp_list)\n if temp_list[1] == sort_list[1]:\n cnt+=1\nprint(cnt)', 'N = int(input())\nnum_list = list(map(int,input().split()))\n\ncnt=0\nfor i ...
['Wrong Answer', 'Accepted']
['s690188642', 's866258874']
[3060.0, 2940.0]
[17.0, 17.0]
[228, 210]
p02988
u848647227
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())\nar = list(map(int,input().split(" ")))\ncount = 0\nfor i in range(1,a):\n if ar[i] < ar[i-1] and ar > ar[i+1]:\n count += 1\n elif ar[i] < ar[i+1] and ar > ar[i-1]:\n count += 1\nprint(count)', 'a = int(input())\nar = list(map(int,input().split(" ")))\ncount = 0\nfor i in range(1,a):\n if a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s128452187', 's610971304', 's900083163']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0]
[209, 216, 218]
p02988
u854685063
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 = [int(k) for k in input().split()]\ncnt = 0\nfor i in range(n-3):\n if a[i] < a[i+1] and a[i+1] < a[i+2]:cnt + =1\nprint(cnt)', 'n = int(input())\na = [int(k) for k in input().split()]\ncnt = 0\nfor i in range(n-2):\n if a[i] < a[i+1] and a[i+1] < a[i+2]:cnt += 1\n elif a[i] > a[i+1] and a[i+1...
['Runtime Error', 'Accepted']
['s778210882', 's165484930']
[8940.0, 9076.0]
[25.0, 29.0]
[142, 193]
p02988
u858247148
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(" ")\na = 0\nfor i in range(len(n)):\n pf = p[i]\n ps = p[i+1]\n pt = p[i+2]\n il = [int(pf),int(ps),int(pt)]\n max_p = max(il)\n il.remove(max_p)\n if int(ps) = max(il):\n a += 1\nprint(a)', 'n = int(input())\np = input().split(" ")\na = 0\nfor i in ran...
['Runtime Error', 'Runtime Error', 'Accepted']
['s776368770', 's907087743', 's819139754']
[2940.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[241, 242, 308]
p02988
u861141787
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\nfor i in range(1, n):\n\tif p[i-1] < p[i] and p[i] < p[i+1]:\n\t\tans += 1\n\t\t\nprint(ans)', 'n = int(input())\np = list(map(int, input().split()))\n\nans = set()\nfor i in range(1, n-1):\n\tprint(i)\n\ta = []\n\ta.append(p[i-1])\n\ta.append(p[i])\n\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s037966136', 's090859182', 's663461111']
[2940.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0]
[145, 310, 197]
p02988
u863370423
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())\nseqS=input().split(" ")\nnum=[]\nfor q in seqS:\n num.append(int(q))\ncontador=0\n\n\n#if num[0] > num[1]:\n \n\nfor i in range(1,len(num)-1):\n if num[i-1] > num[i] and num[i] > num[i+1] or num[i-1] < num[i] and num[i] < num[i+1]:\n contador+=1\n print(num[i-1],num[i],num[i+1])...
['Wrong Answer', 'Accepted']
['s861390142', 's901376902']
[3064.0, 3060.0]
[17.0, 18.0]
[391, 275]
p02988
u866769581
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}.
['#b.py\nn = int(input())\nlis = list(map(int,input()))\nans = 0\nfor x,y,z in zip(lis,lis[1:],lis[2:]):\n if x < y < z:\n ans += 1\nprint(ans)', '#b.py\nn = int(input())\nlis = list(map(int,input().split()))\nans = 0\nfor x,y,z in zip(lis,lis[1:],lis[2:]):\n if x < y < z or z < y < x:\n ans += 1\np...
['Runtime Error', 'Accepted']
['s971496593', 's661265618']
[2940.0, 3060.0]
[18.0, 17.0]
[144, 165]
p02988
u867604473
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=[int(t.split())for t in open(0)]\nprint(sum([(p[i+1]-p[i])*(p[i]-p[i-1]) < 0 for i in range(1,n)]))', '\nn = int(input())\np = list(map(int,input().split()))\nprint(sum([max(p[i+1],p[i],p[i-1]) != p[i] and min(p[i+1],p[i],p[i-1]) != p[i] for i in range(1,n-1)]))']
['Runtime Error', 'Accepted']
['s623984339', 's706072782']
[3060.0, 3060.0]
[20.0, 17.0]
[103, 156]
p02988
u870906509
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 if p[i-1]<p[i] and p[i]<p[i+1]:\n cnt += 1\n elif p[i-1]>p[i] and p[i]>p[i+1]:\n cnt += 1\n else:\n cnt =cnt\nprint(cnt)', 'n = int(input())\np = list(map(int,input().split())) \ncnt = 0\nfor i in rang...
['Wrong Answer', 'Accepted']
['s374436279', 's763270084']
[3064.0, 3064.0]
[17.0, 17.0]
[227, 230]
p02988
u880277518
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)\nsum=0\nfor i in range(1,n-1):\n if p[i]>=p[i-1] and p[i]<=p[i+1]:\n sum+=1\n elif p[i]>=p[i+1] and p[i]<=p[i-1]:\n sum+=1\n\nprint(sum)', 'n=int(input())\np=list(map(int,input().split()))\nsum=0\nfor i in range(1,n-1):\n if p[i]>=p[i-1...
['Wrong Answer', 'Accepted']
['s858940398', 's877710928']
[3188.0, 3060.0]
[19.0, 19.0]
[205, 196]
p02988
u882937587
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())\nd = list(map(int, input().split()))\n\na = len(d)/2\nl = d[a+1] - d[a]\n\nprint(l)\n', 'n = int(input())\ns = list(map(int, input().split()))\n\nl = 0\nfor i in range(1, n-1):\n if s[i-1] < s[i] < s[i+1] or s[i+1] < s[i] < s[i-1]:\n l += 1\n\nprint(l)\n']
['Runtime Error', 'Accepted']
['s339656996', 's022101617']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 166]
p02988
u888965338
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}.
["if __name__ == '__main__':\n input()\n a = list(map(int, input().split()))\n count = 0\n for i in range(0, len(a) - 2):\n old = a[i:i + 3]\n new = sorted(old)\n print(old, new, old[1], new[1])\n if old[1] == new[1]:\n count += 1\n print(count)\n", "if __name__ == ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s419638775', 's820239883', 's609162165']
[3060.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[288, 288, 248]
p02988
u889344512
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())\npn = list(map(int,input().split()))\n\ncount = 0\nfor i in range(1,n-1):\n if (pn[i] > pn[i-1] and pn[i] < pn[i+1]) or (pn[i] < pn[i-1] and pn[i] > pn[i+1]):\n count += 1\n', 'count = 0\nn = int(input())\np = list(map(int,input().split()))\n\nfor i in range(n-2):\n if p[i] < p[i+1] < p[...
['Wrong Answer', 'Accepted']
['s931110605', 's430155810']
[2940.0, 3060.0]
[18.0, 17.0]
[193, 198]
p02988
u894381129
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\ncollect = 0\nfor i in range(n - 2):\n p_small = p[i: i + 2]\n p_min = min(p_small)\n p_max = max(p_small)\n pi = p_small[1]\n \n if pi > p_min and pi < p_max:\n collect += 1\n \nprint(collect)', 'n = int(input())\np = list(map(in...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s253742534', 's864252091', 's473131671']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[268, 269, 459]
p02988
u896741788
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())\nans=0\nfor i in range(1,n-1):\n p=max(l[i-1],l[i+1])\n q=min(l[i-1],l[i+1])\n if q<=l[i]<=p:ans+=1\nprint(ans)', 'n=int(input())\nans=0\nl=list(map(int,input().split()))\nfor i in range(1,n-1):\n p=max(l[i-1],l[i+1])\n q=min(l[i-1],l[i+1])\n if q<=l[i]<=p:ans+=1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s812248832', 's886843717']
[3060.0, 2940.0]
[18.0, 17.0]
[123, 157]
p02988
u897302879
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())\nns = map(input().split(), int)\n\nc = 0\nfor i in range(1, n):\n if sorted([n[i-1], n[i], n[i+1]])[2] == n[i]:\n c += 1\n \nprint(c)', 'n = int(input())\nns = list(map(int, input().split()))\n\nc = 0\nfor i in range(1, n-1):\n if sorted([ns[i-1], ns[i], ns[i+1]])[1] == ns[i]:\n c += 1\n ...
['Runtime Error', 'Accepted']
['s977180585', 's486031904']
[2940.0, 2940.0]
[17.0, 17.0]
[149, 162]
p02988
u900139929
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()\nnums = input().split(' ')\nprint(nums)\nnums = [int(num) for num in nums]\ncnt=0\n\nfor i in range(1,len(nums)-1):\n \n print(nums[i-1], nums[i], nums[i+1])\n if nums[i-1] < nums[i] and nums[i] < nums[i+1]:\n cnt += 1\n print('OK')\n if nums[i+1] < nums[i] and nums[i] < nums[i-1]:\n cnt += 1...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s322118929', 's390584088', 's777485186']
[3064.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[342, 357, 257]
p02988
u901598613
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=list(map(int,input().split()))\nans=0\nfor i in range(n-1):\n a=l[i:i+3]\n b=a[1]\n c=sorted(a)\n if b==c[1]:\n ans+=1\nprint(ans)', 'n=input()\nl=list(map(int,input().split()))\nans=0\nfor i in range(n-2):\n a=l[i:i+3]\n b=a[1]\n c=sorted(a)\n if b==c[1]:\n ans+=1\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s522657361', 's838126541', 's069990716']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[153, 153, 158]
p02988
u903005414
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\nfor i in range(n-2):\n if sorted([p[i], p[i+1], p[i+2])[1] == p[i+1]:\n cnt += 1\nprint(cnt)\n', 'n = int(input())\np = list(map(int, input().split()))\n\ncnt = 0\nfor i in range(n - 2):\n if p[i] < p[i + 1] < p[i + 2]:\n cnt += 1\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s098227124', 's413699454', 's295998592']
[3064.0, 2940.0, 3064.0]
[18.0, 18.0, 18.0]
[162, 148, 202]
p02988
u904412590
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 collections\n\nn = int(input()) \nt = input().split(' ')\nc = 0\n\nfor i in range(1, n-1):\n l = [t[i-1], t[i], t[i+1]]\n if (t[i] >= t[i-1] and t[i] <= t[i+1]) \\\n \tor (t[i] <= t[i-1] and t[i] >= t[i+1]) \\\n or not (t[i] == t[i-1] and t[i] == t[i+1]):\n c += 1\n \nprint(c)", "import collections...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s219857844', 's238008362', 's684117085']
[3316.0, 3316.0, 3060.0]
[20.0, 21.0, 17.0]
[280, 287, 189]
p02988
u912179452
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()))\n\ncnt = 0\nfor n in range(1, len(p) - 1):\n print("p[n-1]={} p[n]={} p[n+1]={}".format(p[n - 1], p[n], p[n + 1]))\n print("------------------")\n if p[n - 1] > p[n + 1]:\n if p[n - 1] > p[n] and p[n] > p[n + 1]:\n print("True")\n ...
['Wrong Answer', 'Accepted']
['s183637536', 's628279545']
[3064.0, 3060.0]
[18.0, 17.0]
[441, 274]
p02988
u914330401
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())\nli = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, n-1):\n if li[i-1] > li[i] and li[i+1] < li[i]:\n ans += 1\n if if li[i-1] < li[i] and li[i+1] > li[i]:\n ans += 1\nprint(ans)', 'n = int(input())\nli = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, n-1):\n i...
['Runtime Error', 'Accepted']
['s094152313', 's157989943']
[2940.0, 3060.0]
[17.0, 18.0]
[210, 208]
p02988
u923270446
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(input().split()))\ni = 1\ncnt = 0\nwhile i < len(p):\n if p[i] > p[i - 1] and p[i] < p[i + 1] :\n cnt += 1\n i += 1', 'n = int(input())\nif n == 1:\n p = int(input())\nelse:\n p = list(map(input().split()))\ni = 1\ncnt = 0\nwhile i < len(p):\n if p[i] > p[i - 1] and p[i] < p[i +...
['Runtime Error', 'Runtime Error', 'Accepted']
['s482945530', 's974441210', 's241845338']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[144, 182, 181]
p02988
u927530154
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().rstrip())\np = [int(x) for x in input().rstrip().split()]\n\nprint(p)\n\ncount = 0\nfor i in range(1, n - 1):\n if (p[i] > p[i - 1] and p[i] < p[i + 1]) or \\\n (p[i] < p[i - 1] and p[i] > p[i + 1]):\n count += 1\nprint(count)\n', 'n = int(input().rstrip())\np_string = input().rstrip(...
['Wrong Answer', 'Accepted']
['s741826387', 's984528891']
[3060.0, 3060.0]
[17.0, 17.0]
[249, 259]
p02988
u927534107
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()))\nans=0\nfor i in range(1,n-1):\n if l[i-1]<l[i]<l[i+1] or l[i+1]<l[i]<l[i-1]\n ans+=1 \n print(ans)', 'n=int(input())\nl=list(map(int,input().split()))\nans=0\nfor i in range(1,n-1):\n if l[i-1]<l[i]<l[i+1] or l[i+1]<l[i]<l[i-1]:\n ans+=1 \nprint(ans)\n']
['Runtime Error', 'Accepted']
['s344621391', 's399390898']
[2940.0, 2940.0]
[17.0, 17.0]
[145, 146]
p02988
u932868243
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 l=[p[i],p[i+1],p[i+2]]\n if p[i+1]==min(l):\n ans+=1\nprint(ans)', 'n=int(input())\np=list(map(int,input().split()))\nans=0\nfor i in range(n-2):\n l=[p[i],p[i+1],p[i+2]]\n l.sort()\n if l[1]==p[i+1]:\n ans+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s645910287', 's087773370']
[9136.0, 9104.0]
[23.0, 23.0]
[142, 151]
p02988
u933129390
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-3):\n if p[i] < p[i+1] < p[i+2] or p[i] > p[i+1] > 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 p[i] < p[i+1] < p[i+2] or p[i] > p[i+1] >...
['Wrong Answer', 'Accepted']
['s198976727', 's913467480']
[3060.0, 3064.0]
[19.0, 17.0]
[172, 246]
p02988
u934402094
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(n-2):\n if a[i] < a[i+1] < a[i+2] or a[i+2] < a[i+1] < a[i]\n cnt += 1\nprint(cnt)', 'n = int(input())\na = list(map(int, input().split()))\ncnt = 0\nfor i in range(n-2):\n if a[i] < a[i+1] < a[i+2] or a[i+2] < a[i+1] < a[i]:\...
['Runtime Error', 'Accepted']
['s329179316', 's147925703']
[2940.0, 3064.0]
[17.0, 18.0]
[165, 166]
p02988
u934788990
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(' ')))\nnum = 0\nfor i in range(1,N-1):\n if min(P[i-1],P[i+1]) < P[i] and P[i] <max(P[i-1],P[i+1]):\n num += 1\nprint(num)", "N = int(input())\nP = list(map(int,input().split(' ')))\nnum = 0\nfor i in range(1,N-1):\n\tif min(P[i-1],P[i+1]) < P[i] and P[i] <max...
['Runtime Error', 'Runtime Error', 'Accepted']
['s077903493', 's428911460', 's671685703']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[173, 172, 172]
p02988
u935522051
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())\nli = list(map(int,input().split()))\t\ncount = 0\nfor i in range(1,a-1):\n if li[i-1]<li[i] and li[i]<li[i+1]:\n count += 1\n else:\n pass\nprint(count)', 'a=int(input())\nli = list(map(int,input().split()))\t\ncount = 0\nfor i in range(1:a):\n if li[i-1]<li[i] and li[i]<li[i+1]:\n count +...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s340151983', 's575408359', 's823572006']
[3060.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[167, 165, 222]
p02988
u939555793
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 second_smallest(numbers):\n m1, m2 = float('inf'), float('inf')\n for x in numbers:\n if x <= m1:\n m1, m2 = x, m1\n elif x < m2:\n m2 = x\n return m2\n\nn = int(input())\nnumbers = input()\n\nnumbers = [int(x) for x in numbers.split()]\n\nprint(numbers)\nsmallest = s...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s028100107', 's219448657', 's920150888']
[3064.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0]
[564, 564, 406]
p02988
u948911484
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(2,n-1):\n if p[i-1]<p[i]<p[i+1] or p[i-1]>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]<p[i+1] or p[i-1]>p[i]>p[i+1]:\n ans += 1\nprint(...
['Wrong Answer', 'Accepted']
['s078588365', 's716583501']
[3060.0, 3060.0]
[17.0, 18.0]
[153, 153]
p02988
u963963908
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())\nK = 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 K += 1\n \nprint(K)', '#ABC132 B\n\nn = int(input())\nP = list(map(int,input().split()))\nK = 0\nfor i in range(n-2):\n T = [P[i], P[i+1], P[i+2]]\n T.sort()\n if T[2] == P[i+1]:\n K += 1\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s484612111', 's508804549', 's978305733', 's335713662']
[9052.0, 9168.0, 9148.0, 9052.0]
[22.0, 24.0, 24.0, 25.0]
[125, 189, 164, 205]
p02988
u966000628
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()))\ncount = 0\ni = 0\nwhile(i < n-2):\n temp = lis[i:i+3]\n if temp[1] == sorted(temp)[1]:\n count += 1\nprint(count)', 'n = int(input())\nlis = list(map(int,input().split()))\ncount = 0\ni = 0\nwhile(i < n-2):\n temp = lis[i:i+3]\n if temp[1] == sorted(temp)...
['Time Limit Exceeded', 'Accepted']
['s737039464', 's316927057']
[2940.0, 3060.0]
[2104.0, 17.0]
[166, 178]
p02988
u969848070
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()))\na = 0\nfor i in range(n-2):\n if p[i]<p[i+1] and p[i+1] < p[i+2]:\n a += 1\nprint(a)', 'n = int(input())\np = list(map(int, input().split()))\na = 0\nfor i in range(n-2):\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 a += ...
['Wrong Answer', 'Accepted']
['s568817861', 's760810566']
[2940.0, 3060.0]
[17.0, 17.0]
[137, 176]
p02988
u981304949
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(inout())\nA = list(map(int, input().strip().split()))\ncount = 0\nfor i in range(1,n-1):\n if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):\n count += 1\n else:\n count += 0\nprint(count)\n ', 'n = int(input())\nA = list(map(int, input().strip().split()))\ncount = 0\nfor i in range...
['Runtime Error', 'Runtime Error', 'Accepted']
['s252584494', 's955614947', 's809063525']
[2940.0, 3060.0, 3060.0]
[19.0, 17.0, 18.0]
[217, 215, 217]
p02988
u982438430
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\nfor i in range(2,n,1):\n if p[i-1]<p[i]:\n if p[i]<=p[i+1]:\n a +=1\n if p[i+1]<p[i]:\n if p[i]<=p[i-1]:\n a +=1\n\nprint(a)\n ', 'n = int(input())\np = list(map(int,input().split()))\n\na = 0\nfor i in range(1,n-1,1):\n if p[i-1]<p[i]...
['Runtime Error', 'Accepted']
['s616434038', 's973179336']
[3060.0, 3064.0]
[18.0, 17.0]
[196, 198]
p02988
u982462877
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}.
['ss = input()\ns = int(ss)\n\nnums = input().split()\ntype(nums)\ntype(nums[0])\n\ncount = 0\nfor val in range(s -2):\n if list[val] > list[val + 1] > list[val + 1] or list [val] < list[val + 1] < list[val + 2]:\n count += 1\n \nprint(count)', 's = input()\nall[20]\n\nfor val int range(s):\n all[va...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s478181085', 's539535528', 's753850919', 's718716464']
[3060.0, 2940.0, 3064.0, 3060.0]
[17.0, 17.0, 18.0, 17.0]
[245, 186, 318, 232]
p02988
u991130896
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().split()))\n\nans = 0\nfor i in range(N-2):\n if list[i+1] > List[i] and list[i+1] < List[i+2]:\n ans+=1\n if list[i+1] < List[i] and list[i+1] > List[i+2]:\n ans+=1\n else:\n pass\n\nprint(ans)', 'N = int(input())\nlist = list(map(int,input().split()))\n\nans ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s316330262', 's349663634', 's696350382', 's026548357']
[3060.0, 3060.0, 3064.0, 3060.0]
[18.0, 17.0, 19.0, 17.0]
[239, 219, 259, 218]
p02988
u994064513
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(s) for s in input.split()]\n\ncnt = 0\n\nfor i in range(1,N-1):\n if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]\n \tcnt += 1\n\n if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]\n \tcnt += 1\n \nprint(cnt)', 'N = int(input())\np_list = [int(s) for s in input.split...
['Runtime Error', 'Runtime Error', 'Accepted']
['s219200264', 's665470627', 's868107522']
[2940.0, 3064.0, 3064.0]
[17.0, 18.0, 17.0]
[245, 250, 246]
p02989
u017415492
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['n=int(input())\nd=list(map(int,input().split()))\nd.sort()\ngn=0\na=d[int(n/2)]-d[int((n/2)-1)]-1\n\nif d[int(n/2)]!=d[int((n/2)-1)]:\n for i in d:\n if i==d[int(n/2)]:\n gn+=1\n if gn==1:\n a+=1\n print(a)\n print(d)\n \nelse:\n print(0)', 'n=int(input())\nd=list(map(int,input().split()))\nd.sort...
['Wrong Answer', 'Accepted']
['s050752156', 's203149175']
[14556.0, 14428.0]
[111.0, 76.0]
[242, 104]
p02989
u017624958
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N = int(input())\nd = list(map(int, input().split()))\n\nsame = N / 2\n\n\n\n# distribution = [0] * d[len(d) - 1]\n\n\n# num = d.count(di)\n\n\ntable = {}\nfor di in d:\n table[di] = 0 if table[di] is None else table[di] + 1\n\n\n\n\n\n\n\n\n# if totals[i] == same:\n\n\n# break\n\nprint(1)\n', 'N =...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s072989017', 's287889191', 's324455096', 's573759739', 's822264699', 's949242981', 's015829359']
[14396.0, 14180.0, 15712.0, 14396.0, 14396.0, 2940.0, 15712.0]
[42.0, 85.0, 102.0, 2104.0, 2104.0, 18.0, 113.0]
[525, 545, 621, 430, 433, 526, 587]
p02989
u017982343
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
["N = int(input())\nD = input()\nD = D.split(' ')\nD = [int(d) for d in D]\nD_sort = np.sort(D)\n\nk = int(N/2)\ncount = 0\n\nlow_d = D_sort[k-1]\nhight_D = D_sort[k]\ndis = hight_D - (low_d+1) + 1\n\nprint(dis)\n ", "import numpy as np\n\nN = int(input())\nD = input()\nD = D.split(' ')\nD = [int(d) for d in D]\nD...
['Runtime Error', 'Accepted']
['s871009394', 's613565006']
[14396.0, 23416.0]
[44.0, 314.0]
[202, 222]
p02989
u021019433
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['m = int(input()) // 2\na = sorted(map(int, input().split()))\nprint(a[n] - a[m - 1])\n', 'm = int(input()) // 2\na = sorted(map(int, input().split()))\nprint(a[m] - a[m - 1])\n']
['Runtime Error', 'Accepted']
['s054949768', 's779460368']
[14120.0, 14428.0]
[76.0, 76.0]
[83, 83]
p02989
u023229441
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['n=int(input())\nA=sorted(list(map(int,input().split())))\nif n%2==1:\n print(0)\nelse:\n print(A[n//2]-A[n//2-1]+1)', 'n=int(input())\nA=sorted(list(map(int,input().split())))\nif n%2==1:\n print(0)\nelse:\n print(A[n//2]-A[n//2-1] )\n']
['Wrong Answer', 'Accepted']
['s816407465', 's767420912']
[13992.0, 14428.0]
[78.0, 76.0]
[112, 112]
p02989
u027076164
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N = int(input())\nd = list(map(int,input().split()))\nd.sort()\na = d[N/2-1]\nb = d[N/2]\nif a != b:\n print(b-a)\nif a == b:\n print(0)', 'N = int(input())\nd = list(map(int,input().split()))\nd.sort()\na = d[N/2-1]\nb = d[N/2]\nprint(b-a)', 'N = int(input())\nd = list(map(int,input().split()))\nd.sort()\na = d[N/...
['Runtime Error', 'Runtime Error', 'Accepted']
['s677287694', 's872765629', 's942315098']
[14428.0, 14428.0, 14428.0]
[75.0, 75.0, 77.0]
[130, 95, 132]
p02989
u027855659
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['n = int(input())\nd = list(map(int,input().split()))\n\narc_list = list()\nabc_list = list()\n\nharf_num = int(n/2)\n\nd.sort()\nabc_list = d[:harf_num]\narc_list = d[harf_num:]\n\nabc_max = max(abc_list)\narc_min = min(arc_list)\n\nprint(abc_max - arc_min)', 'n = int(input())\nd = list(map(int,input().split()))\n\na...
['Wrong Answer', 'Accepted']
['s216953388', 's217363744']
[14396.0, 14396.0]
[83.0, 81.0]
[242, 242]
p02989
u037221289
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
["N = int(input())\nX = int(N/2)\nD = list(map(int,input().split(' ')))\nD.sort()\nprint(D[X] -(D[X-1]+1))", "N = int(input())\nX = int(N/2)\nD = list(map(int,input().split(' ')))\nD.sort()\nprint(D[X] -D[X-1])\n"]
['Wrong Answer', 'Accepted']
['s039719922', 's557901815']
[14396.0, 14556.0]
[76.0, 77.0]
[100, 97]
p02989
u040016087
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
["n = int(input())\nd_list = [int(i) for i in input().rstrip().split(' ')]\nd_list.sort()\nprint(d_list)\n\na = int(n/2) -1\nb = int(n/2)\n\nif d_list[a] == d_list[b]:\n print(0)\nelse:\n print(d_list[b] - d_list[a])\n", "n = int(input())\nd_list = [int(i) for i in input().rstrip().split(' ')]\nd_list.sort()\n\na = i...
['Wrong Answer', 'Accepted']
['s873639632', 's933676581']
[14428.0, 14120.0]
[90.0, 78.0]
[206, 192]
p02989
u040141413
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N = int(input())\nd = list(map(int, input().split())) \nprint(len(d))\n\nif(len(d)%2!=0):\n print(0)\nelse: \n print(d[int(len(d)/2)+1]-d[int(len(d)/2)])', 'N = int(input())\nd = list(map(int, input().split())) \nd.sort()\n\nif(len(d)%2!=0):\n print(0)\nelse: \n print(d[int(len(d)/2)+1]-d[int(len(d)/2)])'...
['Runtime Error', 'Runtime Error', 'Accepted']
['s078055487', 's777661811', 's878011642']
[14428.0, 14008.0, 14396.0]
[41.0, 75.0, 77.0]
[152, 147, 147]
p02989
u042385277
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N = int(input())\nd = list(map(int, input().split()))\nd_sort = sorted(d)\nprint(d_sort[N/2] - d_sort[N/2 - 1])\n', 'N = int(input())\nd = list(map(int, input().split()))\nd_sort = sorted(d)\nprint(d_sort[N/2] - d_sort[N/2-1])\n', 'N = int(input())\nd = list(map(int, input().split()))\nd_sort = sorted(d)\nprint(d_sor...
['Runtime Error', 'Runtime Error', 'Accepted']
['s322898754', 's331424574', 's282853336']
[13992.0, 14428.0, 14428.0]
[81.0, 77.0, 80.0]
[109, 107, 111]
p02989
u054825571
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['n=int(input())\nd=list(map(int,input().split()))\nd.sorted()\nprint(d[n/2]-d[n/2-1])', 'n=int(input())\nd=list(map(int,input().split()))\nd.sort()\nprint(d[n//2]-d[n//2-1])']
['Runtime Error', 'Accepted']
['s828110916', 's954811042']
[20716.0, 20728.0]
[49.0, 69.0]
[81, 81]
p02989
u054931633
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['n=int(input())\nl=list(map(int,input().split()))\nl.sort()\na=n/2\ns=l.index(a-1)\nt=l.index(a)\nif s==t:\n print("0")\nelse:\n ans=t-s\n print(ans)', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\na=int(n/2)\ns=l[a-1]\nt=l[a]\nif s==t:\n print("0")\nelse:\n ans=t-s\n print(ans)']
['Runtime Error', 'Accepted']
['s805493999', 's302481440']
[20744.0, 20648.0]
[69.0, 67.0]
[141, 134]
p02989
u055854974
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N = int(input())\n\narray = list(map(int, input().split())).sort()\n\nprint(array[N//2]-array[N//2-1])', 'N = int(input())\n\narray = sorted(list(map(int, input().split())))\n\nprint(array[N//2]-array[N//2-1])']
['Runtime Error', 'Accepted']
['s968452381', 's421079762']
[14008.0, 14428.0]
[75.0, 75.0]
[98, 99]
p02989
u058640635
2,000
1,048,576
Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K, as follows: * A problem with difficulty K or higher will be _f...
['N=int(input())\nd=[int(input().sprit())]\nd.sort()\nprint(d[N]-d[N-1])', 'N=int(input())\nx=int(N/2)\nd=[int(x) for x in (input().split())]\nd.sort()\nprint(d[x]-d[x-1])']
['Runtime Error', 'Accepted']
['s963664972', 's792384007']
[4724.0, 14428.0]
[18.0, 82.0]
[67, 91]