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 | u332793228 | 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]>=2:\n print("No")\n count+=1\n break\n elif h[i]-h[i+1]==1:\n h[i]-=1\n elif h[i+1]-h[i]==0:\n continue\nif count==0:\n print("Yes")', 'n=int(input())\nh=list(map(int,input()... | ['Wrong Answer', 'Accepted'] | ['s257463900', 's674819186'] | [20588.0, 20624.0] | [82.0, 65.0] | [263, 165] |
p02953 | u334712262 | 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 bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, prod... | ['Wrong Answer', 'Accepted'] | ['s528640453', 's328917794'] | [16648.0, 16640.0] | [70.0, 103.0] | [1470, 1829] |
p02953 | u335038698 | 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())\nHN = [-1] + list(map(int, input().split()))\n\nfor i in range(1, N):\n if HN[i] > HN[i + 1]:\n if HN[i - 1] <= HN[i] - 1 and HN[i] - 1 <= HN[i + 1]:\n continue\n else:\n print('NO')\n exit()\nprint('YES')", "# -*- coding utf-8... | ['Wrong Answer', 'Accepted'] | ['s644372001', 's768767894'] | [14252.0, 14396.0] | [75.0, 93.0] | [285, 249] |
p02953 | u335406314 | 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,*H, = map(int,open(0).read().split())\n\ndef main():\n ihmax=0\n hmax=H[0]\n for i in range(1,N-1):\n if H[i-1]<=H[i]:\n ihmax=i-1\n hmax=max(H[i],hmax) \n else: \n if H[i-1]-1==H[i]:\n H[i-1]-=1\n if H[i-1]<hmax:\n ... | ['Wrong Answer', 'Accepted'] | ['s948674409', 's670018828'] | [20096.0, 19976.0] | [74.0, 73.0] | [411, 242] |
p02953 | u337538431 | 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()))\nif N > 1:\n A[0] -= 1\n for i in range(1,N-1):\n if A[i]<A[i+1]:\n A[i+1] -= 1\n for i in range(N-1):\n if A[i] > A[i+1]:\n print("No")\n break\n else:\n print("Yes")\nelif N == 1:\n print("Yes"... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s066971346', 's451228191', 's702720069', 's834376749', 's525264206'] | [14252.0, 14396.0, 14396.0, 2940.0, 14396.0] | [89.0, 82.0, 42.0, 17.0, 88.0] | [306, 289, 305, 302, 304] |
p02953 | u337845172 | 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())\nlist1=list(reversed(input().split()))\nlist2=list(map(int,list1))\n\nfor i in range(len(list2)):\n print(i)\n d=list2[i]-list2[i+1]\n if d==-1:\n list2[i+1]-=1\n if d<-1:\n print("No")\n break\n if i==len(list2)-2:\n print("Yes")\n break\n#print(list2)... | ['Runtime Error', 'Accepted'] | ['s133083614', 's108276057'] | [15504.0, 14868.0] | [160.0, 87.0] | [464, 550] |
p02953 | u339199690 | 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, heapq\n\nN = int(input())\nH = list(map(int, sys.stdin.readline().rsplit()))\n\npre = H[0] - 1\nfor i in range(1, N):\n h = H[i]\n if h - pre > 1:\n pre = h - 1\n elif h - pre == 1:\n pre = h\n elif h - pre == 0:\n pre = h + 1\n else:\n print("No")\n exit(... | ['Wrong Answer', 'Accepted'] | ['s065174346', 's981550249'] | [14200.0, 14200.0] | [65.0, 69.0] | [317, 274] |
p02953 | u343850880 | 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()]\nfor i in range(n-1):\n if h[i]-h[i+1]==1:\n h[i] -= 1\nh1 = sorted(h)\nprint(h)\nprint(h1)\nif h==h1:\n print('Yes')\nelse:\n print('No')\n", "n = int(input())\nh = [int(i) for i in input().split()]\nfor i in range(n-1):\n if 0<=h[i]-h[i+1]<=... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s099466577', 's356733095', 's555117203', 's894391604', 's932788761', 's945591598'] | [14620.0, 14396.0, 14396.0, 14224.0, 14396.0, 14252.0] | [121.0, 99.0, 104.0, 100.0, 106.0, 133.0] | [200, 184, 181, 185, 180, 344] |
p02953 | u344542101 | 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... | ["_ = int(input())\nh = [int(word) for word in input().split()]\n\nprev_hi = h[0]\nsatisfies = False\n\nfor hi in h:\n if hi - 1 >= prev_hi:\n prev_hi = hi - 1\n elif hi >= prev_hi:\n prev_hi = hi\n else:\n break\nelse:\n satisfies = True\n\nprint('yes' if satisfies else 'no')\n", "_ = ... | ['Wrong Answer', 'Accepted'] | ['s014669089', 's412753012'] | [14224.0, 14396.0] | [66.0, 64.0] | [293, 293] |
p02953 | u348868667 | 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(1,N):\n if H[i] > H[i-1]:\n H[i] += -1\nfor j in range(1,N):\n if H[j] > H[j-1]:\n ans = "No"\n break\nprint(ans)', 'N = int(input())\nH = list(map(int,input().split()))\nans = "YES"\ntmplist = [H[0]]\nfor i i... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s414997968', 's448860192', 's558398727', 's833535272', 's333783067'] | [14224.0, 14396.0, 14396.0, 15020.0, 15020.0] | [78.0, 2104.0, 73.0, 80.0, 82.0] | [212, 228, 212, 215, 231] |
p02953 | u350836088 | 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_lis = list(map(int,input().split()))\nfor i in range(n-1):\n if h_lis[i+1]-h_lis[i] >= 2:\n print('No')\n break\nelse:\n print('Yes')\n\n", "n = int(input())\nh = list(map(int,input().split()))\nh.reverse()\nflg =True\nfor i in range(n-1):\n if h[i+1] > h[i]:\n h[i+1] -= 1\n if h[i+... | ['Wrong Answer', 'Accepted'] | ['s034849993', 's345483867'] | [14396.0, 15020.0] | [61.0, 90.0] | [156, 266] |
p02953 | u352359612 | 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())\n\nh = list(map(int, input().split()))\n\ni = 0\n\nwhile i < n - 1:\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 break\n\nif i == n - 1:\n print("YES") \nelse:\n print("NO")', 'n = int(input())\n\nh = list(m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s637637029', 's870708175', 's828637320'] | [14252.0, 14396.0, 14396.0] | [98.0, 76.0, 99.0] | [266, 261, 261] |
p02953 | u352402050 | 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')\n\nelse:\n if H[0] <= H[-1]:\n for i in range(N-1):\n if H[i+1] - H[i] >= 1:\n H[i] -= 1\n if i == N-2:\n print('Yes')\n break\n \n else:\n continue\n \n elif H... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s366085530', 's813767413', 's221345366'] | [14480.0, 14480.0, 14704.0] | [88.0, 86.0, 91.0] | [879, 801, 746] |
p02953 | u353099601 | 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\ncount = 0\nflg = True\n\nfor i in range(len(H)):\n if i!=len(H) and H[i] > H[i+1]:\n H[i] -= 1\n if i!=0 and H[i-1] > H[i]:\n flg = False\n break\n\nif flg==True:\n print('Yes')\nelse:\n print('No')\n", "N = int(input())\nH = list(map(int, input().... | ['Runtime Error', 'Accepted'] | ['s209838308', 's694491669'] | [14396.0, 14396.0] | [89.0, 56.0] | [253, 216] |
p02953 | u354719836 | 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 = [int(x) for x in input().split(\' \')]\n\npos = True\n\nfor i in range(1, n):\n if abs(arr[i] - arr[i-1]) > 1:\n pos = False\n break\n\nif pos:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\narr = [int(x) for x in input().split(\' \')]\n\npos = True\n\nfor i in... | ['Wrong Answer', 'Accepted'] | ['s813194843', 's379988807'] | [14396.0, 14396.0] | [66.0, 75.0] | [211, 297] |
p02953 | u357751375 | 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()))\ni = 1\n\nwhile i < n:\n if h[i] < h[i-1]:\n h[i-1] -= 1\n elif h[i] > h[i-1]:\n h[i] -= 1\n else:\n pass\n\n i += 2\n\nl = list(h)\nl.sort()\nif h == l:\n print('YES')\nelse:\n print('NO')", "n = int(input())\nh = list(map(in... | ['Wrong Answer', 'Accepted'] | ['s572845516', 's583673566'] | [20820.0, 20740.0] | [78.0, 86.0] | [262, 193] |
p02953 | u359747364 | 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... | ['sys.setrecursionlimit(4100000)\nn = int(input())\na = [int(i) for i in input().split()]\ncurrent = a[0]\ngood = True\nfor i in range(1,n):\n if a[i] < a[i-1]:\n good = False\n break\n if a[i] == a[i-1]:\n continue\n if a[i] > a[i-1]:\n a[i] = a[i] - 1\nif good:\n print("Yes")\n... | ['Runtime Error', 'Accepted'] | ['s295307033', 's503203076'] | [3064.0, 14704.0] | [17.0, 102.0] | [324, 335] |
p02953 | u360515075 | 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 = "Yes"\nfor i in range(N-1,0,-1):\n print (i)\n if H[i-1] - H[i] > 1:\n flag = "No"\n break;\n elif H[i-1] - H[i] == 1:\n H[i-1] -= 1\nfor i in range(N-1):\n if H[i] - H[i+1] > 0:\n flag = "No"\n break; \n \nprint (flag)\n', 'N = in... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s706390480', 's747865470', 's749727070'] | [14396.0, 14396.0, 14704.0] | [173.0, 99.0, 97.0] | [291, 271, 279] |
p02953 | u361381049 | 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 = h[0]\n \nfor i in range(n):\n if h[i] >= cnt-1:\n \n if h[i] >= cnt:\n cnt = h[i]\n else:\n print('No')\n exit()\n print(cnt)\nprint('Yes')\n", "n = int(input())\np = list(map(int, input().split()))\na = p\n\nans = []\nfor i in range(1,... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s263284779', 's564403519', 's675718681', 's236058166'] | [14252.0, 14396.0, 145500.0, 14252.0] | [146.0, 2108.0, 1643.0, 70.0] | [209, 299, 310, 198] |
p02953 | u364774090 | 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\tprint(H[i], H[i - 1])\n\tif H[i] < H[i - 1] - 1:\n\t\tprint('No')\n\t\tbreak\n\telif H[i] == H[i - 1] - 1:\n\t\tH[i - 1] -= 1\nelse:\n\tprint('Yes')\n", "N = int(input())\nH = list(map(int, input().split()))\nfor i in range(N - 1,... | ['Wrong Answer', 'Accepted'] | ['s609065344', 's064267456'] | [20840.0, 20656.0] | [139.0, 79.0] | [217, 194] |
p02953 | u366482170 | 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())\nb =list(input().split())\nprint(b)\n\nc = 0\nfor i in range(a):\n if i>0:\n if (int(b[i]) - int(b[i-1])>1):\n c=1\nif c==1:\n print("No")\nelse:\n print("Yes")', 'a = int(input())\nb =list(input().split())\nprint(b)\n\nc = 0\nfor i in range(a):\n if i>0:\n if (int(b[i-1]) - int(b[i])>... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s401310478', 's524322730', 's776035723', 's145788474'] | [15932.0, 15816.0, 14252.0, 14396.0] | [100.0, 103.0, 2104.0, 105.0] | [176, 176, 177, 257] |
p02953 | u369094007 | 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 - 2, -1, -1):\n if h[i] == h[i + 1] + 1:\n h[i] -= 1\n elif h[i] == h[i + 1]:\n pass\n else:\n print('No')\n exit()\nprint('Yes')", "n = int(input())\nh = list(map(int, input().split()))\nfor i in range(1, n - 1):\n if h[i] - h[i ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s074107694', 's518695743', 's870774407', 's618203567'] | [14252.0, 15020.0, 14396.0, 14224.0] | [83.0, 73.0, 167.0, 85.0] | [206, 164, 204, 193] |
p02953 | u369133448 | 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"\ncngh=0\nbkh=0\nfor i in range(n):\n if bkh>h[i]:\n if cngh!=h[i] and bkh==h[i]-1:\n cngh=h[i]-1\n elif (cngh!=h[i] and bkh!=h[i]-1) or (cngh==h[i] and cngh!=h[i]):\n ans="No"\n break\n bkh=h[i]\nprint(ans)', 'n=int(input())\nh=list(ma... | ['Wrong Answer', 'Accepted'] | ['s617572888', 's346306568'] | [14224.0, 15020.0] | [60.0, 71.0] | [276, 291] |
p02953 | u371409687 | 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):\n if h[i]>=h[i+1]:\n h[i]-=1\nfor i in range(n-1):\n if h[i]>h[i+1]:\n ans="No"\n break\nprint(ans)', 'n=int(input())\nh=list(map(int,input().split()))\nans="Yes"\nfor i in range(n-1):\n if h[-i-1]<h[-i-2]:... | ['Wrong Answer', 'Accepted'] | ['s319166638', 's990450684'] | [15020.0, 14396.0] | [83.0, 82.0] | [198, 199] |
p02953 | u371990949 | 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, len(h)):\n prev = h[i-1]\n curr = h[i]\n \n if prev <= curr:\n continue\n elif prev > curr + 1:\n print('No ')\n sys.exit()\n elif prev == curr + 1:\n continue\nprint('Yes ')\n\n", "i... | ['Wrong Answer', 'Accepted'] | ['s447348623', 's884256950'] | [14396.0, 15020.0] | [69.0, 71.0] | [295, 200] |
p02953 | u372102441 | 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())\nH = []\nH = input().split(" ")\nfor i in range(N):\n H[i] = int(H[i])\n\nochinchin = True\nfor i in range(1, N-1):\n if H[i]<H[i-1]:\n H[i-1] -= 1\n if H[i]<H[i-1]:\n ochinchin = False\n break\n elif i > 2:\n if H[i-1]<H[i-2]:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062332146', 's209956608', 's273359793', 's273840824', 's383018987', 's497465958', 's501949163', 's579681832', 's588471984', 's696379265', 's715486638', 's721047549', 's775946494', 's792930652', 's998624824', 's352827175'] | [11152.0, 14224.0, 15020.0, 11152.0, 14396.0, 14252.0, 15020.0, 14252.0, 11244.0, 14224.0, 14396.0, 14224.0, 11156.0, 14396.0, 14396.0, 11152.0] | [101.0, 82.0, 67.0, 27.0, 91.0, 69.0, 82.0, 80.0, 83.0, 83.0, 83.0, 79.0, 101.0, 82.0, 81.0, 92.0] | [347, 263, 308, 259, 271, 214, 265, 229, 279, 265, 307, 323, 366, 268, 266, 309] |
p02953 | u374765578 | 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\n\nw = 1\nfor i in range(n-1):\n if h[i] - h[i+1] >= 2:\n w = 0\n\nfor j in range(n-2):\n if h[j] - h[j+1] == 1:\n \n if h[j+1] - h[j+2] == 1:\n w =0\n else:\n count += 1\n elif h[j] - h[j+1] == 0:\n ... | ['Runtime Error', 'Accepted'] | ['s707495040', 's617526443'] | [14396.0, 14396.0] | [94.0, 85.0] | [373, 217] |
p02953 | u374829922 | 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 = int(input())\n H = list(map(int, input().split()))\n\n judge = 'Yes'\n\n H[0] = H[0] - 1\n\n for i in range(1,N):\n if H[i-1] > H[i] :\n H[i-1] = H[i-1] - 1\n\n for i in range(1,N):\n if H[i-1] > H[i]:\n judge = 'No'\n\n print(H)\n print(ju... | ['Wrong Answer', 'Accepted'] | ['s665546317', 's946266012'] | [14396.0, 14400.0] | [82.0, 82.0] | [345, 582] |
p02953 | u375695365 | 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())\n\nh=list(map(int,input()))\nif h[-1]==1:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nH = list(map(int, input().split()))\nv = -1\nfor h in H:\n if v > h:\n if v != h+1:\n print("No")\n exit()\n else:\n v = h+1\n else:\n v... | ['Runtime Error', 'Accepted'] | ['s053902478', 's486130935'] | [5296.0, 14224.0] | [20.0, 59.0] | [93, 221] |
p02953 | u376328830 | 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... | ['print("No")', '#-*-coding:utf-8-*-\n\nimport sys\nn = int(input())\nlst=list(map(int,input().split()))\n\ndifferences=[]\nfor i in range(1,n):\n if lst[i]-lst[i-1]==0:\n continue\n elif lst[i]-lst[i-1]<=-2:\n print("No")\n sys.exit()\n else:differences.append(lst[i]-lst[i-1])\n\n\nif len... | ['Wrong Answer', 'Accepted'] | ['s194663229', 's283517812'] | [2940.0, 14396.0] | [17.0, 105.0] | [11, 708] |
p02953 | u380524497 | 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()))\n\nans = True\n\nfor i in range(n-1, 1, -1):\n if h_list[i] >= h_list[i-1]:\n continue\n\n else:\n h_list[i - 1] -= 1\n if h_list[i] >= h_list[i-1]:\n continue\n else:\n ans = False\n break\n\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s422609099', 's860809391', 's884179209'] | [14396.0, 14396.0, 14228.0] | [68.0, 71.0, 73.0] | [356, 357, 358] |
p02953 | u381602071 | 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()))\nD = [0] * (N - 1)\njudge = True\nfor i in range(N - 1):\n h1 = H[i]\n h2 = H[i + 1]\n d = h2 - h1\n D[i] = d\nprint(D)\nfor i in range(N - 2):\n d1 = D[i]\n d2 = D[i + 1]\n print(d1, d2)\n if d2 < 0:\n if d2 == -1:\n if d... | ['Wrong Answer', 'Accepted'] | ['s418290692', 's582994818'] | [14380.0, 14396.0] | [236.0, 132.0] | [506, 416] |
p02953 | u382176416 | 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()))\nresult='Yes'\n\nif n == 2:\n if h[1] < h[0]:\n h[1] -=1\n if h[1] < h[0]:\n result='No'\n\nif 3 <=n:\n for i in range(1, n-1):\n print(i)\n if h[i-1] <= h[i] and h[i] <= h[i+1]:\n continue\n else:\n h[i]-=1\n if h[i-1] <= h[i] and ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s494615913', 's535201163', 's808140383', 's369731522'] | [14400.0, 14396.0, 14396.0, 14704.0] | [161.0, 167.0, 164.0, 128.0] | [394, 313, 362, 533] |
p02953 | u382407432 | 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()\nstr_list = []\nans = "YES"\nfor i in range(len(h)):\n if(i % 2 == 0):\n str_list += h[i]\n\nfor j in range (len(str_list)-1):\n if(int(str_list[j]) > int(str_list[j]) + 1):\n str_list[j] = str(int(str_list[j])-1)\n if(int(str_list[j]) > int(str_list[j]) + 1):\n ans = "NO"\n ... | ['Runtime Error', 'Accepted'] | ['s710163190', 's336775765'] | [10232.0, 11156.0] | [642.0, 159.0] | [325, 289] |
p02953 | u382639013 | 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\nlis = list()\nfor i in range(len(H)-1):\n if H[i] - H[i+1] < -1:\n H[i+1] = H[i+1] - 1\n lis.append(1)\n else:\n lis.append(0)\n\nif all(lis):\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nH = list(map(int, input().sp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069405007', 's083587423', 's586007109'] | [14396.0, 14252.0, 14252.0] | [83.0, 83.0, 72.0] | [254, 255, 209] |
p02953 | u389679466 | 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())\n\nhs = list(map(int, input().split()))\n\nfor i in range(n-1):\n if hs[i] < hs[i + 1]:\n continue\n else:\n hs[i] = hs[i] - 1\n continue\n\nif sorted(hs) == hs:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\n\nh = list(map(int, input().split()))\n\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s697541427', 's779545954'] | [14252.0, 15020.0] | [99.0, 101.0] | [234, 219] |
p02953 | u390170391 | 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()))\nl.append(10**9)\nm = 'Yes'\nfor i in range(0,n-1)\n if l[n-i-1] <= l[n-i]:\n Continue\n elif l[n-i-1] > l[n-i] + 1:\n m = 'No'\n Break\n else:\n l[n-i-1] = l[n-i-1] - 1\n\nprint(m)\n", "n = int(input())\nl = list(map(int,input().split()))\nl.append(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s217959629', 's739247581', 's841062806', 's226942581'] | [2940.0, 2940.0, 2940.0, 14252.0] | [17.0, 17.0, 17.0, 94.0] | [237, 237, 234, 243] |
p02953 | u391328897 | 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]\nh.extend(list(map(int, input().split())))\nmax = 0\n\nfor i in range(n + 1)[1:]:\n if h[i] >= max >= h[i - 1]:\n max = h[i]\n if max - h[i] >= 2:\n print("NO")\n exit()\n\nprint("YES")\n', 'n = int(input())\nh = list(map(int, input().split()))\nmax = 0\n\nfor i in... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s034972184', 's087299022', 's142751196', 's339115294', 's377981743', 's437359765', 's508859670', 's531019475', 's560283782', 's605329668', 's649007059', 's749412142', 's813865010', 's842468576', 's912822551', 's964765470', 's636366168'] | [14396.0, 14252.0, 14348.0, 14396.0, 14252.0, 14224.0, 14228.0, 14396.0, 15020.0, 14252.0, 15020.0, 15020.0, 14252.0, 14396.0, 14396.0, 14396.0, 14396.0] | [81.0, 74.0, 122.0, 79.0, 83.0, 111.0, 62.0, 69.0, 74.0, 73.0, 82.0, 82.0, 42.0, 83.0, 73.0, 67.0, 74.0] | [227, 207, 323, 238, 210, 306, 203, 207, 233, 248, 223, 205, 215, 258, 191, 196, 248] |
p02953 | u394721319 | 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... | ['-- [Char]あるいは String を Int にする\ntoInt :: (String -> Int)\ntoInt x = read x ::Int\n\n--入力を受け取り、[Int]にする\ngetInts = do\n x <- getLine\n let y = (map$toInt)$words x -- 半角スペースで分割してInt にする\n return y\n\nmain = do\n _ <- getInts\n x <- getInts\n\n if ok x 0 == 1\n then putStrLn "Yes"\n else putStrLn "No"\n whe... | ['Runtime Error', 'Accepted'] | ['s381162529', 's157269782'] | [2940.0, 14396.0] | [17.0, 67.0] | [509, 217] |
p02953 | u401452016 | 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\ninput = sys.stdin.readline\nn = int(input())\nhL = list(map(int, input().split()))\n\nif hL==sorted(hL):\n print('Yes')\nelse:\n if max(hL)-min(hL)<=1:\n print('Yes')\n else:\n print('No')", "import sys\nimport numpy as np\ninput = sys.stdin.readline\nn = int(input())\n\nL = np.arra... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s345299517', 's886522016', 's707146327'] | [14252.0, 23132.0, 14252.0] | [82.0, 380.0, 93.0] | [212, 268, 238] |
p02953 | u402644375 | 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())\nstairs = [int(x) for x in input().split()]\n\nminHeight = max(stairs[0] - 1, 0)\n\nfor i in stairs:\n if i < minHeight:\n result = False\n break\n else:\n if i > minHeight:\n \t minHeight = i - 1\n\nif result:\n print("Yes")\nelse:\n print("No")', 'n = int(inpu... | ['Runtime Error', 'Accepted'] | ['s317118057', 's496806966'] | [14396.0, 14224.0] | [61.0, 65.0] | [285, 302] |
p02953 | u404290207 | 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... | ['num = int(input())\narr = list(map(int,input().split()))\ncount = 0\nfor i in range(1,num): \n\n \n if arr[i-1] > arr[i]:\n count += 1\n arr[i-1] -= 1\n \nif count > 0:\n print("No")\nelse:\n print("Yes")', 'num = int(input())\narr = list(map(int,input().split()))\ncount = 0\nfor i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s813592369', 's999639464', 's984664672'] | [14396.0, 14224.0, 14396.0] | [79.0, 70.0, 66.0] | [227, 246, 296] |
p02953 | u406755737 | 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 = list(map(int, input().split()))\n# print(N, h_list)\n\nflag = True\n\n# for j in range(i+1, N):\n# if (h_list[i]- h_list[j]) > 1:\n\n# break\n# if not flag:\n# break\n\nmax_v = max(h_list)\nleft_max_index = h_list.index(max(h_list))\nprint(l... | ['Wrong Answer', 'Accepted'] | ['s461069013', 's911551027'] | [14396.0, 14396.0] | [2104.0, 70.0] | [816, 5477] |
p02953 | u408262366 | 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())\nif N < 75000:\n print("No")', 'N = int(input())\nif N < 50000:\n print("No")', 'print("No")', 'N = int(input())\nif N < 50000\nprint("No")', 'N = int(input())\nif N < 100000:\n print("No")', 'N = int(input())\nhoge = input().split()\nH = []\nfor i in range(N):\n H.append(int(hoge[i]) - 1)\n\ndam... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s270647257', 's308218222', 's368689755', 's606330986', 's853475506', 's971902832', 's055985628'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 14224.0, 14976.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 91.0, 130.0] | [44, 44, 11, 41, 45, 346, 602] |
p02953 | u413165887 | 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(i) for i in input().split(' ')]\nfor i in range(n-1):\n if h[i] > h[i+1]-1:\n print('No')\n sys.exit()\n elif h[i] == h[i+1]-1:\n h[i+1] -= 1\n else:\n h[i] -= 1\nprint('Yes')", "import sys\nn = int(input())\nh = [int(i) for i in inpu... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s723217435', 's901599273', 's736604293'] | [14396.0, 14252.0, 14396.0] | [88.0, 84.0, 92.0] | [248, 220, 246] |
p02953 | u413960612 | 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()]\nfor i in range(N-1):\n if(i == N-2):\n if(H[i] + 1 == H[i+1] or H[i] == H[i+1]):\n H[i] == H[i+1]\n elif(H[i] <= H[i+1]):\n continue\n elif(H[i] + 1 > H[i+1]):\n print("No")\n exit()\n elif(... | ['Wrong Answer', 'Accepted'] | ['s149620018', 's897301600'] | [20568.0, 20520.0] | [91.0, 81.0] | [568, 215] |
p02953 | u416758623 | 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())\nls = list(map(int, input().split()))\nmaxNum = ls[0]\nfor i in range(1,n):\n if maxNum < ls[i]:\n maxNum = ls[i] - 1\n if maxNum < ls[i]:\n print("No")\n sys.exit()\nprint("Yes")', 'import sys\nn = int(input())\nls = list(map(int, input().split()))\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s272351399', 's928178174', 's022767642'] | [14396.0, 14252.0, 15020.0] | [56.0, 51.0, 87.0] | [237, 240, 256] |
p02953 | u417014669 | 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())\n# s=list(map(int, input().split()))\n\nN=4\ns=[1,3,1,2]\n\nfor i in range(N-1): \n if s[i]<s[i+1]:\n s[i+1]=s[i+1]-1\n\n\n \nif s==sorted(s):\n print("Yes")\nelse:\n print("No")\n', '# N=int(input())\n# s=list(map(int, input().split()))\n\nN=4\ns=[2,1,1,3,3,4,5,6,6]\n\nfor ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s286266065', 's406003761', 's598356285', 's716687693', 's857784778', 's956102262', 's456896230'] | [2940.0, 2940.0, 14396.0, 2940.0, 15020.0, 2940.0, 14224.0] | [17.0, 18.0, 100.0, 17.0, 98.0, 17.0, 99.0] | [207, 214, 167, 228, 185, 229, 196] |
p02953 | u418180220 | 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())\nhh = list(map(int, input().split()))\n\nprev = -999\nfor i in range(N):\n if pre <= hh[i]-1:\n pre = hh[i]-1\n elif pre <= hh[i]:\n pre = hh[i]\n else:\n print('No')\n exit(0)\nprint('Yes')\nexit(0)\n", "N = int(input())\nhh = list(map(int, input().split()))\n \nprev = -999\nfor i in ... | ['Runtime Error', 'Accepted'] | ['s954335362', 's629032364'] | [14396.0, 15020.0] | [43.0, 77.0] | [219, 225] |
p02953 | u418199806 | 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 = 0\ncnt = 0\nH = H[::-1]\nfor i in range(1, N):\n if H[i-1] >= H[i]:\n cnt += 1\n print("H[i-1] >= H[i]")\n elif H[i-1] == H[i] - 1:\n cnt += 1\n H[i] -= 1\n print("H[i-1] == H[i]-1")\n else:\n ans = max(c... | ['Wrong Answer', 'Accepted'] | ['s342145213', 's351371344'] | [14704.0, 14252.0] | [163.0, 77.0] | [441, 285] |
p02953 | u418502493 | 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 = [int(i) for i in input().split()]\nprint(Hs)\n\nfor i,H in enumerate(Hs):\n if i == N - 1:\n break\n\n if H > Hs[i+1]:\n H -= 1\n Hs[i] = H\n if H > Hs[i+1]:\n print('No')\n exit()\n if i == 0:\n continue\n if H < Hs[i-1]:\n print(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s552315053', 's818730663', 's878322794'] | [14396.0, 14400.0, 14396.0] | [109.0, 141.0, 129.0] | [336, 493, 430] |
p02953 | u422526484 | 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... | ['result = True\nfor i in range(n):\n \n if (i != (n-1)):\n if(h[i] > h[i+1]): \n h[i] -= 1\n \n elif (i != 0):\n if(h[i] > h[i-1]): \n h[i] -= 1\n \n if (i != 0):\n if(h[i] < h[i-1]):\n result = False\n break\n\nif result:\n print("Y... | ['Runtime Error', 'Accepted'] | ['s427952400', 's903859483'] | [3064.0, 14396.0] | [17.0, 124.0] | [508, 509] |
p02953 | u425184437 | 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=map(int,input().split())\nH=list(map(int,input().split()))\nfor i in range(len(H)-1):\n if H[i]<H[i+1]<H[i]+2:\n H[i+1]--1\n if H[i]+1<H[i+1]:\n print('No')\n exit()\n if H[i]<H[i+1]-1:\n print('No')\n exit()\nprint('Yes')", 'n = int(input())\nh = list(map(int, input().split()))\nmi = h[-1]\nfor i... | ['Wrong Answer', 'Accepted'] | ['s053081993', 's773730322'] | [20772.0, 20712.0] | [90.0, 81.0] | [231, 187] |
p02953 | u425900376 | 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()]\nif h[0] != 1:\n h[0] -= 1\nif len(h) == 1:\n print('Yes')\nelse:\n for i in range(1, n):\n if h[i] < h[i - 1]:\n h[i] -= 1\n elif h[i] > h[i - 1]:\n print('No')\n exit()\n print('Yes')\n", "n = int(inpu... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s018362893', 's297539484', 's368025030', 's619408896', 's653853139', 's693341311', 's717919771', 's849595622'] | [14396.0, 14396.0, 14252.0, 14396.0, 14252.0, 14396.0, 14396.0, 14252.0] | [76.0, 71.0, 85.0, 74.0, 72.0, 83.0, 140.0, 75.0] | [288, 288, 329, 288, 396, 288, 353, 270] |
p02953 | u426649993 | 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\nN = int(input())\nH = list(map(int, str(input()).split()))\n\noutput = "Yes"\nif N == 1:\n print(output)\n exit()\n\nfor i in range(N-1):\n if H[i] - H[i+1] >= 0:\n H[i] -= 1\n\nfor i in range(N-1):\n if H[i+1]- H[i] < 0 :\n output = "No"\n break\n\nprint(ou... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s159126141', 's409057068', 's442678121', 's797215823', 's968545342'] | [14396.0, 14396.0, 14704.0, 14396.0, 14704.0] | [85.0, 87.0, 83.0, 103.0, 68.0] | [304, 482, 592, 536, 316] |
p02953 | u426764965 | 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')\n exit\n\nH_rev = list(reversed(H))\n\nans = 'YES'\nfor i in range(N-1):\n if H_rev[i] < H_rev[i+1]:\n H_rev[i+1] -= 1\n\n if H_rev[i] < H_rev[i+1]:\n ans = 'NO'\n break\n\nprint(ans)", "N = int(input())\nH = list(map(int,... | ['Wrong Answer', 'Accepted'] | ['s102163367', 's830627440'] | [15020.0, 14396.0] | [77.0, 79.0] | [261, 252] |
p02953 | u429029348 | 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())\nbase=0\nfor i in range(n):\n h=int(input())\n if base>h:\n ans="No"\n break\n base=max(base,h-1)\nelse:\n ans="Yes"\nprint(ans)', 'n=int(input())\nh=list(map(int,input().split()))\nbase=0\nfor i in h:\n if base>i:\n ans="No"\n break\n base=max(base,i-1)\ne... | ['Runtime Error', 'Accepted'] | ['s115027823', 's416116186'] | [5980.0, 14396.0] | [23.0, 72.0] | [159, 166] |
p02953 | u431484963 | 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 = "Yes"\nfor i in range(1,n):\n #print(h[i])\n if h[i] > h[i-1]:\n pass\n elif h[i] == h[i-1]:\n pass\n else:\n h[i] -= 1\n if h[i] < h[i-1]:\n flag = "No"\n break\nprint(flag)\n\n\n\n\n', 'n = int... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s587272005', 's868176017', 's224364309'] | [14396.0, 15772.0, 14396.0] | [75.0, 71.0, 88.0] | [288, 173, 434] |
p02953 | u434872492 | 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\nif N == 1:\n pass\nelse:\n for i in range(N-2,-1,-1):\n if (H[i] - H[i+1]) >= 2:\n ANS = False\n break\n elif (H[i] - H[i+1]) == 1:\n H[i] -= 1\n\nprint('Yes' if ANS else 'No')", "N = int(input())\nH =... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s024828994', 's111011724', 's322132030', 's741728125'] | [3064.0, 2940.0, 2940.0, 14396.0] | [17.0, 17.0, 17.0, 76.0] | [280, 277, 277, 282] |
p02953 | u439392790 | 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,input().split() for _ in range(n)]\nfor i in range(n-1):\n if(h[i]<h[i+1]):\n h[i+1]-=1\n if(h[i]>h[i+1]):\n print('No')\n return\nprint('Yes')", "n=int(input())\nh=map(int, input().split())\nfor i in range(n-1):\n if(h[i]<h[i+1]):\n h[i+1]-=1\n if(h[i]>h... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s395313680', 's426698547', 's255601588'] | [3064.0, 2940.0, 14396.0] | [17.0, 17.0, 88.0] | [185, 172, 177] |
p02953 | u440161695 | 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()))\nif N==1:\n print("Yes")\n exit()\nfor i in range(N-1):\n if H[i]-1<=H[i+1]:\n H[i]-=1\n elif H[i]==H[i+1]:\n continue\n else:\n print("No")\n exit()\nfor i in range(N-1):\n if H[i]>H[i+1]:\n print("No")\n exit()\nprint("Yes")', 'N=int(input())\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s283755822', 's841529187', 's044777492'] | [14252.0, 14224.0, 14252.0] | [100.0, 86.0, 74.0] | [282, 296, 254] |
p02953 | u441197772 | 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 decimal import Decimal, ROUND_HALF_UP\ns = input()\n\nrl_list = []\nans = ['0']\nfor i in range(len(s)-1):\n ans.append('0')\n if s[i] + s[i+1] == 'RL':\n rl_list.append(i)\n\nbefore = 0\nfor i, rl in enumerate(rl_list):\n r_num = s[before: rl+1].count('R')\n before = rl + 1\n try:\n l_num = s[rl+1: r... | ['Wrong Answer', 'Accepted'] | ['s542572580', 's378182800'] | [5204.0, 14252.0] | [36.0, 110.0] | [612, 301] |
p02953 | u441599836 | 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... | ['if h[-2] - h[-1] >1:\n print("No")\n\nelse:\n for i in range(1,n-1):\n l = h[-(2+i)]\n r = h[-(1+i)]\n if l - r < -1:\n print("No")\n break\n else:\n print("Yes")', 'n = int(input())\nh = list(map(int, input().split()))\n\nfor i in range(0,n-1):\n l = h[-(... | ['Runtime Error', 'Accepted'] | ['s042046440', 's159676052'] | [3064.0, 14396.0] | [17.0, 79.0] | [210, 233] |
p02953 | u447352341 | 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())\nboxes = list(map(int,input().split()))\nprev = 0\nfor box in boxes[::-1]:\n if prev - box > -1:\n prev = box\n elif prev - box == -1:\n prev = box -1\n else:\n print("No")\n sys.exit()\nprint("Yes")', 'N = int(input())\nboxes = list(map(int,input().sp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s519402784', 's902236550', 's484294040'] | [15020.0, 14396.0, 14396.0] | [43.0, 44.0, 59.0] | [253, 120, 259] |
p02953 | u449473917 | 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 range(n-1,-1,-1):\n if l[i]<l[i-1]:\n l[i-1]-=1\n if l[i]<l[i-1]:\n print("No")\n exit()\nprint("Yes")', 'a=int(input())\nb=list(map(int,input().split()))\nfor i in range(len(b)-1):\n dif=b[i]-b[i+1]\n if dif<=0:... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s012685441', 's028539221', 's930956219', 's060243030'] | [14396.0, 14704.0, 15020.0, 14524.0] | [72.0, 64.0, 105.0, 63.0] | [193, 287, 261, 151] |
p02953 | u450180547 | 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... | ["s = input()\npairs = []\nr_count = 0\nl_count = 0\nprev = ''\n\nfor i in range(len(s)):\n if i == len(s) - 1:\n pair = [r_count, l_count + 1]\n pairs.append(pair)\n\n if prev == 'L' and s[i] == 'R':\n pair = [r_count, l_count]\n pairs.append(pair)\n r_count = 0\n l_coun... | ['Wrong Answer', 'Accepted'] | ['s711316945', 's933173913'] | [3064.0, 15020.0] | [17.0, 87.0] | [1133, 281] |
p02953 | u450292714 | 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 = input().split(\' \')\nflag = 0\n\nfor i in range(0, n - 1):\n if (int(stair[i]) == int(stair[i+1])):\n if (int(stair[i]) <= int(stair[i+1]) - 1):\n flag = 1\n else:\n flag = 0\n break;\n\nif flag:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nstair = input(... | ['Wrong Answer', 'Accepted'] | ['s951203372', 's860559042'] | [11152.0, 12020.0] | [82.0, 151.0] | [265, 259] |
p02953 | u450904670 | 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, -1):\n if(arr[i-1] <= arr[i]):\n a = 1\n else:\n if(arr[i-1] - 1 > arr[i]):\n print("No")\n exit()\n else:\n arr[i-1] = arr[i - 1] - 1\nif(sorted(arr) == arr):\n print("Yes")\nelse:\n print("No")', 'n = int(input... | ['Runtime Error', 'Accepted'] | ['s726311432', 's476290445'] | [14948.0, 14380.0] | [45.0, 80.0] | [287, 289] |
p02953 | u452913314 | 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] - H[i+1] < -1:\n print("No")\n exit()\n elif H[i] - H[i+1] == -1:\n H[i+1] += 1\n #elif H[i] - H[i+1] > -1:\nprint("Yes")', 'N = int(input())\nH = list(map(int,input().split()))\n\n\nfor i in reversed(... | ['Wrong Answer', 'Accepted'] | ['s931530452', 's652627377'] | [14396.0, 14396.0] | [82.0, 70.0] | [228, 214] |
p02953 | u453500284 | 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()))\na = H[0]\nfor i in range(1,N-1):\n a = max(H[i], a)\n ... | ['Wrong Answer', 'Accepted'] | ['s355680850', 's668517725'] | [14396.0, 15020.0] | [57.0, 84.0] | [363, 187] |
p02953 | u455957070 | 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()]\nH1 = sorted(H)\nANS = H1[::-1]\nans = 'Yes'\nfor i in range(n-1):\n if(ANS[i] <= ANS[i+1]):\n ans = 'Yes'\n else:\n ans = 'No'\n break\nprint(ans)", "n = int(input())\nH = [int(i) for i in input().split()]\nans = 'Yes'\nfor i in range(n-1... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s703602537', 's851288386', 's484492040'] | [14396.0, 14396.0, 14252.0] | [84.0, 64.0, 79.0] | [214, 201, 175] |
p02953 | u457289860 | 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())\nstairs = list(map(int,input().split()))\nmin = stairs[0]\n\n\nif n == 1:\n print('Yes')\n exit()\n\nfor i in range(n-1,0,-1):\n if stairs[i] < stairs[i-1]:\n stairs[i-1] -= 1\n if stairs[i] < stairs[i-1]:\n print('No')\n exit()\n else:\n print('... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s657732797', 's975186033', 's152955327'] | [15020.0, 14252.0, 14396.0] | [110.0, 83.0, 68.0] | [372, 424, 355] |
p02953 | u459590249 | 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\nans='Yes'\nfor i in range(0,n-1):\n\tif h[i]<h[i+1]:\n\t\t\th[i]-=1\n\telif h[i]>h[i+1]:\n\t\t\tans='No'\nprint(ans)", "n=int(input())\nh=list(map(int, input().split()))\nrevh=h[::-1]\nfor i in range(1,n):\n\tif revh[i-1]<revh[i]:\n\t\th[i]-=1\nh.sort(revers... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s021159221', 's751431983', 's306048678'] | [14396.0, 14252.0, 14396.0] | [72.0, 100.0, 72.0] | [159, 181, 157] |
p02953 | u460009487 | 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 = 0\n\nif n == 1:\n\tprint('Yes')\n\nelse:\n\tfor i in range(n-1):\n\t\tif h[i] + 1 == h[i + 1]:\n\t\t\tprint('Yes')\n\t\telif h[i] == h[i + 1]:\n\t\t\tcontinue\n\t\telse:\n\t\t\tprint('No')\n\t\t\tbreak", "n = int(input())\nh = list(map(int, input().split(... | ['Wrong Answer', 'Accepted'] | ['s041677853', 's640814064'] | [14252.0, 14396.0] | [77.0, 109.0] | [228, 287] |
p02953 | u460245024 | 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 diff = H[i] - H[i-1]\n print(diff)\n if diff >= 0:\n continue\n elif diff == -1:\n H[i-1] -= 1\n elif diff < -1:\n print('No')\n break\nelse:\n print('Yes')\n", "N = int(input())\nH = l... | ['Wrong Answer', 'Accepted'] | ['s968490339', 's822975246'] | [14396.0, 14396.0] | [138.0, 67.0] | [276, 260] |
p02953 | u472696272 | 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')\n exit()\n \nif h[0]>=h[1]: h[0] -= 1\nfor i in range(1,n-1):\n if h[i]>=h[i-1] and h[i]>=h[i+1]:\n h[i] -= 1\n print(h)\n\n\nif h == sorted(h):\n print('Yes')\nelse:\n print('No')", "n = int(input())\nh = list(map(int, input()... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s070206888', 's514496336', 's983579576'] | [142476.0, 14224.0, 14396.0] | [1643.0, 42.0, 88.0] | [254, 244, 255] |
p02953 | u475675023 | 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,*h=map(int,open(0).read().split())\nfor i in range(n-1)[::-1]:\n if h[i+1]<h[i]:\n h[i]-=1\n if h[i+1]<h[i]:\n print('NO')\n exit()\nprint('YES')", "n,*h=map(int,open(0).read().split())\nfor i in range(n-1)[::-1]:\n if h[i+1]<h[i]:\n h[i]-=1\n if h[i+1]<h[i]:\n print('No')\n exit()... | ['Wrong Answer', 'Accepted'] | ['s823087572', 's671153047'] | [14108.0, 14108.0] | [69.0, 66.0] | [157, 157] |
p02953 | u476562059 | 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()]\nans = "Yes"\n\nfor i in range(n-1):\n if h[i] > h[i+1] or h[i]-1 > h[i+1]:\n ans = "No"\n\nprint(ans)', '\nn = int(input())\nh = list(map(int, input().split()))\n\nc = h[0]\n\nfor i in h:\n if c <= i:\n c = i\n\n elif i + 1 == c:\n ... | ['Wrong Answer', 'Accepted'] | ['s317436448', 's050960091'] | [14396.0, 14252.0] | [77.0, 59.0] | [160, 204] |
p02953 | u477977638 | 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):\n if i==0:\n continue\n if h[i-1] < h[i]:\n h[i-1]-=1\n if h[i-1] >h[i]:\n print("No")\n exit()\nprint("Yes")', 'n=int(input())\nh=list(map(int,input().split()))\nfor i in range(n):\n if i==0:\n continue\n if h[i-1] < h[i]:\n ... | ['Wrong Answer', 'Accepted'] | ['s737061500', 's624430096'] | [14228.0, 14396.0] | [93.0, 90.0] | [183, 183] |
p02953 | u480887263 | 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")\nelif N==2:\n if H[0]<=H[1]+1:\n print("Yes")\n else:\n print("No")\nelse:\n for i in range(N-1):\n if H[i]=<H[i+1]:\n H[i]-=1\n count+=1\n elif H[i]==H[i+1]+1:\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s580644575', 's782699896', 's507147609'] | [2940.0, 14396.0, 14708.0] | [17.0, 103.0, 99.0] | [576, 296, 444] |
p02953 | u481101428 | 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\ncorrect ="Yes"\nfor i in range(N-1):\n if H[i] < H[i+1]:\n H[i+1] -= 1\n elif H[i] == H[i+1]+1:\n H[i+1] = H[i+1]\n else:\n correct = "No"\n break\n\nprint(correct)\n ', 'N = int(input())\nH = list(map(int,input().spl... | ['Wrong Answer', 'Accepted'] | ['s277816346', 's881644350'] | [14252.0, 15020.0] | [79.0, 86.0] | [254, 263] |
p02953 | u482157295 | 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 Counter\na = int(input())\nnum_list = list(map(int,input().split()))\nflag = "ok"\nnum_o = 0\nfor i in range(a-1):\n if num_list[i]-1 <= num_list[i+1] and num_list[i]-1 >= num_o:\n flag = "ok"\n num_o = num_list[i]\n else:\n flag = "ng"\nnum_counter = Counter(num_list)\nnum_most = n... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s750531834', 's766814738', 's982350520', 's135426838'] | [21540.0, 2940.0, 2940.0, 21668.0] | [133.0, 17.0, 17.0, 138.0] | [431, 216, 218, 451] |
p02953 | u490084374 | 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())\nli = [map(int, input().split())]\nans = 'Yes'\n\nif n > 1:\n for i in range(n-1):\n if li[-(i+2)] <= li[-(i+1)]:\n pass\n elif li[-(i+2)] - 1 <= li[-(i+1)]:\n li[-(i+2)] = li[-(i+2)] - 1\n else:\n ans = 'No'\n break\n\nprint(ans)", "# -*- coding... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s235674279', 's325561188', 's954057871', 's807471848'] | [11152.0, 14396.0, 5296.0, 14396.0] | [27.0, 46.0, 24.0, 87.0] | [287, 190, 189, 293] |
p02953 | u492447501 | 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())\n\nH = list(map(int, input().split()))\n\nflg = 0\n\nif len(H) != 1:\n for i in range(0, len(H)-1, 1):\n if H[i] > H[i+1]:\n H[i]=H[i]-1\n\ncheck_list = sorted(H)\n\nif check_list==H:\n print("YES")\nelse:\n print("NO")\n', 'N = int(input())\n\nH = list(map(int, input().s... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s281188867', 's288033377', 's595396753', 's659474549', 's785285262', 's920520744', 's922447192', 's964687139', 's939445998'] | [14396.0, 14252.0, 15020.0, 14396.0, 14396.0, 14396.0, 14252.0, 14224.0, 14252.0] | [103.0, 76.0, 133.0, 73.0, 95.0, 133.0, 129.0, 101.0, 105.0] | [249, 327, 267, 211, 248, 309, 307, 209, 282] |
p02953 | u492929439 | 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 = input().split()\nH = [int(x) for x in list]\n\nFLAG = True\nfor i in range(N):\n current = H[i-1]\n for j in range(i, N):\n if ( (current-H[j-1])>1):\n FLAG = False\n break;\n \nif(FLAG == True):\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nlist = input().spl... | ['Wrong Answer', 'Accepted'] | ['s455244371', 's640115753'] | [14396.0, 14396.0] | [2104.0, 87.0] | [263, 322] |
p02953 | u495678669 | 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(\' \')))\ni = 1\nflag = 0\nwhile i < N:\n if H[i-1] > H[i]:\n if H[i-1] - 1 >= H[i] and flag == 0:\n H[i-1] = H[i-1] + 1\n flag = 1\n else:\n print("No")\n quit()\n i += 1\nprint("YES")', 'N = int(input()... | ['Wrong Answer', 'Accepted'] | ['s302824994', 's473392003'] | [14396.0, 14396.0] | [64.0, 106.0] | [284, 240] |
p02953 | u497046426 | 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())\n*H, = map(int, input().split())\ncurrent = 0\nfor h1, h2 in zip(H, H[1:]):\n diff = h1 - h2\n if diff > 1 or (diff == 1 and current == h1): print('No'); break;\n current = h2\nelse:\n print('Yes')", "N = int(input())\n*H, = map(int, input().split())\nfor i in range(N-1, 0, -1):\n h1, ... | ['Wrong Answer', 'Accepted'] | ['s785336116', 's793761119'] | [14224.0, 15020.0] | [71.0, 71.0] | [218, 216] |
p02953 | u498575211 | 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())\nk = list(map(int, input().split()))\nbase = k[0]\nans = "Yes"\nmax = 0\n\nfor i in range(1, N):\n print(str(base-1))\n print(k[i])\n if base-1 >= max:\n max = base -1;\n print("-----------")\n if (base-1 <= k[i]) and (max <= k[i]):\n pass\n else:\n ans = "No"\n break\n base = k[i]... | ['Wrong Answer', 'Accepted'] | ['s391145834', 's259794952'] | [14252.0, 14396.0] | [313.0, 89.0] | [317, 320] |
p02953 | u500944229 | 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()))\nif n == 1:\n print('Yes')\nfor i in range(n-1):\n if h[i]>h[i+1]+1:\n print('No')\n break\n if i > 0:\n if (h[i]-1==h[i-1]) or (h[i]==h[i-1]-1):\n if h[i]==h[i+1]+1:\n print('No')\n break\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s036312105', 's475976376', 's128612435'] | [14396.0, 14400.0, 14396.0] | [131.0, 2104.0, 78.0] | [338, 450, 183] |
p02953 | u502028059 | 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):\n if h[i] > h[i+1]:\n if h[i] > 0:\n h[i] -= 1\nfor i in range(n-1):\n if h[i] > h[i+1]:\n ans = 'No'\n break\nprint(h)", "n = int(input())\nh = list(map(int, input().split()))\nans = 'Yes'\n... | ['Wrong Answer', 'Accepted'] | ['s392041940', 's803465727'] | [14396.0, 14396.0] | [88.0, 94.0] | [235, 239] |
p02953 | u502967152 | 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=reversed(h)\na=0\nfor i in range(length(h)-1):\n if h[i]+1 < h[i+1]:\n a+=1\n break\n elif h[i]+1==h[i+1]:\n h[i+1]=h[i+1]-1\n else:\n pass\nif a==0:\n print("Yes")\nelse:\n print("No")\n ', 'n=int(input())\nh=list(map(int, input().split()))\nh.re... | ['Runtime Error', 'Accepted'] | ['s430142363', 's979169558'] | [14276.0, 14396.0] | [44.0, 87.0] | [243, 235] |
p02953 | u504836877 | 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(h) for h in input().split()]\n\nif N == 1:\n ans = "Yes"\nelse:\n c = 1\n while c <= N-2:\n if H[c] > H[c+1] and H[c-1] < H[c]:\n H[c] -= 1\n elif H[c] == H[c+1] and H[c-1] < H[c]:\n H[c] -= 1\n H[c+1] -= 1\n c += 1\n ... | ['Runtime Error', 'Accepted'] | ['s901951615', 's993897284'] | [14408.0, 14224.0] | [172.0, 86.0] | [474, 197] |
p02953 | u505948952 | 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())\nH=np.array(list(map(int,input().split())))\nif np.any(np.diff(H) >= 2):\n print("No")\n\nprint("Yes")\n', 'import numpy as np\nN = int(input())\nH = np.array(list(map(int, input().split())))\nif all(np.diff(H) >= 0):\n print("Yes")\n\nfor i in range(N):\n h = H.copy()\n h[i] = ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s098642023', 's259218901', 's891013342', 's007001960'] | [23136.0, 23132.0, 23132.0, 23116.0] | [183.0, 2108.0, 182.0, 200.0] | [133, 232, 183, 194] |
p02953 | u506086925 | 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())\nn = len(list(str(N)))\ncnt = 0\nif n==1:\n print(N)\nelse:\n for i in range(n//2):\n cnt += 9 * (10 ** (2 * i)) \n if n%2==1:\n cnt += N - (10 ** (2 ** (n-2))) + 1\n print(cnt)', 'N = int(input())\nh = list(map(int, input().split()))\nans = 0\nfor i in range(N-1):\n if ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s318739529', 's724549547', 's903043739'] | [3060.0, 14396.0, 14396.0] | [17.0, 68.0, 73.0] | [211, 173, 216] |
p02953 | u506858457 | 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()))\npre=-999\nfor i in range(N):\n if pre<=H[i]-1:\n pre=H[i]-1\n else if pre<=H[i]:\n pre=H[i]\n else:\n print('No')\nelse:print('Yes')", "N=int(input())\nH=list(map(int,input().split()))\npre=-999\nfor i in range(N):\n if pre<=H[i]-1:\n pre=H[i]-1\n eli... | ['Runtime Error', 'Accepted'] | ['s075745189', 's587114935'] | [2940.0, 14396.0] | [17.0, 71.0] | [184, 194] |
p02953 | u507351902 | 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())\nlst = [int(i) for i in input().split()]\n\nflag = 0\n\nif len(lst) == 1:\n flag = 1\n\nif flag == 0:\n for i in range(1, len(lst)):\n if lst[i-1]+1 == lst[i]:\n lst[i-1] = lst[i-1] - 1\n\nif flag == 0:\n for i in range(1, len(lst)):\n if (lst[i-1] <= lst[i]) & (flag... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s063824805', 's286332418', 's411646975', 's874709135', 's319474382'] | [14976.0, 142316.0, 14364.0, 14252.0, 14396.0] | [87.0, 1632.0, 211.0, 104.0, 106.0] | [530, 438, 382, 413, 438] |
p02953 | u507456172 | 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()))\nflg = 0\nans = "Yes"\n\nfor i in range(N-1):\n if H[i] >= H[i+1]:\n H[i] -= 1\n\nfor j in range(N-1):\n if H[j] > H[j+1]:\n ans = "No"\n\nprint(ans)', 'N = int(input())\nH = list(map(int,input().split()))\nflg = 0\nans = "Yes"\n\nfor i in range(N-1):\n if... | ['Wrong Answer', 'Accepted'] | ['s682525534', 's905569658'] | [20536.0, 20564.0] | [83.0, 102.0] | [197, 336] |
p02953 | u511449169 | 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()))\np = 0\nflag = 0\nfor i in range(1, len(h) - 1):\n \n if (h[i - 1] - h[i]) > 1:\n print('No')\n exit()\n elif (h[i - 1] - h[i]) == 1:\n if flag == 1:\n print('No')\n exit()\n else:\n flag == 1\n elif (h[i - 1] - h[i]) == 0:\n flag... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s173864262', 's458781586', 's714050259', 's342041554'] | [14592.0, 2940.0, 14480.0, 14396.0] | [124.0, 17.0, 132.0, 57.0] | [677, 1178, 683, 208] |
p02953 | u514118270 | 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()))\nans = 0\nfor i in range(n-1):\n if A[i+1]-A[i] >= -1:\n if max(A[i],A[i+1]) >= ans:\n ans = max(A[i]-1,A[i+1]-1,ans)\n print(i)\n else:\n print('No')\n exit()\n else:\n print('No')\n exit()\nprint('Yes')", "n = int(input())\nA = l... | ['Wrong Answer', 'Accepted'] | ['s247805801', 's748457976'] | [14396.0, 14224.0] | [224.0, 155.0] | [277, 291] |
p02953 | u516554284 | 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(int(input())for i in range(n))\nb=0\nfor i in range(n):\n if a[i]-a[i+1]>=2:\n b+=1\nif b==0:\n print("Yes")\nelse:\n print("No")\n', 'n=int(input())\na=list(for i in range(n))\nb=0\nfor i in range(n):\n if a[i]-a[i+1]>=2:\n b+=1\nif b==0:\n print("Yes")\nelse:\n print("No")', 'n=in... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s034901252', 's399678698', 's579511453', 's698913798', 's799971257', 's983507596', 's192285359'] | [5300.0, 2940.0, 2940.0, 11152.0, 3060.0, 14396.0, 14228.0] | [24.0, 17.0, 18.0, 27.0, 18.0, 92.0, 85.0] | [150, 137, 125, 140, 125, 228, 231] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.