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
p02953
u872125596
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N=int(input())\nH=list(map(int,input().split()))\nans =True\ni=0\n\nma=max(H)\nnum=H.index(ma)\nfor i in range(num,N):\n if ma-2 >= H[i]:\n ans = False\n \n\n\nif ans or N==1:\n print("YES")\nelse:\n print("NO")\n ', 'N=int(input())\nH=list(map(int,input().split()))\n\nfor i in range(N-1):\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s086165973', 's217356695', 's235815727', 's528032206', 's028548210']
[14396.0, 14396.0, 14252.0, 14396.0, 14252.0]
[56.0, 80.0, 56.0, 56.0, 90.0]
[223, 238, 219, 219, 274]
p02953
u872887731
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH_ = list(map(int,input().split()))\nfor i in reversed(range(N-1)):\n if H_[i+1] < H_[i]:\n H_[i] = H_[i] -1\n\nans = 1\nfor i in range(N-1):\n if H_[i+1] < H_[i]:\n ans = 0\nif ans == 0:\n print("No")\nelse:\n print("Yse")', 'N = int(input())\nH_ = list(map(int,input().spl...
['Wrong Answer', 'Accepted']
['s311237470', 's181523859']
[14396.0, 14252.0]
[89.0, 90.0]
[254, 254]
p02953
u875028418
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\nh=map(int,input().split())\nif n==1:\n print("Yes")\nelse:\n for i in range(n-1):\n if h[i]>h[i+1]+1:\n print("No")\n else:\n print("Yes")', 'n=int(input())\nh=list(map(int,input().split()))\nif n==1:\n print("Yes")\nelse:\n h[0]-=1\n for i in range(n-1):\n if h[i]>h[i+1]:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s685061413', 's783568919', 's521437754']
[11152.0, 14396.0, 14252.0]
[27.0, 81.0, 71.0]
[163, 265, 214]
p02953
u879481122
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = input().split()\nlist = [int(x) for x in H]\n \nflg, add = 'Yes', False\nfor i, l in enumerate(list):\n if i + 1 == len(list):\n break\n if add: l = l + 1 \n if l > list[i + 1]:\n flg = 'No'\n break\n elif l - 1 == list[i + 1]:\n add = True\n elif l - 1 > list[i + 1]:\n flg =...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s133542394', 's399375974', 's465197072', 's493236260', 's508550793', 's908322302', 's432057897']
[14704.0, 16372.0, 11152.0, 14396.0, 14224.0, 14396.0, 14252.0]
[108.0, 235.0, 28.0, 73.0, 106.0, 111.0, 107.0]
[355, 389, 189, 191, 346, 350, 375]
p02953
u885819526
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['b = input()\nh = [int(i) for i in input().split(" ")]\nhh = [i - 1 for i in h]\nn = hh[0]\nfor i in range(1, len(h)):\n if n <= hh[i]:\n n = hh[i]\n elif n <= h[i]:\n n = h[i]\n else:\n print("NO")\n break\nelse:\n print("YES")\n', 'b = input()\nh = [int(i) for i in input().spl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s539638059', 's572883747', 's946168926']
[14396.0, 14224.0, 14396.0]
[72.0, 87.0, 74.0]
[255, 283, 255]
p02953
u888881904
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = list(map(int,input().split()))\n\nA = 0\nlist = []\nfor i in H:\n i = i - 1\n if A > i:\n list.append(i)\n\n A = i\n\nprint(list)\n\nif not list:\n print("Yes")\nelif list[0] == 0:\n print("Yes")\nelif list:\n print("No")\nelse:\n print("Yes")', "n = int(input())\nh =...
['Wrong Answer', 'Accepted']
['s968916468', 's536186394']
[14252.0, 14396.0]
[74.0, 82.0]
[272, 226]
p02953
u890461092
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["kazu = int(input())\nsuji = input().split()\n\nl_si_i = [int(s) for s in suji]\n\nif kazu == 1:\n print('Yes')\n exit()\n\nfor i in range(kazu):\n if kazu - i != 1:\n if l_si_i[i+1] - l_si_i[i] == 0:\n continue\n elif l_si_i[i+1] - l_si_i[i] == 1:\n continue\n elif ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s575531081', 's680028148', 's758571020', 's206294254']
[14396.0, 14704.0, 14836.0, 14396.0]
[124.0, 120.0, 130.0, 82.0]
[565, 880, 1266, 156]
p02953
u892227843
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["# -*- coding: utf-8 -*-\nN = int(input())\nH = [int(j) for j in input().split()]\n\nflag = 1\n\nif N == 2:\n if H[0]>H[1]:\n H[0] -= 1\nelse:\n for i in range(N-2,-1,-1):\n if H[i]>H[i+1]:\n H[i] -= 1\n\nfor i in range(N-1):\n if H[i]>H[i+1]:\n flag = 0\n\nprint(H)\n\nif flag == 1...
['Runtime Error', 'Accepted']
['s630518770', 's710322528']
[2940.0, 14704.0]
[17.0, 88.0]
[338, 332]
p02953
u894074703
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["def q3():\n N = int(input())\n H = [int(i) for i in input().split()]\n ans = 'Yes'\n if len(H) == 1:\n print(ans)\n return\n\n for i in range(1, len(H) - 1):\n if H[i-1] > H[i] > H[i+1]:\n ans = 'No'\n break\n elif H[i] - H[i-1] > 1 or H[i+1] - H[i] > 1...
['Wrong Answer', 'Accepted']
['s708953403', 's944803327']
[14224.0, 14708.0]
[77.0, 65.0]
[403, 395]
p02953
u895068367
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = input()\nl = list(map(int, input().split()))\n\nif l.count(0)+ l.count(1) == len(l):\n print("Yes")\nelse:\n l1 = l[1:]+[0]\n print(l1)\n d = [i-j for (i,j) in zip(l1, l)][:-1] \n print(d)\n if -2 in d:\n print("1No")\n else:\n s = \'\'.join(map(str, d)) \n spl = s.split(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s128646035', 's215095660', 's693123568', 's114821972']
[21836.0, 20800.0, 22728.0, 16172.0]
[102.0, 93.0, 106.0, 77.0]
[892, 924, 887, 984]
p02953
u896741788
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\nl=list(map(int,input().split()))\nbefore=l[0];d=0\nfor i in range(n):\n if before-l[i]>1:print(\'No\');exit()\n elif before-l[i]==1:\n if d:print("No");exit()\n else:d+=1\n else:before=l[i];d=0\nprint("Yes")', 'n=int(input())\nl=list(map(int,input().split()))\nbefore=l[0];d=0\nfor i in range(...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s058085594', 's838399222', 's840097518', 's600707078']
[14396.0, 14252.0, 2940.0, 14396.0]
[76.0, 80.0, 17.0, 88.0]
[221, 252, 140, 254]
p02953
u897536433
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n = int(input())\nh = [int(x) for x in input().split()]\ntmp = h[n-1]\nfor i in h[::-1]:\n print(tmp, i)\n if i <= tmp:\n tmp = i\n elif i-1 <= tmp:\n tmp = i-1\n else:\n print('No')\n exit()\nprint('Yes')\n", "n = int(input())\nh = [int(x) for x in input().split()]\ntmp = h[n-...
['Wrong Answer', 'Accepted']
['s443120495', 's639217089']
[14396.0, 14252.0]
[161.0, 58.0]
[234, 216]
p02953
u900303768
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nlh = list(map(int,input().split()))\n\ni = len(lh)-1\nmi = lh[i]\nwhile(i > 0): \n print(lh[i-1] <= mi+1)\n if (lh[i-1] <= mi+1):\n mi = min(mi, lh[i-1])\n i -= 1\n else:\n print("No")\n exit()\n \nprint("Yes")\n ', 'n = int(input())\nlh = list(map(int,input()...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s505518377', 's966126576', 's150127530']
[14396.0, 14396.0, 14224.0]
[170.0, 172.0, 92.0]
[256, 243, 229]
p02953
u904032512
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['import sys\n\nif __name__ == "__main__":\n N = int(input())\n input_str = input()\n H_str = input_str.split(\' \')\n H = []\n for str in H_str:\n H.append(int(str))\n\n for i in range(len(H) - 1):\n if i != len(H) - 2:\n if H[i + 1] - H[i] <= -2:\n print(\'No\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s250734518', 's609916928', 's859060196', 's667879504']
[15448.0, 149776.0, 149752.0, 14396.0]
[105.0, 1611.0, 1606.0, 69.0]
[621, 380, 380, 235]
p02953
u905203728
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\nbox=list(map(int,input().split()))\nnumber=box[-1]\nif n==1:print("Yes")\nelse:\n for i in range(n-1,0,-1):\n print(i)\n if i!=0:\n if (box[i-1]-box[i])==1:\n box[i-1]=box[i-1]-1\n box[-1]=number\n if box==sorted(box):\n print("Yes")\n else:pr...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s077349634', 's510988246', 's119450309']
[14396.0, 15020.0, 14396.0]
[164.0, 103.0, 63.0]
[314, 210, 212]
p02953
u907223098
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n=int(input())\na=[int(i) for i in input().split()]\nr='Yes'\nfor i in range(n-1):\n if a[-2-i]-a[-1-i]>1:\n r='No'\n break\n elif a[-2-i]-a[-1-i]==1:\n a[-2-i]=a[-2-i]-1\nprint(a) ", "n=int(input())\na=[int(i) for i in input().split()]\nr='Yes'\nfor i in range(n-1):\n if a[-2-i]-a[-1-i]>1:\n r='No'...
['Wrong Answer', 'Accepted']
['s258582097', 's964230806']
[14252.0, 14224.0]
[98.0, 88.0]
[186, 186]
p02953
u909991537
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["import numpy as np\nn = int(input())\na = list(int(i) for i in input().split()) \n\nif len(a) == 1:\n print('Yes')\nelse:\n ans = 'No' if sum(np.diff(np.array(a)) > 1) > 0 else 'Yes'\n print(ans)", 'import numpy as np\nn = int(input())\na = list(int(i) for i in input().split()) \n\nx = -float("inf")\nfor i in ra...
['Wrong Answer', 'Accepted']
['s576207884', 's956934693']
[23360.0, 23084.0]
[521.0, 200.0]
[191, 240]
p02953
u919017918
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = list(map(int, input().split()))\nH[0] -= 1\nfor i in range(0, n - 1):\n diff = H[i + 1] - H[i]\n if diff >= 1:\n H[i + 1] -= 1\n elif diff < 0:\n print("No")\n exit()\nprint("Yes")', 'import numpy as np\n\nN = int(input())\nH = np.array(list(map(int, input().split()...
['Runtime Error', 'Accepted']
['s772830096', 's598017863']
[14252.0, 23112.0]
[42.0, 465.0]
[222, 252]
p02953
u919235786
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\nh=list(map(int,input().split()))\nt=0\nf=0\nfor i in range(n-1):\n if h[i]<=h[i+1]+1 and t<h[i]:\n h[i]-=1\n t=h[i]\n elif h[i]<=h[i+1] and t=h[i]:\n t=h[i]\n else:\n f=1\n break\nif f==0:\n print(Yes)\nelse:\n print(No)', 'n=int(input())\nh=list(map(i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s026168077', 's681725304', 's137679100']
[2940.0, 14224.0, 14704.0]
[20.0, 101.0, 101.0]
[270, 272, 275]
p02953
u921811474
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['import sys\n\nN = int(input())\na = list(map(int,input().split()))\nl = []\nfor i in range(N-1):\n l.append(a[i+1]-a[i])\nif any(i<=-2 for i in l):\n print("No")\nfor i in range(len(l)):\n total = l[i]\n for k in range(1,len(l)):\n if total < 0:\n total += l[k]\n if total <=-2...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s171172144', 's413160561', 's424184362', 's725626036', 's868209685', 's899306304', 's537732792']
[14396.0, 3060.0, 14224.0, 2940.0, 14704.0, 14396.0, 14396.0]
[139.0, 17.0, 196.0, 17.0, 155.0, 136.0, 94.0]
[405, 337, 397, 400, 395, 399, 355]
p02953
u923659712
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\na=list(map(int,input().split()))\na.sort()\na.reverse()\nprint(a)\nfor i in range(n-1):\n if a[i]+1==a[i+1]:\n a[i+1]-=1\n elif a[i]+1<a[i+1]:\n print("No")\n exit()\n else:\n pass\nprint("Yes")\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n-1):\n if ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s517356211', 's964173181', 's488499004']
[14252.0, 14396.0, 14396.0]
[131.0, 85.0, 84.0]
[213, 191, 196]
p02953
u923662841
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = list(map(int, input().split()))\n\nfor i in range(N-1,0,-1):\n if H[i] - H[i-1] == -1:\n H[i-1] -= 1\nprint(H)\n\nfor j in range(N-1):\n if H[j] > H[j+1]:\n print('No')\n break\nelse:\n print('Yes')", "N = int(input())\nH = list(map(int, input().split()))\n\nfor i i...
['Wrong Answer', 'Accepted']
['s696493723', 's626403524']
[14224.0, 14396.0]
[90.0, 81.0]
[237, 228]
p02953
u927357863
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["# -*- coding: utf-8 -*-\nimport sys\n\nN = int(input())\nH = list(map(int,input().split()))\n\nif int(len(H)) == 1:\n\tprint('Yes')\n\tsys.exit()\n\nfor i in range(N):\n\tif i == N - 1:\n\t\tbreak\n\telif min(H[i],H[i + 1]) == H[i]:\n\t\tcontinue\n\telif min(H[i],H[i + 1] - 1) == H[i]:\n\t\tH[i + 1] += -1\n\t\tcontin...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s054266709', 's226940541', 's299787502', 's374660884', 's715790262', 's500915320']
[14252.0, 14252.0, 2940.0, 2940.0, 14224.0, 14252.0]
[88.0, 70.0, 17.0, 17.0, 77.0, 78.0]
[338, 265, 299, 284, 216, 218]
p02953
u932913455
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["import sys\n\nN = int(input())\nH = [int(x) for x in input().split()]\n\nflag = 0\n\nfor i in range(len(H) - 1):\n if H[i] > H[i+1] + 1:\n print('No')\n sys.exit()\n\t\n elif H[i] = H[i+1] + 1:\n\tflag = 1\n\t\n if flag == 1:\n if H[i]\t> H[i+1]:\n print('No')\n sys...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s789455629', 's942785065', 's949342730', 's999742661', 's359927705']
[2940.0, 14396.0, 2940.0, 2940.0, 14396.0]
[17.0, 89.0, 17.0, 17.0, 114.0]
[317, 323, 318, 551, 396]
p02953
u933929042
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = list(map(int, input().split()))\nflag = 0\nresult = 1\nfor i in range(n-1):\n\tif h[i]==h[i+1]+1 and flag==0:\n\t\tflag=1\n\telif h[i]==h[i+1] and flag==1:\n\telif h[i]<=h[i+1]:\n\t\tflag=0\n\telse:\n\t\tresult = 0\nif result:\n\tprint("Yes")\nelse:\n\tprint("No")', 'n = int(input())\nh = list(m...
['Runtime Error', 'Accepted']
['s821208600', 's126676358']
[2940.0, 14224.0]
[17.0, 94.0]
[259, 270]
p02953
u933970872
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n = int(input())\nh = list(map(int,input().split()))\n\nfor x in range(n-1):\n if h[x] <= h[x+1]:\n pass\n else:\n h[x] = h[x]-1\n\nif n == 1:\n ans ='Yes'\nfor x in range(n-1):\n if h[x] <= h[x+1]:\n ans = 'Yes'\n else:\n ans = 'No'\n break\nif h[n-1] <= h[n] and ans...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s149159222', 's387938137', 's396624654', 's847080036', 's592972628']
[2940.0, 2940.0, 2940.0, 2940.0, 14396.0]
[17.0, 17.0, 18.0, 17.0, 78.0]
[382, 382, 198, 383, 198]
p02953
u934099192
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["a = int(input())\nh = list(map(int, input().strip().split()))\n\nc = 0\n\nif len(h) == 1:\n c = 1\nelif len(h) == 2:\n if h[1] >= h[0]:\n c = 1\n else:\n if h[0] == h[1] + 1:\n c = 1\n else:\n c = -1\nelse:\n for i in range(len(h)-3):\n if h[i] == h[i+1] a...
['Wrong Answer', 'Accepted']
['s794392166', 's192981096']
[14252.0, 14480.0]
[128.0, 104.0]
[845, 1181]
p02953
u934868410
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = list(map(int, input().split()))\n\nminimum = 1000000000\nfor i in range(n-1, -1, -1):\n minimum = min(s[i], minimum)\n if s[i] > minimum + 1:\n print("No")\nprint("Yes")', 'n = int(input())\nh = list(map(int, input().split()))\n\nminimum = 1000000000\nfor i in range(n-1, -1, -1):\n minimum...
['Runtime Error', 'Runtime Error', 'Accepted']
['s021537719', 's178186322', 's231324671']
[15020.0, 15020.0, 14396.0]
[43.0, 43.0, 79.0]
[188, 188, 199]
p02953
u935151656
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nL = list(map(int, input().split()))\n\nfor i in L:\n for k in L[1:]:\n if i<=k || i-1<=k:\n ans=yes\n else:\n ans=no\n \nprint(ans)', 'N = int(input())\nL = list(map(int, input().split()))\n\nfor i in L:\n for k in L[1:]:\n if i<=k || i-1<=k:\n ans="yes"\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s301165676', 's724782077', 's873714556']
[2940.0, 2940.0, 15020.0]
[17.0, 17.0, 80.0]
[161, 166, 166]
p02953
u936705814
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = list(map(int, input().split()))\ncount = 0\nif(N==1):\n print("Yes")\nelse:\n for i in range(N-1):\n if(H[i+1]-H[i]==-1):\n count +=1\n if(count==1):\n H[i]=H[i]-1\n elif(H[i]>H[i+1]):\n count +=1\n print(count)\n if(count...
['Wrong Answer', 'Accepted']
['s896724680', 's614136126']
[14224.0, 14252.0]
[82.0, 62.0]
[361, 242]
p02953
u940831163
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["import sys\n\nn = int(input())\nh = list(map(int, input().split(' ')))\nfor i in range(len(h)-1):\n if h[i]-2 >= h[i+1]:\n print('No')\n sys.exit()\n elif h[i]-1 >= h[i+1]:\n if h[i] > h[i-1]:\n print('No')\n sys.exit()\nprint('Yes')\n", "import sys\n\nn = int(input())...
['Wrong Answer', 'Accepted']
['s193411093', 's972001275']
[14396.0, 20660.0]
[77.0, 67.0]
[271, 212]
p02953
u941284420
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N=int(input())\nH=list(map(int,input().split()))\n\nfor i in range(N):\n ans=\'YES\'\n if N == 1:\n ans=\'YES\'\n break;\n if i== 0:\n H[i]-=1\n continue\n \n if H[i-1] < H[i]:\n H[i] -= 1\n elif H[i-1]==H[i]:\n continue\n else:\n ans = "NO"\n break;\nprint(ans)', 'N=int(input())\nH=l...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s211094102', 's314275579', 's594415941', 's636968737', 's716954252', 's770843789', 's896284330', 's928600386', 's403326376']
[14396.0, 15020.0, 14252.0, 14396.0, 14396.0, 14396.0, 14396.0, 14396.0, 14252.0]
[79.0, 2104.0, 75.0, 44.0, 75.0, 2104.0, 101.0, 2104.0, 83.0]
[272, 165, 216, 208, 207, 164, 203, 172, 272]
p02953
u941434715
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['#coding: utf-8\nimport math\nimport heapq\nimport bisect\n\nMOD = 10**9+7\n\nN = int(input())\n\n\nH = list(map(int, input().split()))\n\nflg = 1\n\nfor i in range(1,N):\n if (H[i]-H[i-1])==1:\n H[i]-=1\n elif (H[i]-H[i-1])>=2:\n flg = 0\n break\n\nif flg:\n print("Yes")\nelse:\n prin...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s875046205', 's921925654', 's273307613']
[14380.0, 14532.0, 14404.0]
[75.0, 78.0, 90.0]
[354, 354, 310]
p02953
u944325914
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\nstairlist=list(map(int,input().split()))\nstairlist.reverse()\nfor i in range(n):\n if stairlist[i+1]-stairlist[i]==1:\n stairlist[i+1]=stairlist[i+1]-1\n elif stairlist[i+1]-stairlist[i]>1:\n print("No")\n break\nelse:\n print("Yes")', 'n=int(input())\nstairlist=list(map(int,input().split...
['Runtime Error', 'Accepted']
['s087213544', 's550956224']
[14252.0, 14252.0]
[80.0, 80.0]
[252, 254]
p02953
u945181840
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = list(map(int, input().split()))\n\nfor i in range(N - 1):\n if H[i + 1] - H[i] == -1:\n H[i + 1] -= 1\n elif H[i + 1] - H[i] > -1:\n print('No')\n exit()\nprint('Yes')", "N = int(input())\nH = list(map(int, input().split()))\n\nfor i in reversed(range(N - 1)):\n if ...
['Wrong Answer', 'Accepted']
['s139742689', 's308768074']
[14396.0, 14252.0]
[89.0, 79.0]
[207, 213]
p02953
u945460548
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n = int(input())\nh = list(map(int, input().split()))\n\nsa = []\n\nfor i in range(n-1):\n sa.append(h[i+1]-h[i])\n\n#print(sa)\n\nans = 0\nfor i in range(n-1):\n if sa[i] == 0 and sa[i+1] < 0:\n print('No')\n exit(0)\n else:\n if sa[i] == -1:\n ans += 1\n elif sa[i] >=...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s062938425', 's303914430', 's249021623']
[14396.0, 14396.0, 14396.0]
[112.0, 90.0, 62.0]
[456, 540, 212]
p02953
u945641805
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = list(map(int, input().split()))\n\nminHs = []\nfor i in range(N-1):\n minHs.append(min(H[i+1:]))\n\nres = 'YES'\nfor i in range(N-1):\n if H[i] - minHs[i] >= 2:\n res = 'No'\n break\n\nprint(res)", "N = int(input())\nH = list(map(int, input().split()))\n\nres = 'Yes'\nmaximum...
['Wrong Answer', 'Accepted']
['s140717957', 's233452607']
[14396.0, 14252.0]
[2104.0, 71.0]
[224, 207]
p02953
u948911484
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = list(map(int,input().split()))\nlowest = h[i]\nfor i in range(1,n):\n if h[i] < lowest - 1:\n print("No")\n quit()\n else:\n lowest = max(lowest,h[i]-1)\nprint("Yes")', 'n = int(input())\nh = list(map(int,input().split()))\nlowest = h[0]-1\nfor i in range(1,n):\n if h[i] < lowest:\n ...
['Runtime Error', 'Accepted']
['s361967655', 's053808819']
[14252.0, 14396.0]
[43.0, 82.0]
[190, 188]
p02953
u949876708
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nstair = list(map(int, input().split()))\n\nfor i in reversed(range(1, n)):\n d = stair[i] - stair[i - 1]\n if d > 1:\n print("No")\n exit()\n elif d == 1:\n stair -= 1\nprint("Yes")\n', 'n = int(input())\nstair = list(map(int, input().split()))\n\nfor i in reversed(rang...
['Runtime Error', 'Accepted']
['s874248312', 's348234109']
[14224.0, 14252.0]
[68.0, 72.0]
[220, 229]
p02953
u951980350
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N =int(input())\nH = list(map(int,input().split(" ")))\n\ndef fun(lst):\n if len(lst) == 1:\n return "Yes"\n for i in range(1,len(lst)-1):\n if lst[i] <= lst[i-1] or lst[i] >= lst[i+1]:\n if lst[i]-1 >= lst[i-1] and lst[i]-1 <= lst[i+1]:\n lst[i] = lst[i]-1\n e...
['Wrong Answer', 'Accepted']
['s850650121', 's732096727']
[14396.0, 14396.0]
[61.0, 68.0]
[373, 349]
p02953
u952968889
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n, *a = [*open(0)]\n\nif n==1:\n print(\'Yes\')\n exit()\n \na = [int(i) for i in "".join(a).replace(" ", "")]\nfor i, x in enumerate(a[:-1]):\n if x-1 > a[i+1]:\n print(\'No\')\n exit()\n \nprint(\'Yes\')\n', 'n = int(input())\nh = list(map(int, input().split()))\n \nfor i in reversed(ra...
['Runtime Error', 'Accepted']
['s252912989', 's423803531']
[2940.0, 14252.0]
[18.0, 70.0]
[217, 210]
p02953
u953655640
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nA = list(map(int, input().split()))\nmax = A[0]\n\nif N >=2:\n for i in range(N-1):\n if A[i] <= A[i+1] & A[i+1] >= max:\n max=A[i]\n \n elif A[i] - A[i+1] == 1 & A[i+1] >= max:\n A[i] -=1\n max=A[i]\n else:\n print("No")...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s012712738', 's033652353', 's427648969']
[20620.0, 20528.0, 20664.0]
[87.0, 81.0, 103.0]
[401, 411, 351]
p02953
u957338785
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nh = input().split()\nH = [int(i) for i in h]\ndef is_non_decrease(H):\n for i in range(len(H)-1):\n if H[i] > H[i+1]:\n return False\n return True\n \ndef improve(H, v):\n for i in range(len(H)-1):\n if H[i] > H[i+1] and not v[i]:\n H[i] = H[i] - 1\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s139170863', 's711776551', 's724201268']
[15248.0, 15248.0, 14224.0]
[62.0, 61.0, 80.0]
[735, 750, 311]
p02953
u957872856
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n=int(input())\narr=list(map(int,input().split()))\nfor i in range(n-1,0,-1): \n if arr[i]>arr[i-1]: \n arr[i-1]-=1\n if arr[i]>arr[i-1]: \n print('No')\n break\nelse:\n print('Yes')", "n=int(input())\narr=list(map(int,input().split()))\nfor i in range(n-2,-1,-1):\n if arr[i]>arr[i+1]:\n arr[i]-=1\n ...
['Wrong Answer', 'Accepted']
['s610532005', 's314832042']
[15020.0, 14252.0]
[59.0, 67.0]
[357, 187]
p02953
u958141542
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n = int(input())\nh = list(map(int, input().split()))\n\nfor i in range(1, n):\n if h[i] <= h[i-1] and h[i-1] != 0:\n h[i-1] = h[i-1] -1\n\nfor i in range(1, n):\n if h[i] < h[i-1]:\n print('No')\n break\n if i == n-1:\n print('Yes')", "n = int(input())\nh = list(map(int, input()....
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s518109594', 's779379781', 's740785679']
[14252.0, 14396.0, 14396.0]
[124.0, 77.0, 88.0]
[258, 303, 333]
p02953
u960653324
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = [int(i) for i in input().split()]\n\nans = "Yes"\nfor i in range(N):\n if i == 0:\n H[0] -= 1\n else:\n if H[i-1] == H[i]:\n H[i-1] = H[i]\n elif H[i-1] > H[i]-1:\n print(i)\n ans = "No"\n break\n else:\n if H[i-1] <= H[i]-1:\n H[i] -= 1\n\nprint(H)...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s342244249', 's587191738', 's551190844']
[14396.0, 14276.0, 14396.0]
[124.0, 94.0, 95.0]
[313, 287, 260]
p02953
u961674365
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n=int(input())\nh=list(map(int,input().split()))\nfor i in range(1,n):\n if h[i-1]>=h[i]:\n h[i-1]-=1\nfor i in range(1,n):\n if h[i]<h[i-1]:\n print('No')\n exit()\nprint('Yes')", "n=int(input())\nh=list(map(int,input().split()))\nfor i in range(1,n):\n if h[n-i]<h[n-i-1]:\n h[n-i-1]-=1\nprint(h)\nfor...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s074853064', 's623563089', 's861973080', 's408010069']
[14396.0, 15020.0, 14396.0, 14396.0]
[91.0, 104.0, 98.0, 88.0]
[180, 194, 189, 185]
p02953
u961945062
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["from collections import deque\n\nN = int(input())\nH = deque(map(float, input().split()))\n\nprev = H.popleft()\n\nif N == 1:\n print('Yes')\n exit()\n\nfor i in range(N-1):\n cor = H.popleft()\n if prev - cor < -1:\n print('No')\n exit()\n \n prev = cor\n\n\nprint('Yes')\n", "from col...
['Wrong Answer', 'Accepted']
['s116973395', 's760262300']
[13732.0, 13732.0]
[69.0, 92.0]
[285, 337]
p02953
u962356464
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = list(map(int, input().split()))\nfor i in range(N-1, 0, -1):\n if h[i-1] - h[i] ==1:\n h[i-1]-= 1\n elif h[i-1] -h[i ]> 1:\n flag = False\n print("No")\n break\nelse:\n print("Yes")', 'n = int(input())\nh = list(map(int, input().split()))\nfor i in range(N-1,...
['Runtime Error', 'Runtime Error', 'Accepted']
['s014629983', 's499033363', 's273887605']
[14224.0, 15020.0, 14396.0]
[42.0, 42.0, 80.0]
[230, 230, 241]
p02953
u962580093
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = [int(x) for x in input().split(" ")]\n \nfor i in range(1, n):\n if h[-i]-h[-i-1] >= 0:\n continue \n elif h[-i]-h[-i-1] == -1:\n h[-i-1] = h[i-1] - 1\n continue\n elif h[i]-h[-i-1] < -1:\n ans = "No"\n break\nelse:\n ans = "Yes"', 'n = int(input())\nh = [int(x) for x in inpu...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s048339239', 's330076333', 's796130758', 's744344019']
[14396.0, 14396.0, 3064.0, 14396.0]
[78.0, 87.0, 17.0, 92.0]
[258, 259, 265, 274]
p02953
u968638278
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = list(map(int, input().split()))\n\nif H[0]-H[1] <= -1:\n H[1] -= 1\nelif H[0]-H[1] = 0:\n H[0] -= 1\n H[1] -= 1\nelif H[0]-H[1] = 1:\n H[0] -= 1\nelse:\n print("No")\n\nfor i in range(1, N):\n if i = N-1:\n print("Yes")\n break\n elif H[i]-H[i+1] <= -1:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s082740457', 's216603530', 's795841158', 's686614536']
[2940.0, 3192.0, 3064.0, 14480.0]
[17.0, 19.0, 17.0, 127.0]
[418, 513, 422, 631]
p02953
u970002663
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nH = list(map(int, input().split()))\nf = 0\nif n ==1:\n print("Yes")\nelse:\n for i in range(1, n):\n if H[i+1] - H[i] < 0:\n H[i] -= 1\n if H[i-1] > H[i] or H[i+1] - H[i] < 0:\n f = 1\n break\n if f == 0:\n print("Yes")\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s252859648', 's771776154', 's435725226']
[14396.0, 14252.0, 14704.0]
[77.0, 83.0, 89.0]
[330, 256, 331]
p02953
u970809473
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n = int(input())\na = list(map(int, input().split()))\nflg = 0\na[0] -= 1\nfor i in range(1,n):\n if a[i] == a[i-1] + 1:\n a[i] -= 1\n elif a[i] < a[i-1]:\n flg = 1\nif flg == 1:\n print('No')\nelse:\n print('Yes')", "n = int(input())\na = list(map(int, input().split()))\nflg = 0\na[0] -= 1\nfor i in range(...
['Wrong Answer', 'Accepted']
['s213018685', 's273050603']
[14224.0, 14396.0]
[76.0, 77.0]
[212, 212]
p02953
u972591645
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n=int(input())\narr=list(map(int,input().split()))\nfor i in range(n-1,0,-1): \n if arr[i]>arr[i-1]: \n arr[i-1]-=1\n if arr[i]>arr[i-1]: \n print('No')\n break\nelse:\n print('Yes')", "n = int(input())\nh = list(map(int, input().split()))\n\nfor i in range(n-1):\n a = h[i+1] - h[i] \n if a < 0:\n pr...
['Wrong Answer', 'Accepted']
['s730651467', 's275746368']
[20808.0, 20636.0]
[64.0, 83.0]
[357, 176]
p02953
u974679980
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = list(map(int, input().split()))\n\nflag = 0\nfor i in range(H.index(max(H))+1, N):\n if max(H)-1 > H[i]:\n flag += 1\n break\n\nif flag == 0:\n print(' Yes ')\nelse:\n print(' No ')", "# input an integar N\nN = int(input())\nH = list(map(int, input().split()))\n\nflag = 0\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s074887637', 's164059996', 's661496842', 's930949302']
[14396.0, 14396.0, 14396.0, 15020.0]
[2104.0, 2104.0, 2104.0, 78.0]
[214, 221, 260, 197]
p02953
u978252828
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = [int(x) for x in input().split()]\n cnt = 0\nfor i in range(N-1):\n if H[i]-H[i+1] > 1:\n cnt += 1\nif cnt == 0:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nH = [int(x) for x in input().split()]\n\nH.reverse()\n#print(H)\ncnt = 0\nfor i in range(1,N):\n if H[i]-H[i-1] == 1:\n...
['Runtime Error', 'Accepted']
['s258617029', 's649820342']
[2940.0, 14396.0]
[17.0, 87.0]
[167, 233]
p02953
u981040490
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["# -*- coding: utf-8 -*-\ndef main():\n N = int(input())\n H = list(map(int,input().split()))\n H.reverse()\n for i in range(N):\n if i != N-1:\n if H[i]<=H[i+1]:\n continue\n if (H[i+1]-H[i])==1:\n H[i+1]=H[i+1]-1\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s373935403', 's523202997', 's774715392', 's699377714']
[14396.0, 14704.0, 14396.0, 14396.0]
[55.0, 119.0, 119.0, 69.0]
[508, 481, 331, 508]
p02953
u981931040
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nflag = False\nh_list = list(map(int , input().split()))\nfor i in range(N):\n h_list[i] - 1 > h_list[i-1]:\n flag = True\n break\nif flag:\n print("No")\nelse:\n print("Yes")', 'N = int(input())\nmax = 0\nh_list = list(map(int , input().split()))\nfor i in h_list:\n if max < i:\n ...
['Runtime Error', 'Accepted']
['s708156676', 's238276552']
[2940.0, 14396.0]
[17.0, 54.0]
[191, 187]
p02953
u982139831
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['for i in range(len(S)):\n bottom_num=S[i-1]\n try:\n if S[i]<=S[i+1]:\n pass\n elif S[i]-1==S[i+1]:\n S[i]-=1 \n if S[i]<bottom_num:\n indication=False\n break \n else: \n indication=False\n break\n except:\n pass\nprint(S)\nif indication:\n print("Yes")\ne...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s042390516', 's098597192', 's372916979', 's577597063', 's898596827', 's172638732']
[3064.0, 14252.0, 14396.0, 14396.0, 14396.0, 14396.0]
[17.0, 165.0, 164.0, 158.0, 91.0, 78.0]
[318, 289, 388, 339, 327, 203]
p02953
u989345508
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N=input()\nH=[int(i) for i in input().split()]\n\n\nfor i in range(len(H)-1):\n if H[i] > H[i+1]+1:\n print("No")\n break\n elif H[i] == H[i+1]+1:\n H[i]-=1\n elif i=0:\n H[i]-=1\n elif H[i-1] < H[i]:\n H[i]-=1\nelse:\n for i in range(len(H)-1):\n if H[i] > H[i...
['Runtime Error', 'Accepted']
['s286037985', 's727770460']
[2940.0, 14396.0]
[17.0, 149.0]
[401, 402]
p02953
u989654188
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh=list(map(int,input().split()))\ndef jud(n,h):\n for i in list(reversed(range(0,n-1))):\n # print(h[i],h[i+1])\n if h[i+1]-h[i]==-1:\n h[i]-=1\n print(h[i])\n continue\n if h[i]-h[i+1]>1:\n return "No"\n break\n retur...
['Wrong Answer', 'Accepted']
['s744237664', 's012865217']
[14396.0, 14396.0]
[103.0, 69.0]
[331, 333]
p02953
u990824124
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['import sys\nN=int(input())\nH1=list(map(int,input().split()))\nH=np.zeros(N,dtype="int64")\nfor i in range (0,N):\n H[i]=H1[i]\ns=0\nif N==1:\n print("Yes")\n sys.exit()\n \nfor i in range (0,N-1):\n if H[i]>H[i+1]:\n s = s + H[i]-H[i+1]\n if s>=2:\n print("No")\n sys.exit()\n\nprint("Yes")\n', 'import...
['Runtime Error', 'Accepted']
['s226343956', 's947756648']
[14396.0, 14396.0]
[43.0, 69.0]
[289, 204]
p02953
u993435350
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nL = list(map(int, input().split()))\n\nfor i in reversed(range(0,N)):\n\tif L[i] - L[i-1] <= -2:\n\t\tprint("No")\n\t\tbreak\n\telif L[i] - L[i-1] == -1:\n\t\tif L[i - 1] - L[i -2] <= -1:\n\t\t\tprint("No")\n\t\t\tbreak\n\telse:\n\t\tprint("Yes")', 'N = int(input())\nH = list(map(int,input().split()...
['Wrong Answer', 'Accepted']
['s804538547', 's425421550']
[14252.0, 14396.0]
[134.0, 69.0]
[235, 183]
p02953
u994521204
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["n=int(input())\nH=list(map(int,input().split()))\nflag=0\nfor i in range(1, n):\n if H[i] -H[i-1]>0:\n H[i]-=1\n else:\n flag=1\n break\nprint('No' if flag else 'Yes')", "n=int(input())\nH=list(map(int,input().split()))\nflag=0\nfor i in range(1, n):\n if H[i] -H[i-1]>0:\n H[i]-=1...
['Wrong Answer', 'Accepted']
['s718721695', 's807909040']
[14524.0, 14396.0]
[71.0, 82.0]
[185, 224]
p02953
u994910167
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N = int(input())\nH = list(map(int, input().split()))\n\nans = 1\nfor i in range(1, N-1, 1):\n #print((H[i] - H[i+1]))\n print(i)\n if ((H[i-1] - H[i]) >= 1) & ((H[i] - H[i+1]) >= 1):\n print('No')\n ans = -1\n break\n elif ((H[i-1] - H[i]) == 0) & ((H[i] - H[i+1]) == 1):\n pri...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s766574386', 's852858451', 's906577775', 's959998381']
[14832.0, 3064.0, 14704.0, 14396.0]
[236.0, 17.0, 118.0, 78.0]
[622, 675, 354, 250]
p02953
u995861601
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n = int(input())\nh = list(map(int, input().split()))\n\nsage = True\nmono = True\nfor i in range(n-1):\n if h[i+1] - h[i] > 0:\n sage = True\n elif h[i+1] - h[i] == -1:\n if sage == True:\n sage = False\n else:\n mono = False\n else:\n mono = False\n ...
['Wrong Answer', 'Accepted']
['s582132993', 's625521928']
[14224.0, 14252.0]
[81.0, 91.0]
[359, 240]
p02953
u997641430
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
["N=int(input())\nH=list(map(int,input().split()))\nanswer='Yes'\nfor i in range(N-1):\n if H[N-1-i]>=H[N-2-i]:\n answer='Yes'\n elif H[N-1-i]+1==H[N-2-i]:\n H[N-2-i]-=1\n else:\n answer='No'\n print(H)\nprint(answer)", "N=int(input())\nH=list(map(int,input().split()))\nokflag=1\ndownfl...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s159420736', 's721219490', 's800345249']
[142624.0, 14396.0, 14396.0]
[1639.0, 91.0, 87.0]
[237, 336, 283]
p02953
u998880072
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['N = int(input())\nH = list(map(int, input().split()))\n\nif N == 1:\n print("Yes")\nelse:\n i = 0\n isYes = True\n for i in reversed(range(N)):\n if H[i] < H[i - 1]:\n H[i] -= 1\n if H[i] < H[i - 1]:\n print("No")\n isYes = False\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s141297366', 's338224647', 's558301693']
[14252.0, 15020.0, 14396.0]
[57.0, 57.0, 76.0]
[344, 300, 287]
p02953
u999406210
2,000
1,048,576
There are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i. For each square, you will perform either of the following operations once: * Decrease the height of the square by 1. * Do nothing. Determine if it is possible to perform the operations so that the height...
['n=int(input())\ns=[int(i) for i in input().split()]\ns[0]-=1\nb=True\nfor i in range(n-1):\n if(s[i+1]-s[i]==-1):\n if i!=0:\n if s[i]>s[i-1]:\n s[i]-=1\n else:\n b=False\n break\n else:\n s[i]-=1\n elif s[i+1]==s[i]:\n ...
['Wrong Answer', 'Accepted']
['s549252543', 's780958491']
[14976.0, 14224.0]
[117.0, 76.0]
[455, 226]
p02954
u001024152
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\nfrom collections import Counter\nfrom math import isinf\n\n\ndef warshall_floyd(matrix):\n \n \n \n V = len(matrix) \n for i in range(V):\n for j, c2 in enumerate(row[i] for row in matrix):\n for k, (c1, c3) in enumerate(zip(matrix[j], matrix[i])):\n if c1 ...
['Runtime Error', 'Accepted']
['s159001349', 's711399140']
[3564.0, 10216.0]
[22.0, 161.0]
[1240, 802]
p02954
u001687078
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nS = list(S.replace('RL', '11'))\nlp,rp = 0,0\nfor i,s in enumerate(S):\n \n if (lp>0)&(!='L'):\n S[i-lp-1] = int(S[i-lp-1])+lp//2\n S[i-lp-2] = int(S[i-lp-2])+lp-lp//2\n lp = 0\n \n if (i==len(S)-1)&(s=='L'):\n lp += 1\n S[i] = 0\n S[i-lp] = int(S[i-l...
['Runtime Error', 'Accepted']
['s648233068', 's051024428']
[2940.0, 10412.0]
[17.0, 109.0]
[691, 693]
p02954
u002663801
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['def lrCount(rCount,lCount,ansList,i):\n count = rCount + lCount\n c = 0\n if i == len(s) - 1:\n c = 1\n if count % 2 == 0:\n ansList[i - lCount + c] = count // 2\n ansList[i - lCount - 1 + c] = count // 2\n else:\n if rCount % 2 == 1:\n ansList[i - lCount + c] = c...
['Runtime Error', 'Accepted']
['s808549731', 's424099583']
[10476.0, 10320.0]
[775.0, 770.0]
[1337, 1475]
p02954
u006883624
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = list(input())\n\ncount = [0] * len(S)\n\nfor i in range(len(S)):\n p0 = S[i]\n\n j = 0\n if 'R' == p0:\n while True:\n j += 1\n p = S[i + j]\n if p != p0:\n break\n if (j % 2) == 0:\n count[i + j] += 1\n else:\n co...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s227129389', 's256160969', 's352841781']
[4652.0, 4652.0, 10492.0]
[2104.0, 2104.0, 178.0]
[543, 543, 1060]
p02954
u007991836
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\n\nl = len(s)\nn = 1\nrl = []\nfor i in range(l-1):\n if s[i] == s[i+1] and i != l-2:\n n += 1\n elif s[i] == s[i+1] and i == l-2:\n n += 1\n else:\n rl.append(n)\n n = 1\n\nrl.append(n)\n\nans = [0]*l\nrl_length = len(rl)//2\nposition = rl[0]\n\nfor i in range(rl_leng...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s325452371', 's910438212', 's716775763']
[5756.0, 3188.0, 5624.0]
[131.0, 17.0, 239.0]
[489, 584, 578]
p02954
u016881126
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import sys\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nread = sys.stdin.buffer.read\nsys.setrecursionlimit(10 ** 7)\nINF = float(\'inf\')\n\nS = list(input())\nN = len(S)\n\nmasu = []\nchar = ""\nfor i, s in enumerate(S):\n if char == "":\n char += s\n continue\n ...
['Wrong Answer', 'Accepted']
['s141507868', 's598246663']
[6436.0, 7828.0]
[147.0, 166.0]
[827, 783]
p02954
u020962106
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = list(input())\nl = len(s)\nchild = [1]*l\nchild2 = [0]*l\nfor i in range(10):\n for j in range(l):\n if child[j] !=0:\n if s[j] == 'R':\n child2[j+1] +=child[j]\n if s[j] == 'L':\n child2[j-1] +=child[j]\n else:\n child = child2[:]\n c...
['Wrong Answer', 'Accepted']
['s449346850', 's935824249']
[6408.0, 6400.0]
[474.0, 137.0]
[336, 217]
p02954
u025501820
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import math\nfrom collections import deque\nS = input()\nindex = []\nL_kyoukai = []\nR_kyoukai = [0]\nflag = False\nfor i in range(1, len(S)):\n if flag is False and S[i] == "L":\n L_kyoukai.append(i)\n R_kyoukai.append(i - 1)\n index.append(i - 1)\n index.append(i)\n flag = True...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s262855042', 's264653462', 's391456612', 's174925134']
[16076.0, 16868.0, 16156.0, 11340.0]
[2105.0, 2104.0, 2104.0, 144.0]
[974, 978, 1068, 668]
p02954
u026862065
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["from bisect import bisect_left\n\ns = input()\nn = len(s)\nans = [0] * n\nl = [i for i in range(n - 1) if s[i] == 'R' and s[i + 1] == 'L']\nfor i in range(n):\n b = bisect_left(l, i)\n print(b, l)\n if s[i] == 'R':\n if (l[b] - i) % 2 == 1:\n ans[l[b] + 1] += 1\n else:\n a...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s524197640', 's635483407', 's978390530']
[137972.0, 6908.0, 6388.0]
[1886.0, 126.0, 171.0]
[467, 451, 560]
p02954
u036914910
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = list(input())\ns.append('R')\nans = [0] * (len(s)-1)\nRc = 0\nLc = 0\nfor i in range(len(s)) :\n if Lc != 0 and s[i] == 'R' :\n print('Rc =',Rc,'Lc =',Lc)\n ans[Ri] = Rc % 2 + Rc // 2 + Lc // 2\n ans[Ri+1] = Rc//2 + Lc//2 + Lc%2\n print('RLのところ',ans[Ri],ans[Ri+1])\n Rc = 1\n ...
['Wrong Answer', 'Accepted']
['s703670894', 's564645290']
[17912.0, 17856.0]
[200.0, 78.0]
[572, 399]
p02954
u037430802
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\nrl = [] \nidxes = [] \ncnt = 1 \n\nfor i, (a, b) in enumerate(zip(S, S[1:])):\n if a == b: \n cnt += 1\n else:\n rl.append(cnt)\n cnt = 1\n idxes.append(i)\n\nrl.append(cnt) \n\nans = [0] * len(S)\n\nfor i, (r, l) in enumerate(zip(rl[0::2], rl[1::2])):\n j = idxes[i*2...
['Wrong Answer', 'Accepted']
['s943755007', 's986598232']
[11048.0, 11024.0]
[128.0, 136.0]
[785, 578]
p02954
u038408819
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nans = [0] * len(s)\nruiseki = 0\nfor i in range(len(s)):\n if s[i] == 'R':\n ruiseki += 1\n if s[i + 1] == 'L':\n ans[i] += ruiseki // 2\n ans[i + 1] += (ruiseki + 1) // 2\n else:\n ruiseki = 0\n\nruiseki = 0\nfor i in range(len(s) - 1, 0, -1):\n if s[i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s174705479', 's567248411', 's260119533']
[6400.0, 41044.0, 6400.0]
[133.0, 2108.0, 135.0]
[484, 804, 484]
p02954
u038724782
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s_l = list(input())\nresult = [0] *len(s_l)\n\nfor i in range(len(s_l)):\n str_rl = s_l[i]\n shift = 0\n count = 0\n while str_rl == s_l[i]:\n if str_rl == 'R':\n shift += 1\n else:\n shift -= 1\n str_rl = s_l[i+shift]\n count += 1\n if count%2 != 0:\n ...
['Wrong Answer', 'Accepted']
['s749031712', 's840221218']
[11048.0, 11180.0]
[2104.0, 104.0]
[445, 461]
p02954
u038887660
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = list(input())\ndef move_children(RL, li):\n newli = li.copy()\n for n, rl in enumerate(RL):\n if rl == "R":\n newli[n]-=li[n]\n newli[n+1]+=li[n]\n elif rl=="L":\n newli[n]-=li[n]\n newli[n-1]+=li[n]\n return newli\nnextli=[]\ncounter = 0\nddd = [...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s047522256', 's280909580', 's356788083', 's509608873', 's580664784']
[69400.0, 12324.0, 7196.0, 4652.0, 11176.0]
[2108.0, 185.0, 2104.0, 24.0, 114.0]
[598, 609, 481, 394, 587]
p02954
u046187684
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['def solve(string):\n n = len(string)\n ans = [0] * n\n\n def op(string, ans, forward=True):\n count = 0\n check = "R" if forward else "L"\n for i, a in enumerate(string[::2 * forward - 1]):\n if a == check:\n count += 1\n continue\n if ...
['Wrong Answer', 'Accepted']
['s349132989', 's945930871']
[11484.0, 10484.0]
[190.0, 96.0]
[805, 612]
p02954
u067025752
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\n\ncount = 0\nnowLetter = "R"\narray = []\nans = []\nfor l in S:\n if l == nowLetter:\n count += 1\n else:\n array.append(count)\n count = 1\n nowLetter = l\n if nowLetter == "R":\n a, b = array[0], array[1]\n part = [0] * (a+b)\n p...
['Wrong Answer', 'Accepted']
['s019454315', 's365745459']
[10800.0, 10980.0]
[111.0, 111.0]
[628, 996]
p02954
u073852194
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\ns += 'R'\nA = [0 for i in range(n)]\nr = 0\nl = 0\nfor i in range(n):\n if s[i] == 'R':\n r += 1\n else:\n l += 1\n if s[i] == 'R' and s[i+1] == 'L':\n k = i\n if s[i] == 'L' and s[i+1] == 'R':\n if (r+l)%2 == 0:\n A[k] = (r+l)//2\n ...
['Wrong Answer', 'Accepted']
['s894436421', 's685731949']
[4984.0, 6408.0]
[109.0, 129.0]
[515, 516]
p02954
u075012704
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["from math import ceil\nimport re\nS = input()\nN = len(S)\n\nX = re.findall('R+L+', S)\nans = [0] * N\n\nprint(X)\ni = 0\nfor x in X:\n x_len = len(x)\n start = x.find('RL')\n\n ans[i + start] += (x_len - start - 1) // 2 + ceil((start + 1) / 2)\n ans[i + start + 1] += (start + 1) // 2 + ceil((x_len - star...
['Wrong Answer', 'Accepted']
['s705192481', 's852174672']
[10012.0, 6508.0]
[142.0, 117.0]
[353, 407]
p02954
u075595666
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input().split()\nif len(s) == 2:\n print(1,1)\n exit()\nchk = [0]*len(s)\ncntR = 1\nr = 0\ncntL = 0\nfor i in range(len(s)-1):\n if s[i] == 'R' and s[i+1] == 'L':\n r = i\n chk[r] += (cntR+1)//2\n chk[r+1] += (cntR)//2\n cntL = 1\n if s[i] == 'R' and s[i+1] == 'R':\n cntR += 1\n if s[i] == 'L'...
['Runtime Error', 'Runtime Error', 'Accepted']
['s028519646', 's311419445', 's035684893']
[3316.0, 3316.0, 10356.0]
[17.0, 18.0, 132.0]
[539, 539, 532]
p02954
u076512055
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = list(input())\n\nN = len(S)\nflag = 0\nx = 0\ny = 0\nX = []\nY = [-2]\nfor n in range(N):\n if flag==0 and S[n]=='R':\n pass\n elif flag==0 and S[n]=='L':\n flag = 1\n Y.append(n-1)\n elif flag==1 and S[n]=='L':\n pass\n else:\n flag = 0\n X.append([x,n-1])\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s236706354', 's751637577', 's864617874', 's240460118']
[16208.0, 14480.0, 14652.0, 17692.0]
[2104.0, 2104.0, 2104.0, 217.0]
[614, 624, 614, 659]
p02954
u076917070
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nh = []\nfor i in range(0,len(s)):\n h.append(0)\n\nfor i in range(0,len(s)):\n if s[i] == "R":\n j = s.find("RL", i)\n if (j-i) % 2 == 1:\n h[j+1] += 1\n else:\n h[j] += 1\n elif s[i] == "L":\n j = s.rfind("RL", 0, i+1)\n if (i-j) % 2 == 1...
['Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s002815499', 's554460467', 's645391088', 's169418864']
[8048.0, 4596.0, 4596.0, 16624.0]
[2104.0, 2104.0, 2104.0, 186.0]
[436, 423, 360, 586]
p02954
u077291787
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['# ABC136D - Gathering Children\ndef main():\n # children gather on the border of "RL"\n S = input()\n \n P = S.replace("LR", "L R").split\n ans = []\n for p in P:\n \n e, o = len(p) // 2, len(p) // 2 + len(p) % 2\n l, r = (e, o) if p.index("L") % 2 == 0 else (o, e)\n ans ...
['Runtime Error', 'Accepted']
['s657429157', 's770318852']
[3316.0, 9472.0]
[19.0, 131.0]
[518, 520]
p02954
u080883543
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\n\nstep = np.max(list(map(len, s.split("RL"))))\n\nn = len(s)\npop = [1]*n\n\nif step%2 == 1:\n step = step+1\nelse:\n step = step\n\nfor t in range(step):\n new_pop = [0]*n\n for i in range(n):\n if s[i] == "R":\n new_pop[i+1] += pop[i]\n else:\n new_pop[i-...
['Runtime Error', 'Accepted']
['s150634724', 's079455696']
[3188.0, 19668.0]
[17.0, 218.0]
[385, 483]
p02954
u082446606
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['N,M = [int(x) for x in input().split()]\n\ndic = {}\nfor _ in range(N):\n A,B = [int(x) for x in input().split()]\n if A <= M: dic.setdefault(A, []).append(B)\n\nbuf = []\nfor m in sorted(dic.keys(),reverse=True):\n buf.extend(sorted(dic[m],reverse=True)[:M-m+1])\nprint(sum(sorted(buf,reverse=True)[:M]))', ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s172832872', 's430974204', 's432241285', 's480870058', 's552215773', 's713211426', 's525672460']
[3188.0, 13812.0, 15316.0, 27844.0, 20844.0, 20472.0, 13812.0]
[21.0, 64.0, 164.0, 2049.0, 2109.0, 2109.0, 80.0]
[305, 510, 618, 617, 512, 511, 568]
p02954
u084324798
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['pattern = input()\n\ntemp = [0] * len(pattern)\nans = []\n\nwhile "LR" in pattern:\n pR = pattern.find("RL")\n pL = pattern.find("LR")\n temp = [0] * (pL+1)\n for i in range(pR-1):\n temp[i] = 0\n if (pL+1)%2 == 0:\n temp[pR] = int((pL+1)/2) \n temp[pR+1] = int((pL+1)/2)\n else:...
['Wrong Answer', 'Accepted']
['s095217726', 's875109793']
[11876.0, 11876.0]
[305.0, 305.0]
[944, 940]
p02954
u085717502
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['#!/usr/bin/env python\n# coding: utf-8\n\n# In[72]:\n\n\nS = input()\n\n\n# In[73]:\n\n\nS_tail = list(S)\nS_tail.append("R")\ngroup = []\ntmp = []\ncount = 0\nwhile count < len(S):\n tmp.append(S_tail[count])\n if S_tail[count] != S_tail[count+1]:\n group.append(tmp)\n tmp = []\n count += 1\n\...
['Wrong Answer', 'Accepted']
['s438978459', 's508339630']
[28568.0, 10484.0]
[263.0, 68.0]
[1330, 1819]
p02954
u086503932
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nN = len(S)\nans = [0] * N\ni = 0\nwhile i < N:\n count = 1\n while S[i+count] == S[i]:\n count += 1\n if count == N-1-i:\n break\n if S[i] == 'R':\n ans[i+count] += (count+1)//2\n ans[i+count-1] += count//2\n else:\n ans[i] += (count+1)//2\n ans[i-1] += count//2\n i += count\n...
['Runtime Error', 'Accepted']
['s007675187', 's548687505']
[9872.0, 10796.0]
[70.0, 101.0]
[312, 373]
p02954
u089142196
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input()\nN=len(S)\nLetter=[]\nlist=[0]*N\nfor i in range(N):\n Letter.append(S[i])\n\nR_sum=0\nL_sum=0\nLeftl=0\n\nfor i in range(Leftl,N-2):\n\n R_sum=0\n while S[i]=="R":\n R_sum=R_sum+1\n i=i+1\n else:\n L_sum=0\n if R_sum>=1:\n while S[i]=="L":\n L_sum=L_sum+1\n if i!=N-1:\n ...
['Runtime Error', 'Accepted']
['s264259985', 's006617449']
[6444.0, 6400.0]
[2104.0, 137.0]
[839, 480]
p02954
u092061507
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['# abc136 D:\n\nimport sys\nimport re\n\nS = input()\nprint(S)\nfield = [0 for i in range(len(S))]\n\ndef roundup(n):\n if n % 2 == 0:\n return int(n / 2)\n else:\n return int(n // 2 + 1)\ndef rounddown(n):\n if n % 2 == 0:\n return int(n / 2)\n else:\n return int(n // 2)\n\nmod...
['Wrong Answer', 'Accepted']
['s107075081', 's298338324']
[7692.0, 10740.0]
[344.0, 141.0]
[930, 940]
p02954
u102902647
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["\ndef func(rl_str):\n r_n = rl_str.count('R')\n l_n = rl_str.count('L')\n res = []\n for _ in range(r_n - 1):\n res.append(0)\n res.append((r_n-1)//2 + 1 + l_n//2)\n res.append(r_n//2 + (l_n-1)//2 + 1)\n for _ in range(l_n - 1):\n res.append(0)\n return res\n\nif __name__ == '__m...
['Wrong Answer', 'Accepted']
['s678349272', 's103724807']
[15916.0, 16176.0]
[121.0, 131.0]
[725, 726]
p02954
u111365362
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\nup = []\ndown = []\nparity = 0\nfor i in range(1,n):\n if s[i] != s[i-1]:\n if parity == 0:\n down.append(i)\n else:\n up.append(i)\n parity = 1 - parity\nans = [0 for i in range(n)]\ncount = 0\ntop = up[0]\nbottom = down[0]\nfor i in range(n):\n diff = down[0] - i\n if ...
['Runtime Error', 'Accepted']
['s061126335', 's147379774']
[14832.0, 12532.0]
[140.0, 114.0]
[523, 403]