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
u516687307
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()))\nerr=0\nfor i in range(n-1):\n if(h[i]>min(h[i+1:n])):\n h[i]=h[i]-1\n if(i>=1):\n if(h[i-1]>h[i]):\n err=1\nif(h[n-2]>h[n-1]):\n err=1\nif(err==1):\n print('No')\nelse:\n print('Yes')\nprint(h)", "n=int(input())\nh=list(map(int,...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s313890879', 's644712697', 's442119089']
[14708.0, 14704.0, 14224.0]
[2104.0, 109.0, 99.0]
[268, 268, 269]
p02953
u518042385
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()))\nb=True\nfor i in range(1,n):\n if l[-i]>=l[-i-1]:\n pass\n elif l[-i]=l[-1-i]+1:\n l[-1-i]=l[-1-i]-1\n else:\n b=False\n break\nif b:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\nl=list(map(int,input().split()))\nb=True\nfor i in range(1,n):...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s180088768', 's337599634', 's119822161']
[2940.0, 15020.0, 14396.0]
[17.0, 63.0, 94.0]
[222, 224, 238]
p02953
u519832983
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 = True\nreach = False\n\nfor n in range(N - 1):\n if H[n] > H[n + 1]:\n if H[n] - 1== H[n + 1] and H[n + 1] + 1 <= H[n + 2] and reach == False:\n reach = True\n else:\n flag = False\nif flag:\n print("Yes")\nelse:\n print("No")', 'N = int(...
['Runtime Error', 'Accepted']
['s122543232', 's485247941']
[15020.0, 14396.0]
[79.0, 68.0]
[292, 215]
p02953
u521039434
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()]\ni = n - 1\nwhile i >= 1:\n print(i)\n if h[i] >= h[i-1]:\n i -= 1\n elif h[i] == h[i-1] - 1:\n h[i-1] -= 1\n i -= 1\n else:\n print('No')\n break\nelse:\n print('Yes')", "n = int(input())\nh = [int(i) for i in i...
['Wrong Answer', 'Accepted']
['s985668731', 's148215874']
[14252.0, 14224.0]
[150.0, 86.0]
[260, 247]
p02953
u521323621
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\nht = h[0]\nans="Yes"\nfor i in h:\n if 0 <= i - ht <= 1:\n ht = i\n elif i - ht == 2:\n ht = i-1\n else:\n ans="No"\n break\n \nprint(ans)', 'n = int(input())\nh = list(map(int, input().split()))\n\nht=h[-1]\nans="Yes"\nfor i in reversed(h):\n...
['Wrong Answer', 'Accepted']
['s541841927', 's227449089']
[14396.0, 14252.0]
[57.0, 64.0]
[199, 218]
p02953
u522375638
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(sys.stdin.readline().rstrip())\nH = list(map(int, sys.stdin.readline().rstrip().split()))\nprint(H)\nresult = True\nfor k in range(N-1):\n if H[k]-1 > min(H[k+1:]):\n print("No");exit()\nprint("Yes")', 'import sys\nN = int(sys.stdin.readline().rstrip())\nH = list(map(int, sys.stdin.readl...
['Wrong Answer', 'Accepted']
['s809148339', 's283283704']
[14252.0, 14396.0]
[2108.0, 80.0]
[221, 269]
p02953
u523545435
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()))\nprint(N,H)\n\nH.insert(N,10**9)\n\nans='Yes'\n\nfor i in range(N):\n if H[i]<H[i+1]:\n H[i+1]=H[i+1]-1\n\n elif H[i]>H[i+1]:\n ans='No'\n break\n\nprint(ans)\n\n\n", "N=int(input())\nH=list(map(int,input().split()))\n\n\nH.insert(N,10**9)\n\...
['Wrong Answer', 'Accepted']
['s814822486', 's498809600']
[14252.0, 14252.0]
[85.0, 75.0]
[221, 211]
p02953
u524489226
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())\nlist_h = list(map(int, input().split()))\n\n\nfor i in reversed(range(1, n)):\n print(list_h, i)\n l, r = list_h[i-1], list_h[i]\n\n \n if l <= r:\n continue\n\n \n elif l - 1 == r:\n list_h[i-1] = list_h[i-1] -1\n continue\n \n else:\n print("No")...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s221421917', 's224015553', 's725940021', 's758076757', 's723051120']
[142532.0, 14252.0, 14396.0, 14396.0, 14396.0]
[1625.0, 79.0, 77.0, 42.0, 81.0]
[430, 420, 410, 303, 416]
p02953
u524870111
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\nstdin = sys.stdin\nfrom itertools import accumulate\n\nns = lambda: stdin.readline().rstrip()\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\n\nn = ni()\nh = na()\nhpre = h[-1]\nprint(h[:-1][::-1])\nfor hi in h[:-1][::-1]:\n if hi <= hpre:\n hpre = hi\n elif hi...
['Wrong Answer', 'Accepted']
['s100734521', 's399546092']
[14476.0, 14476.0]
[76.0, 57.0]
[396, 376]
p02953
u525008414
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())\nH = [int(h) for h in input().split(" ")]\n\nh_previous = -10\nfor i, h in enumerate(H):\n \n if h_previous <= H[i]-1:#\n H[i] -= 1\n h_previous = H[i]\n else:\n print("No")\n sys.exit()\n \n print("Yes")\n ', 'import sys\nN = int(input())\nH = [int(h) for h in input()...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s061342580', 's444856214', 's993126496', 's898758212']
[14276.0, 14396.0, 14252.0, 14396.0]
[131.0, 123.0, 124.0, 74.0]
[241, 316, 284, 357]
p02953
u525090128
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# F = [0]*len(H)\nans = 'Yes'\nflag = False\nfor i in range(len(H)-1):\n if H[i] - H[i+1] > 1:\n ans = 'No'\n break\n elif H[i] - H[i+1] > 0:\n flag = True\n if flag:\n ans = 'No'\n elif H[i] - H[i+1] < 0:\n ...
['Wrong Answer', 'Accepted']
['s494035752', 's406536863']
[14252.0, 14396.0]
[92.0, 93.0]
[538, 333]
p02953
u527993431
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()))\nM=[0]*N\ncount=0\nwhile(1):\n\tfor i in range (N-1):\n\t\tif L[i]>L[i+1]:\n\t\t\tif M[i]==1:\n\t\t\t\tprint("No")\n\t\t\t\texit()\n\t\t\telse:\n\t\t\t\tL[i]-=1\n\t\t\t\tM[i]=1\n\t\telse:\n\t\t\tcount+=1\n\tif count==(N-1):\n\t\tprint("Yes")\n\t\texit()\n', 'N=int(inpu...
['Time Limit Exceeded', 'Accepted']
['s877808059', 's662473282']
[14252.0, 14224.0]
[2104.0, 235.0]
[251, 260]
p02953
u529012223
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()))\n\nfor i in range(1, N):\n if H[i] >= H[i-1] - 1:\n H[i-1] -= 1\n elif H[i] < H[i-1] - 1:\n print("No")\n sys.exit()\n\nif flag == 0:\n print("Yes")', 'import sys\n\nN = int(input())\nH = list(map(int, input().split()))\...
['Runtime Error', 'Accepted']
['s878761290', 's880147205']
[14396.0, 14276.0]
[76.0, 79.0]
[233, 221]
p02953
u530335051
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\ni = 0\nwhile True:\n if i == n-1:\n print('Yes')\n break\n if h[i] <= h[i+1]:\n print(i, 'a', h)\n if i == 0 or h[i-1] < h[i]:\n h[i] -= 1\n i += 1\n elif h[i] == h[i+1]+1 and (i==0 or h[i-1] < h[i]):\n ...
['Runtime Error', 'Accepted']
['s787684149', 's224487306']
[142508.0, 14252.0]
[1598.0, 112.0]
[401, 352]
p02953
u531220228
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 = False\nfor i in range(1, N):\n if H[i-1] > H[i]:\n if H[i-1] == H[i]+1:\n if flag:\n break\n else:\n H[i-1] -= 1\n flag = True \n else:\n break\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s057944067', 's459163559', 's615392507']
[14396.0, 14252.0, 14224.0]
[85.0, 99.0, 109.0]
[461, 480, 332]
p02953
u532514769
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())\nh = list(map(int,input().split()))\nfor k in range(n-1):\n if h[k+1]==h[k]-1:\n h[k+1]=h[k]+1\n elif h[k+1]>h[k]:\n continue\n else:\n print('No')\n sys.exit()\nprint('Yes')", "import sys\nn = int(input())\nh = list(map(int,input().split()))\nfor k in...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s032103214', 's077041376', 's118526906', 's336608967']
[14396.0, 3060.0, 5296.0, 14224.0]
[75.0, 17.0, 20.0, 77.0]
[229, 227, 226, 228]
p02953
u535258729
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()))\nflg=0\nfor i in range(n-1):\n if (l[i] - l[i+1]) < -1 or (l[i] - l[i+1] == -1 and l[i] <= flg):\n print('No')\n exit()\nprint('Yes')", 'n=int(input())\nl=list(map(int, input().split()))\nl[0] -= 1\nans="Yes"\nfor i in range(1, n):\n if l[i] > l[i-1]:\n l[i...
['Wrong Answer', 'Accepted']
['s411819949', 's321235615']
[14396.0, 14252.0]
[78.0, 80.0]
[183, 182]
p02953
u536450775
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())\nboxes = input().split(" ")\nfor i in range(N):\n boxes[i] = int(boxes[i])\n\nif N == 1:\n print("Yes")\n sys.exit()\n\nok = True\nfor i in range(0, N-1):\n diff = boxes[i+1] - boxes[i]\n if diff >= 0:\n continue\n elif diff == -1:\n boxes[i] -= 1\n ...
['Wrong Answer', 'Accepted']
['s103136980', 's398208895']
[11744.0, 11152.0]
[158.0, 100.0]
[507, 470]
p02953
u538381753
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(' ')]\nm = max(h)\n\nfor i in range(0, n):\n if m - h[i] > 1:\n print('No')\n exit()\nprint('Yes')", "n = int(input())\nh = [int(x) for x in input().split(' ')]\nm=0\nfor i in range(0, n):\n\tm = max(h[i], m)\n\tif m - h[i] > 1:\n\t\tprint('No')\n\...
['Wrong Answer', 'Accepted']
['s469140857', 's200462480']
[14396.0, 14396.0]
[59.0, 81.0]
[160, 156]
p02953
u538956308
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()))\ncnt = 0\nfor i in range(N):\n if H[i]-H[i+1]=1:\n H[i] = H[i]-1\n elif H[i]-H[i+2]>1:\n cnt = 1\n break\nif cnt == 0:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nH = list(map(int,input().split()))\nH.reverse()\ncnt = 0\nfor i in range(N-1...
['Runtime Error', 'Accepted']
['s600818408', 's264118555']
[2940.0, 14396.0]
[17.0, 76.0]
[208, 227]
p02953
u539281377
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\nfor i in range(N-1):\n if (H[i+1]-H[i])>1:\n if max(H)!=H[N-1]:\n count=1\nprint("YES" if count==0 else "NO")', 'N=int(input())\nH=list(map(int,input().split()))\npre=0\nfor h in H:\n if h<pre:\n print("No");exit()\n elif h>p...
['Wrong Answer', 'Accepted']
['s340091247', 's263296538']
[14396.0, 14396.0]
[2104.0, 61.0]
[182, 151]
p02953
u540799318
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 = [0]*n\nfor i in range(n):\n h[i] = int(input())\ncount = True\nfor i in range(n-1):\n if h[i+1]-h[i] < -1:\n count = False\n break\n elif h[i+1]-h[i] = -1:\n h[i+1] += 1\nif count == True:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nh = list(map(int, input().split()))\...
['Runtime Error', 'Accepted']
['s157599958', 's986773194']
[2940.0, 14252.0]
[17.0, 85.0]
[246, 232]
p02953
u541610817
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()]\ncan = True\nfor i in range(n):\n if i == n - 1:\n continue\n else:\n if h[i] >= h[i + 1]:\n h[i] -= 1\nfor i in range(n):\n if i == n - 1:\n continue\n else:\n if h[i] > h[i + 1]:\n can = False\nprin...
['Wrong Answer', 'Accepted']
['s968100192', 's437131273']
[14396.0, 14224.0]
[105.0, 81.0]
[329, 298]
p02953
u541879668
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...
['_ = input()\nH = list(map(int, input().split()))\n\nmax_height = 0\nfor h1, h2 in zip(H[:-1], H[1:]):\n max_height = max(max_height, h1)\n if h1-1 > h2 or max_height > h2:\n print("No")\n break\nelse:\n print("Yes")\n ', '_ = input()\nH = list(map(int, input().split()))\n\nmax_height = 0\nfor h1, h2 in zip(...
['Wrong Answer', 'Accepted']
['s888203311', 's250963691']
[14252.0, 14252.0]
[84.0, 76.0]
[217, 206]
p02953
u543152022
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 is_stairs(h):\n \n if len(h) == 1:\n return('Yes')\n for i in range(2, len(h)):\n if h[i-1] - h[i] > 0:\n return('No')\n h[i] = min(h[i-1],h[i])\n return('Yes')\nprint(is_stairs(h))", "n = int(input())\nh = list(map...
['Wrong Answer', 'Accepted']
['s106236142', 's949140089']
[14224.0, 14396.0]
[79.0, 83.0]
[273, 307]
p02953
u544034775
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\n\nn = int(input())\nh = np.array([int(i) for i in input().split()])\n\nd = np.diff(h)\ndd = np.array([d[i]+d[i+1] for i in range(len(d)-1)])\n\nif n == 1:\n print('Yes')\nelif (d>=-1) and (dd>=-1).all():\n print('Yes')\nelse:\n print('No')", "import numpy as np\n\nn = int(input())\nh = np.array...
['Runtime Error', 'Accepted']
['s517027041', 's736608836']
[25104.0, 23132.0]
[259.0, 544.0]
[249, 301]
p02953
u547167033
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]-h[i-1]>1:\n print('No')\n exit()\n elif h[i]-h[i-1]==1:\n h[i]-=1\nprint('Yes')", "n=int(input())\nh=list(map(int,input().split()))\nh[0]-=1\nfor i in range(1,n):\n if h[i]-h[i-1]<-1 or (i>=2 and h[i]-h[i-1]==-1 and h[i-2]==h...
['Wrong Answer', 'Accepted']
['s305529161', 's827610062']
[14396.0, 14396.0]
[79.0, 119.0]
[163, 231]
p02953
u550146922
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()))\nimport sys\n\nfor i in range(n-1,1,-1):\n if max(h[:i])>h[i]+1:\n break\n print(f"{i+1}:ok!")\nelse:\n print("Yes")\n sys.exit()\nprint("No")', 'import sys\nn = int(input())\nh = list(map(int,input().split()))\nfor i in range(n-1,0,-1):\n if ...
['Wrong Answer', 'Accepted']
['s181853534', 's838672503']
[20572.0, 20660.0]
[2206.0, 70.0]
[203, 244]
p02953
u551437236
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())\nal = list(map(int, input().split()))\n\nfor i in range(n-1):\n if al[i] < al[i+1] -1:\n print("No")\n exit()\n else:\n pass\nprint("Yes")', 'n = int(input())\nal = list(map(int, input().split()))\ncnt = len(al)\ntmp = al[cnt-1]\n\nfor i in range(cnt-1, 1, -1):\n if al[i...
['Wrong Answer', 'Accepted']
['s667297398', 's017660526']
[20784.0, 20744.0]
[63.0, 80.0]
[173, 275]
p02953
u556326496
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\nH_reversed = list(reversed(H))\nfor i in range(N):\n if H_reversed[i+1] - H_reversed[i] == 1:\n H_reversed[i+1] -= 1\n elif H_reversed[i+1] - H_reversed[i] > 1:\n print('No')\n break\nprint('Yes')\n", "N = int(input())\nH = list(map(i...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s537610275', 's796996440', 's656577328']
[14396.0, 14396.0, 14252.0]
[78.0, 83.0, 76.0]
[271, 227, 270]
p02953
u559823804
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\nlast = sorted(h)\n\nfor i in range(1, n):\n if h[i-1] > h[i]:\n h[i-1] -= 1\n\nif last == sorted(h):\n print('Yes') \nelse:\n print('No')", 'n=int(input())\nh=list(map(int,input().split()))\n\nfor i in range(n-1, 0, -1):\n if h[i-1] <= h[i]:\n...
['Wrong Answer', 'Accepted']
['s556075963', 's527022458']
[14396.0, 14396.0]
[136.0, 73.0]
[197, 224]
p02953
u562015767
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()))\nfrag = 0\ntmp = 0\n\nfor i in range(0,N):\n if A[i] > A[i+1]:\n A[i] -= 1\n tmp = A[i]\n if A[i-1] > A[i] or tmp > A[i+1]:\n frag += 1\n break\n\nif frag >= 1:\n print("No")\nelse:\n print("Yes")', 'N = int(input...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s043671792', 's100113081', 's587662581', 's921037662', 's814905858']
[14252.0, 14276.0, 14396.0, 14396.0, 14252.0]
[77.0, 59.0, 59.0, 70.0, 75.0]
[285, 295, 297, 283, 281]
p02953
u564770050
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[n-1-i] < h[n-1-i-1]:\n h[n-1-i-1] -= 1\nprint(h)\nfor i in range(1,n):\n if h[i] < h[i-1]:\n print('No')\n exit()\n\nprint('Yes')\n ", "n = int(input())\nh = list(map(int,input().split()))\n\nfor i in...
['Wrong Answer', 'Accepted']
['s920301411', 's044783699']
[15020.0, 14396.0]
[100.0, 94.0]
[237, 228]
p02953
u566297428
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-1, 0, -1):\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s152356856', 's268352709', 's659967572', 's264097765']
[20648.0, 20652.0, 20676.0, 20484.0]
[62.0, 59.0, 82.0, 70.0]
[219, 219, 227, 284]
p02953
u571867512
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>2:\n\tflag=0\n\tfor i in range(N-2):\n\t\tif H[i+1]-H[i+2]>1:\n\t\t\tflag=1\n\t\t\tbreak\n\t\tif H[i+1]-H[i+2]==1:\n\t\t\tif H[i]-H[i+1]==1:\n\t\t\t\tH[i+1] -= 1\n\t\t\telse:\n\t\t\t\tflag=1\n\t\t\t\tbreak\n\n\tif flag==0 and H[N-1]>=H[N-2] and H[N-2]>=...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s339063765', 's406813866', 's581206584', 's919438151', 's994879874']
[14976.0, 14704.0, 14704.0, 2940.0, 14396.0]
[83.0, 82.0, 83.0, 17.0, 80.0]
[402, 405, 404, 240, 240]
p02953
u572142121
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()))\n\nif A[0]-A[1]==1:\n A[0]-=1\n\nfor i in range(1,N-1):\n if A[i]-A[i+1]==1:\n A[i]-=1\n if A[i-1]-A[i]==1:\n print('No')\n exit()\n \n elif A[i]-A[i+1]>1:\n print('No')\n exit()\nprint('Yes')\nprint(A)", "N=int(input())\nA=list(map(int,input()...
['Runtime Error', 'Accepted']
['s862098507', 's374144931']
[14224.0, 15020.0]
[89.0, 99.0]
[259, 181]
p02953
u575101291
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(x) for x in input().split()]\nC = 0\nfor i in H:\n if H[i] <= H[i+1]+1:\n C += 1\nif C = N:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nH = [int(x) for x in input().split()]\nC = 0\nfor i in range(N-1):\n if H[i] <= H[i+1]+1:\n C += 1\nif C == N-1 OR C == N:\n print("Yes"...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s014598655', 's164354594', 's268232024', 's510496929', 's555174896', 's737504330']
[2940.0, 2940.0, 14396.0, 2940.0, 14396.0, 14252.0]
[17.0, 17.0, 97.0, 17.0, 76.0, 97.0]
[146, 174, 203, 176, 161, 202]
p02953
u579699847
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 bisect,collections,copy,heapq,itertools,math,operator,string\ndef I(): return int(input())\ndef S(): return input()\ndef LI(): return list(map(int,input().split()))\ndef LS(): return list(input().split())\n##################################################\nN = I()\nH = LI()\nfor i in range(N-1):\n if i==0:...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s606934558', 's884242088', 's802359199']
[15336.0, 143816.0, 14396.0]
[115.0, 1646.0, 103.0]
[537, 548, 434]
p02953
u580301039
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()]\nA=1\nif N>1:\n for i in range(N-1):\n if H[-(i+1)-1] <= H[-(i+1)]:\n A+=1\n print(A)\n elif H[-(i+1)-1]-1 == H[-(i+1)]:\n A+=1\n H[-(i+1)-1]-=1\n if A==N:\n print('Yes')\n else:\n prin...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s082001576', 's235836963', 's460781870', 's822937040', 's288745173']
[14396.0, 3064.0, 14396.0, 14396.0, 14352.0]
[153.0, 18.0, 82.0, 87.0, 104.0]
[339, 580, 299, 298, 318]
p02953
u580316619
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=True\n\nfor i in range(1, n):\n\tif h[-i] >= h[-i-1]:\n\t\tpass\n\telif h[-1]+1 == h[-i-1]:\n\t\th[-i-1] -= 1\n\telse:\n\t\tf=False\n\t\tbreak\nif f:\n\tprint('Yes')\nelse:\n\tprint('No')", "n=int(input())\nh=list(map(int,input().split()))\nf=True\n\nfor i in range...
['Wrong Answer', 'Accepted']
['s202162609', 's999739141']
[20680.0, 20772.0]
[71.0, 85.0]
[212, 237]
p02953
u580404776
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=False\n\nfor i in range(N-1):\n if H[i]<H[i+1]:\n flag=True\n if H[i]<H[i+1]:\n flag=True\n H[i]-=1\n else: \n flag=False\n break\n\nprint("Yes" if flag else "No")\n', 'N=int(input())\nH=list(map(int,input().split()))...
['Wrong Answer', 'Accepted']
['s871606565', 's286984299']
[14224.0, 14396.0]
[87.0, 89.0]
[250, 203]
p02953
u580697892
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 = list(map(int, input().split()))\nflag = True\nfor i in range(N-1):\n if H[i+1] - H[i] < 0:\n flag = False\n break\nprint("Yes" if flag else "No")', '# coding: utf-8\nN = int(input())\nH = list(map(int, input().split()))\nflag = True\nfor i in range(1, N):\n i...
['Wrong Answer', 'Accepted']
['s589911686', 's634334457']
[14540.0, 14396.0]
[60.0, 83.0]
[193, 248]
p02953
u581603131
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 = 1\nfor i in range(N-1):\n if H[i] > H[i+1]:\n if H[i]-1 == H[i+1]:\n ans = 0\n break\nprint('Yes' if ans==1 else 'No')\nprint(H)", "N = int(input())\nH = list(map(int, input().split()))\nans = 1\nfor i in range(N-1):\n if ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s060417702', 's173426091', 's683950307', 's891850052', 's254605994']
[14396.0, 14252.0, 2940.0, 14252.0, 15020.0]
[77.0, 66.0, 17.0, 66.0, 86.0]
[212, 203, 9, 203, 187]
p02953
u583276018
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())\ntall = list(map(int, input().split()))\nlarge = max(tall)\nshort = min(tall)\nfrag = 0\nlnum = 0\nmnum = 0\nfor i in range(n):\n if(frag == 0):\n if(tall[i] == large):\n lnum = i\n frag = 1\n if(tall[i] == mnum):\n mnum = i\n\n\nif(n == 1):\n print("Yes")...
['Wrong Answer', 'Accepted']
['s580614849', 's487912198']
[14252.0, 15020.0]
[65.0, 67.0]
[384, 263]
p02953
u583455893
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 = [int(e) for e in input().split()]\nanswer = 'Yes'\n\nfor i in range(n):\n if h_list[i] > h_list[i+1]:\n h_list[i] -= 1\n if h_list[i] > h_list[i+1]:\n answer = 'No'\n break\n\nprint(answer)", "n = int(input())\nfor i in range(n-1, -1, -1):\n if h_list[i]>h_list...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s000243460', 's130571838', 's209389550', 's294752217', 's453753348', 's707082806', 's750630985', 's897890660', 's074478690']
[14396.0, 3060.0, 14708.0, 14252.0, 14252.0, 3060.0, 14396.0, 14396.0, 14396.0]
[80.0, 17.0, 97.0, 58.0, 59.0, 17.0, 46.0, 98.0, 78.0]
[232, 201, 332, 251, 369, 201, 272, 302, 236]
p02953
u586662847
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 itertools\n# import math\n\n\ndef solve(N, H):\n for i in range(1, N):\n if H[i] < H[i+1]:\n H[i+1] -= 1\n elif H[i] > H[i+1]:\n return 'No'\n return 'Yes'\n\n\nN = int(input())\n# S = input()\n# A, B = map(int, input().split())\nH = list(map(int, input().split()))\n...
['Runtime Error', 'Accepted']
['s729998189', 's838925214']
[14396.0, 14396.0]
[64.0, 62.0]
[441, 442]
p02953
u588558668
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()))\nc=0\nfor i in range(n-1,0,-1):\n if h[i]<h[i+1]-1:\n print('No')\n exit()\n elif h[i]==h[i+1]-1:\n h[i+1]=h[i+1]-1\n\nprint('Yes')\n\n\n \n \n", "n=int(input())\nh=list(map(int,input().split()))\nc=0\nfor i in range(n-1,-1,-1):\n if h[i]<h[i+1]-1:...
['Runtime Error', 'Runtime Error', 'Accepted']
['s117456298', 's271015900', 's400825024']
[14396.0, 14396.0, 14396.0]
[42.0, 43.0, 124.0]
[197, 197, 206]
p02953
u591016708
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):\n if i == 0:\n if H[i] > H[i+1]:\n H[i] -= 1\n if H[i] > H[i+1]:\n print("No")\n break\n if H[i-1] > H[i] or H[i] > H[i+1]:\n print("No")\n break\n if H[i] > H[...
['Wrong Answer', 'Accepted']
['s475449912', 's681343822']
[14400.0, 14252.0]
[98.0, 138.0]
[472, 351]
p02953
u593934357
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...
["\nn = int(input())\nHs = list(map(int, input().split()))\nans = 'Yes'\n\nfor i in range(n-1):\n \n if Hs[i]+1 == Hs[i+1]:\n Hs[i] -= 1\n\n elif Hs[i] > Hs[i+1]:\n ans = 'No'\n\nprint(ans)", "\nn = int(input())\nHs = list(map(int, input().split()))\nans = 'Yes'\n\nfor i in range(n-1):\n if Hs...
['Wrong Answer', 'Accepted']
['s033442744', 's432595947']
[14228.0, 14228.0]
[78.0, 92.0]
[371, 385]
p02953
u595289165
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\nimport sys\nn = int(input())\nh = np.array(list(map(int, input().split())))\nans = "No"\nfor i in range(n-1):\n dif = h[i] - h[i+1]\n if dif > 1:\n print(ans)\n sys.exit()\n elif dif == 1:\n h[i] -= 1\n\nmax_h = 0\nfor i in range(1, n):\n max_h = max(max_h, h[i-1])...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s428317913', 's876994054', 's926873792', 's942266949']
[23128.0, 23124.0, 23140.0, 23132.0]
[445.0, 590.0, 1444.0, 837.0]
[404, 403, 425, 462]
p02953
u595375942
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()))\nmaxm=h[0]\nfor i in range(1,n):\n if maxm<h[i]: print('No'); exit()\n maxm=max(maxm,max(0,h[i]-1))\n print(maxm)\nprint('Yes')", "n=int(input())\nh=list(map(int,input().split()))\nmaxm=h[0]\nfor i in range(1,n):\n if maxm<h[i]: print('No'); exit()\n max...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s062944511', 's183055299', 's187649494']
[14396.0, 14276.0, 14252.0]
[168.0, 98.0, 101.0]
[178, 162, 175]
p02953
u597047658
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())\nH = list(map(int, input().split()))\nif N == 1:\n print('Yes')\nelse:\n for i in range(1, N):\n if H[i] -H[i+1] > 1: print('No');sys.exit()\n elif H[i] - H[i+1] == 1: H[i] -= 1\n else: continue\n print('Yes')\n", "import sys\nN = int(input())\nH = list(map(i...
['Runtime Error', 'Accepted']
['s569076841', 's661733469']
[14396.0, 14396.0]
[77.0, 78.0]
[259, 268]
p02953
u597455618
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()))[::-1]\nlast = h[0]\nfor i in range(1, n):\n if h[i] <= last:\n last = h[i]\n elif last == h[i]+1:\n continue\n else:\n print("No")\n exit()\nprint("Yes")', 'n = int(input())\nh = list(map(int, input().split()))[::-1]\nlast = h[0]\nfor i in r...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s177824699', 's344801218', 's923640668']
[15020.0, 14252.0, 14396.0]
[59.0, 58.0, 63.0]
[219, 219, 219]
p02953
u597509593
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\nis_trimmed = [False] * N\nmax_v = 0\nmax_ids = []\nsucceed = True\nfor i in range(N):\n diff = max_v - H[i]\n if diff > 1:\n print('No')\n succeed = False\n break\n elif diff == 1:\n for j in max_ids:\n if is_t...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s183452827', 's548339062', 's629276459', 's761005409', 's636157870']
[14832.0, 141280.0, 141872.0, 14704.0, 14396.0]
[125.0, 670.0, 678.0, 132.0, 107.0]
[645, 588, 680, 682, 668]
p02953
u597622207
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...
['length = input()\na_list = list(map(int, input().split()))\n \nfor i in range(len(a_list)-1):\n if a_list[i] < a_list[i+1]:\n a_list[i+1] -= 1\n elif a_list[i] > a_list[i+1]:\n print("No")\n exit()\n \nprint(\'yes\')', 'length = input()\nlist = list(map(int, input().split()))\n \nfor i in range(length):...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s391635191', 's449746405', 's585832515', 's764000776', 's776494849', 's808390498', 's844292614', 's945482845', 's668667007']
[15020.0, 14224.0, 14396.0, 15020.0, 14708.0, 14252.0, 2940.0, 14396.0, 14396.0]
[78.0, 43.0, 43.0, 91.0, 42.0, 42.0, 18.0, 43.0, 86.0]
[218, 277, 276, 284, 276, 251, 241, 256, 219]
p02953
u598720217
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\ndef input():\n return sys.stdin.readline()[:-1]\n\nN = int(input())\nl = list(map(int, input().split()))\n\nflag = False\nok = True\npre = 0\n\nfor i in range(N):\n pos = l[i]\n if pos>pre:\n flag = False\n elif pos == pre:\n flag = True\n else:\n if flag:\n ...
['Wrong Answer', 'Accepted']
['s141946820', 's114713170']
[14252.0, 14396.0]
[198.0, 69.0]
[546, 398]
p02953
u600935366
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\nres = 'Yes'\nhmax = 0\ntmp = 0\n\nfor i in h:\n if tmp > i:\n hmax = tmp\n if hmax >= i+1:\n res = 'No'\n break\n tmp = i\n\nprint(res)", "n = int(input())\nh = list(map(int, input().split()))\n\nres = 'Yes'\nhmax = 0\ntmp = 0\n\nf...
['Wrong Answer', 'Accepted']
['s759255670', 's309644029']
[14396.0, 15020.0]
[58.0, 61.0]
[207, 210]
p02953
u601992815
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())\nHn = list(map(int,input().split()))[::-1]\nminnum = Hn[0]\ncheck = True\nfor i in range(1,len(Hn)):\n if Hn[i]-Hn[i-1]<=-1:\n check = False\n break\n elif Hn[i]-Hn[i-1]==-1:\n Hn[i]-=1\n else:\n continue\nif check:\n print("Yes")\nelse:\n print("No")', 'N =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s388600832', 's857833225', 's246637326']
[14252.0, 14396.0, 14396.0]
[76.0, 78.0, 77.0]
[296, 295, 295]
p02953
u602500004
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 bisect,collections,copy,heapq,itertools,math,string\nfrom collections import defaultdict as D\nfrom functools import reduce\nimport numpy as np\nimport sys\nimport os\nfrom operator import mul\n\nsys.setrecursionlimit(10**7)\n\ndef _S(): return sys.stdin.readline().rstrip()\ndef I(): return int(_S())\ndef LS()...
['Runtime Error', 'Accepted']
['s383441573', 's881130209']
[8952.0, 38300.0]
[24.0, 164.0]
[1021, 1262]
p02953
u602677143
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()))\nc = 0\nfor i in range(len(h)-1):\n if h[i+1]-h[i] >= 2:\n print("No")\n c += 1\n break\n \nif c == 0:\n print("Yes") \n ', 'n = int(input())\nh = list(map(int,input().split()))\nc = 0\nt = 0\nfor i in range(len(h)-2):\n i...
['Wrong Answer', 'Accepted']
['s648756578', 's017448617']
[14252.0, 14976.0]
[62.0, 110.0]
[203, 508]
p02953
u603253967
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 defaultdict, deque\nimport sys\n\nsys.setrecursionlimit(100000)\n\nMIN = -10 ** 9\nMAX = 10 ** 9 + 7\n\n\ndef main():\n N = int(input())\n H = [int(a) for a in input().split()]\n # H = [\n # int(input())\n # for _ in range(N)\n # ]\n # A = [int(a) for a in input()....
['Wrong Answer', 'Accepted']
['s434224082', 's370186710']
[14908.0, 14908.0]
[68.0, 69.0]
[497, 497]
p02953
u604231488
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...
['#include <bits/stdc++.h>\nusing namespace std;\nusing ll = long long;\n#ifdef tabr\n#include "library/debug.cpp"\n#else\n\n#endif\n\nint main() {\n ios::sync_with_stdio(false);\n cin.tie(0);\n int n;\n cin >> n;\n vector<int> p(n), x(n);\n for (int i = 1; i < n; i++) {\n cin >> p[i];\n ...
['Runtime Error', 'Accepted']
['s624773035', 's811983404']
[2940.0, 14396.0]
[17.0, 73.0]
[519, 168]
p02953
u604398799
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 -*-\n"""\nCreated on Sat Apr 20 20:47:47 2019\n\n@author: Owner\n"""\n\nimport numpy as np\nimport sys\nimport collections\nimport scipy.misc\nimport math\nfrom operator import itemgetter\nimport itertools\nimport copy\nimport bisect\nimport heapq\n\n\ndef prime_decomposition(n):\n i = 2\n table...
['Wrong Answer', 'Accepted']
['s667217612', 's275983095']
[24648.0, 24672.0]
[361.0, 328.0]
[4599, 4597]
p02953
u605284854
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 f = 0\nelif n == 2:\n if H[0] <= H[1] - 1:\n f = 0\n else:\n f = 1\nelse:\n H[0] -= 1\n for i in range(n-1):\n if H[i+1] > H[i]:\n H[i+1] -= 1\n for i in range(n-1):\n if H[i+1] >= H[i]:...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s273174949', 's964887339', 's061116561']
[14252.0, 14396.0, 14252.0]
[90.0, 90.0, 88.0]
[392, 397, 258]
p02953
u606523772
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 = list(map(int, input().split()))\nans = "Yes"\nfor i in range(1, N-1):\n if H_list[i]<H_list[i-1]:\n H_list[i]-=1\n if H_list[i]<H_list[i-1]:\n ans = "No"\n break\nprint(ans)', 'N = int(input())\nH_list = list(map(int, input().split()))\nans = "Yes"\nfor i in range...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s414274086', 's653773233', 's780204966', 's379218076']
[15020.0, 15020.0, 14224.0, 14396.0]
[73.0, 58.0, 89.0, 70.0]
[218, 230, 329, 259]
p02953
u609814378
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 = 3\nH = [3,3,2]\n\n\nif N==1:\n print("Yes")\n sys.exit()\nelse:\n for i in range(N-1):\n if H[i] < H[i+1]:\n H[i+1] = (H[i+1] - 1)\n if H[i] > H[i+1]:\n print("No")\n sys.exit() \n\n\nprint("Yes")', 'import sys\nN = int(input())\nH = list(map(in...
['Wrong Answer', 'Accepted']
['s626379886', 's873112594']
[3060.0, 14396.0]
[17.0, 88.0]
[252, 286]
p02953
u613931538
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 solve(N, H):\n\n if(N == 1):\n return 1\n \n else:\n\n highest = H[0]\n\n for i in range(1,N):\n\n if(highest - H[i] > 1):\n return 0\n\n else:\n if(highest < H[i]):\n highest = H[i]\n \n return 1\n\n\nN = i...
['Wrong Answer', 'Accepted']
['s085278040', 's893264224']
[15020.0, 14252.0]
[56.0, 56.0]
[404, 404]
p02953
u614734359
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()]\nhigh = H[0]\nfor i in range(1,n):\n tmp = H[i]-high\n if 0<=tmp<=1:\n pass\n elif tmp = -1:\n high -= 1\n elif tmp > 1:\n high = H[i]\n else:\n print('No')\n exit()\nprint('Yes')\n", "n = int(input())\nH = [int(...
['Runtime Error', 'Accepted']
['s236467010', 's843727423']
[2940.0, 14396.0]
[17.0, 71.0]
[272, 236]
p02953
u614875193
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[N-1-i] < H[N-1-i-1]:\n H[N-1-i-1] -= 1\n\nimp = 0\nfor i in range(1,N):\n if H[i] < H[i-1]:\n imp += 1\n\nif imp == 0:\n print(H,'Yes')\nelse:\n print(H,'No')", "N = int(input())\nH = list(map(int, input().s...
['Wrong Answer', 'Accepted']
['s435964347', 's423243180']
[14396.0, 14224.0]
[122.0, 115.0]
[254, 252]
p02953
u616169109
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]:\n H[i] = H[i] - 1\n \n\nif all(H[i]<=H[i+1] for i in range(N-1)):\n print('Yes')\nelse:\n print('No')", '# coding: utf-8\n# Your code here!\nN=int(input())\n\nH=list(map(int,input().split()))\n\nH....
['Wrong Answer', 'Accepted']
['s764394774', 's809130725']
[14252.0, 14224.0]
[95.0, 81.0]
[211, 275]
p02953
u619819312
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=[0]+list(map(int,input().split()))+[1e9+1]\nfor i in range(1,n+1):\n if a[i-1]<a[i]:\n a[i]-=1\n if a[i]>a[i+1]-1:\n print("No")\n break\nelse:\n print("Yes")', 'n=int(input())\na=list(map(int,input().split()))\nfor i in range(1,n):\n if a[i-1]<a[i]:\n a[i]-=1...
['Wrong Answer', 'Accepted']
['s553332340', 's121440602']
[14224.0, 14228.0]
[109.0, 86.0]
[197, 181]
p02953
u620846115
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())\nx=list(map(int, input().split()))\nfor i in range(n):\n if x[i]>x[i+1]:\n x[i]==x[i]-1\nfor j in range(n):\n if x[j]>x[j+1]:\n print("No")\n exit()\nprint("Yes")', 'n = int(input())\nx=list(map(int, input().split()))\ny = []\nfor i in range(n):\n if x[i]>x[i+1]:\n y.append(x[i]-1)\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s002343281', 's091870002', 's232357127', 's427656383', 's999345587', 's615129805']
[8980.0, 8984.0, 8848.0, 8984.0, 8748.0, 20616.0]
[21.0, 27.0, 24.0, 24.0, 27.0, 78.0]
[183, 221, 185, 208, 222, 151]
p02953
u623687794
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()))\nflag=0\nfor i in range(n-1):\n if a[i]-a[i+1]>=2:\n flag=1\n break\nif flag==1:print("Yes")\nelse:\n print("No")', 'n=int(input())\na=list(map(int,input().split()))\nflag=0;maxi=0\nfor i in range(n):\n if a[i]>maxi:maxi=a[i]\n if maxi-a[i]>=2:\n flag=1\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s466632537', 's997835837', 's396336860']
[14396.0, 14252.0, 14524.0]
[59.0, 70.0, 66.0]
[161, 190, 190]
p02953
u623814058
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())\n\np1=p2=0\nfor i in H:\n print(prv,i,i<prv-1,prv<=i, prv-1<=i)\n if i<max(p2,p1-1):\n #print('No')\n break\n if i<p1:\n p2=p1-1\n else:\n p2=p1\n p1=i\nelse:\n print('Yes')", "N=int(input())\n*H,=map(int,input().split())\n\nfor i in range(-1,-len(H)...
['Runtime Error', 'Accepted']
['s060021826', 's619121370']
[16940.0, 20648.0]
[37.0, 81.0]
[226, 209]
p02953
u625963200
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())\nhs=list(map(int,input().split()))\n\nfor i in range(n-1):\n if hs[i+1]-hs[i]>1:\n print('No')\n exit()\n elif hs[i+1]-hs[i]==1:\n hs[i]-=1\n\nprint('Yes')", "n=int(input())\nhs=list(map(int,input().split()))\n\nfor i in range(1,n):\n if hs[i-1]==hs[i]:\n pass\n elif hs[i-1]-hs[i]>=1:\n...
['Wrong Answer', 'Accepted']
['s744207927', 's389979140']
[14396.0, 14396.0]
[81.0, 105.0]
[171, 205]
p02953
u629350026
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()))\ntemp=0\nif n==1:\n print("Yes")\nelse:\n for i in range(0,n-1):\n if h[i]-1<temp:\n print("No")\n break\n temp=max(temp,h[i])\n else:\n print("Yes")', 'n=int(input())\nh=list(map(int,input().split()))\ntemp=0\nif n==1:\n print("Yes")\nelse:\n f...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s475953030', 's516305234', 's783650221', 's847690603']
[14276.0, 14396.0, 14396.0, 14396.0]
[80.0, 81.0, 80.0, 84.0]
[208, 210, 210, 206]
p02953
u634079249
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\nimport os\n\nii = lambda: int(sys.stdin.buffer.readline().rstrip())\nil = lambda: list(map(int, sys.stdin.buffer.readline().split()))\niln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]\n\niss = lambda: sys.stdin.buffer.readline().decode().rstrip()\nisn = lambda n: [sys.stdin.bu...
['Wrong Answer', 'Accepted']
['s812485352', 's001649382']
[12992.0, 13048.0]
[132.0, 65.0]
[714, 697]
p02953
u640603056
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 = "Yes"\nfor i in range(N-1)[::-1]:\n\tif H[i]<H[i-1]:\n\t\tH[i-1]-=1\n\t\tif H[i]<H[i-1]:\n\t\t\tans="No"\n\t\t\tbreak\nprint(ans)\n', 'N=int(input())\nH=list(map(int, input().split()))\nans = "Yes"\nfor i in range(N-1)[::-1]:\n\tif H[i+1]<H[i]:\n\t\tH[i]-=1\n\t...
['Wrong Answer', 'Accepted']
['s131015015', 's814799637']
[15020.0, 14252.0]
[69.0, 67.0]
[167, 165]
p02953
u640922335
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 for i in range(N-1):\n if H[N-i-2]>= H[N-i-1]+2:\n print('No')\n exit()\n elif H[N-i-2]==H[N-i-1]+1:\n H[[N-i-2]-=1\n \n for j in range(N-1):\n if H[i]>H[i+1]:\n ...
['Runtime Error', 'Accepted']
['s968561610', 's677840637']
[8916.0, 20824.0]
[23.0, 113.0]
[370, 369]
p02953
u641406334
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 = True\nfor i in range(n):\n if i<n-1 and h[i+1]-h[i]>=2:\n flag=False\n break\n\nprint('Yes' if flag else 'No')", "n = int(input())\nh = list(map(int,input().split()))\nflag = True\nfor i in range(n-2, 0, -1):\n if h[i]-h[i+1]==1:\n h[i]-=1\n eli...
['Wrong Answer', 'Accepted']
['s985404561', 's095086494']
[14252.0, 14396.0]
[67.0, 77.0]
[170, 205]
p02953
u641460756
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()))\ncoun = 10 ** 10\nans=0\nfor i in range(n-1):\n if len(h) == 1:\n print("YES")\n if h[i] - h[i + 1] >= 2:\n ans=1\n if h[i] - h[i + 1] == 1 and not(coun-h[i+1]==1):\n coun = h[i] - 1\n elif h[i] - h[i + 1] <= 0 :\n pass\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s688025331', 's909329404', 's591681089']
[14396.0, 14396.0, 14224.0]
[109.0, 108.0, 65.0]
[380, 380, 256]
p02953
u642823003
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 = []\n\nfor k in range(N):\n H.append(input())\n \nif N == 1:\n print("Yes")\n \nelse:\n for i in range(N - 1, -1, -1):\n if H[i] - H[i - 1] == -1:\n H[i - 1] -= 1\n \n elif H[i] - H[i - 1] < -1:\n print("No")\n break\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s133400084', 's248369138', 's722826853', 's881483465', 's293955104']
[5980.0, 11152.0, 14228.0, 14252.0, 15020.0]
[19.0, 26.0, 43.0, 85.0, 78.0]
[352, 355, 361, 362, 362]
p02953
u646130340
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\nb = 999999\nif ans == True:\n for i, x in enumerate(H[::-1]):\n if i != 0:\n if x <= b:\n b = x\n elif (x-1) <= b:\n b = x-1\n else:\n ans = False\n break\n else:\n b = x\nprint(ans)', 'import fra...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s556767672', 's619084437', 's355279425']
[14396.0, 5052.0, 14252.0]
[63.0, 36.0, 63.0]
[288, 192, 320]
p02953
u649742871
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())\nHs = list(map(int, input().split()))\n\nif N == 1:\n\tprint("Yes")\n\texit(0)\n\nfor i in range(N-1):\n\tif Hs[i] > Hs[i+1]:\n\t\tHs[i] = Hs[i] - 1\n\nfor i in range(N-1):\n\tif Hs[i] >= Hs[i+1]:\n\t\tprint("No")\n\t\texit(0)\n\n\nprint("Yes")\n', 'N = int(input())\nHs = list(map(int, input().split(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s411282474', 's829763294', 's779168671']
[15020.0, 14252.0, 14252.0]
[80.0, 90.0, 104.0]
[235, 235, 296]
p02953
u651803486
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 abs(H[i] - H[i+1]) > 1:\n print('No')\n exit()\n\nprint('Yes')", "N = int(input())\nH = list(map(int, input().split()))\n\n\n# Revision ver\nH.insert(0, 0)\n\nfor i in range(N):\n if H[i] - 1 >= H[i-1]:\n H[i...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s061211291', 's270372021', 's306303263', 's312427569']
[14396.0, 15020.0, 14396.0, 15020.0]
[63.0, 43.0, 134.0, 87.0]
[154, 226, 294, 212]
p02953
u655110382
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()][::-1]\nb = int(10e9) + 1\nfor h in H:\n if h >= b + 2:\n print('No')\n exit()\n b = min(h, b - 1)\nprint('Yes')\n", "N = int(input())\nH = [int(x) for x in input().split()][::-1]\nbefore = int(10e9) + 1\nfor h in H:\n if h >= before + 2:\n...
['Wrong Answer', 'Accepted']
['s885259432', 's938291871']
[14252.0, 14396.0]
[78.0, 76.0]
[180, 196]
p02953
u662449766
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\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n H = [int(i) for i in input().split()]\n \n \n \n \n # N = 10 ** 5\n # h = 10 ** 9\n # example:\n # 1 2 1 1 -> 1 1 1 1 -> Yes\n # 1 2 2 1 -> 1 2 1 1 -> No\n # 1 2 3 1 -> 1 2 2 1 -> No\n\n cnt = 0\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s510976745', 's934436551', 's146496747']
[15832.0, 14252.0, 14172.0]
[59.0, 65.0, 53.0]
[959, 957, 363]
p02953
u665038048
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\nif h == sorted(h):\n print('Yes')\nelse:\n print('No')", "n = int(input())\nh = list(map(int, input().split()))\nfor i in range(n-1):\n diff = h[i+1] - h[i]\n if diff >= 1:\n h...
['Wrong Answer', 'Accepted']
['s671783001', 's457984324']
[14396.0, 14252.0]
[100.0, 76.0]
[175, 203]
p02953
u666415539
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())\na=list(map(int,input().split()))\nif len(a)==1:\n print("Yes")\n sys.exit()\n\nfor i in range(1,n)[::-1]:\n if a[i]>a[i-1]+1:\n a[i-1]-=1\n elif a[i]==a[i-1]+1:\n continue\n else:\n print("No")\n sys.exit()\n\nprint("Yes")', 'import sys\nn=int(input())\na=list(map(int,inpu...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s053374997', 's084153999', 's085897209', 's197515961', 's283289986', 's285702128', 's389365343', 's545339028', 's555773566', 's917436843']
[14224.0, 14484.0, 14396.0, 3060.0, 14252.0, 3060.0, 2940.0, 14252.0, 14396.0, 14704.0]
[44.0, 43.0, 157.0, 17.0, 81.0, 17.0, 17.0, 172.0, 70.0, 111.0]
[251, 445, 270, 348, 258, 337, 246, 314, 248, 401]
p02953
u668503853
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="Yes"\nfor i in range(N):\n if H[i+1]-H[i]>=0:\n continue\n elif H[i+1]-H[i]==-1:\n if H[i]-1>=H[i-1]:\n H[i]-=1\n continue\n else:\n ans="No"\n break\n else:\n ans="No"\n break\nprint(ans)', 'N=int(input())\nH=list(map(int,in...
['Runtime Error', 'Accepted']
['s373787632', 's305681761']
[14252.0, 14396.0]
[77.0, 77.0]
[265, 199]
p02953
u668705838
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):\n if h[i+1] - h[i] > 1:\n print("No")\n break\nelse:\n for i in range(n-1):\n if h[i+2] - h[i+1] == h[i+1] - h[i] == 1:\n print("No")\n break\n else:\n print("Yes")', 'n = int(input())\nh = list(map(int, input().split...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s443840316', 's528080929', 's796995617', 's802199136']
[14396.0, 15020.0, 14252.0, 14252.0]
[115.0, 60.0, 79.0, 82.0]
[253, 144, 212, 219]
p02953
u671239754
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())\nlist = list(map(int, input().split()))\n\ntwo_times = 0\nfor i in range(n-1):\n if list[i] - list[i+1] > 1:\n print("No")\n break\n elif list[i] - list[i+1] == 1:\n two_times += 1\n if two_times == 2:\n print("No")\n break\n list[i] -= ...
['Wrong Answer', 'Accepted']
['s301454261', 's998380724']
[14396.0, 15020.0]
[91.0, 85.0]
[406, 353]
p02953
u672220554
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()))\nres = 'Yes'\nif n != 1:\n for i in range(1,n):\n if h[i]<h[i-1]:\n h[i] -= 1\n if h[i]<h[i-1]:\n res = 'No'\n break\nprint(res)", "n = int(input())\nh = list(map(int,input().split()))\nth = h[0]\nflag = 0\nres = 'Y...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s837433812', 's992500385', 's142219778']
[14396.0, 14396.0, 14396.0]
[73.0, 67.0, 77.0]
[221, 251, 228]
p02953
u672494157
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\nsys.setrecursionlimit(4100000)\n\n\ndef inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef solve(inputs):\n H = string_to_int(inputs[0])\n min_h = -1\n\n if len(H) == 1:\n return "Yes"\n\n not_operation_start = -1\n for i in range(len(H...
['Runtime Error', 'Accepted']
['s895459621', 's647206170']
[3064.0, 15708.0]
[17.0, 90.0]
[1270, 1474]
p02953
u673101577
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(lambda x: int(x), input().split(' '))\nflg = 0\n\nfor i in range(n):\n if i > 0:\n if h[i + 1] >= h[i]:\n pass\n else:\n if flg == 1:\n print('No')\n continue\n h[i] -= 1\n flg = 1\n\n if h[...
['Runtime Error', 'Runtime Error', 'Accepted']
['s112515762', 's125725233', 's151702202']
[11152.0, 11244.0, 11244.0]
[27.0, 91.0, 124.0]
[386, 254, 294]
p02953
u673361376
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(a) for a in input().split()]\n\nresult = 'Yes'\n\nif H[0] >=1:\n H[0] -= -1\n\nfor i in range(N-1):\n diff = H[i+1] - H[i]\n if diff >= 1:\n H[i+1] -= 1\n elif diff = 0:\n pass\n elif diff < 0:\n result = 'No'\n break\nprint(result)", "from heapq import heappop, heappush\ni...
['Runtime Error', 'Accepted']
['s300545394', 's070181602']
[2940.0, 14168.0]
[17.0, 73.0]
[259, 270]
p02953
u677577916
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 main():\n N = input()\n value = list(map(int, input().split()))\n if len(value) == 1:\n print("Yes")\n return\n for i in range(len(value)-1):\n ans = "Yes"\n if value[i] < value[i+1] or value[i]- 1 < value[i+1]:\n continue\n else:\n ans = "No"\n...
['Wrong Answer', 'Accepted']
['s472142677', 's285144577']
[14396.0, 14396.0]
[61.0, 60.0]
[379, 464]
p02953
u680503348
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 taking integer inputs.\ndef inp():\n return(int(input()))\n\n\n# For taking List inputs.\ndef inlist():\n return(list(map(int, input().split())))\n\n\n# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are...
['Wrong Answer', 'Accepted']
['s275650080', 's826428133']
[14592.0, 14832.0]
[83.0, 93.0]
[671, 671]
p02953
u680851063
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 = [int(x) for x in input().split()]\n#print(l)\n\nfor i in range(1,n)[::-1]:\n if l[i-1] - 1 == l[i]:\n l[i] = l[i] + 1\n else:\n continue\n \n#print(l)\n\na = 0\nfor j in range(1, n):\n if l[j-1] <= l[j]:\n continue\n else:\n print('No')\n break\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s266647622', 's673979092', 's551473867']
[14252.0, 14396.0, 14396.0]
[88.0, 95.0, 83.0]
[322, 321, 474]
p02953
u682271925
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())\nli = list(map(int,input().split()))\n\nn_str = str(n)\nli_size = len(li)\n\nfor i in range(li_size):\n li_contents = li[i] - 1\n for j in range(li_size - i):\n if li_contents > li[j + i]:\n print("NO")\n sys.exit()\nprint("YES")', 'import sys\n\nn = int(input())\nli = li...
['Wrong Answer', 'Accepted']
['s475556502', 's272326730']
[14396.0, 14396.0]
[2104.0, 76.0]
[261, 271]