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
|
---|---|---|---|---|---|---|---|---|---|---|
p02658 | u021387650 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nif 0 in A:\n print(1)\n exit\n \nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n \nprint(ans)\n', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nfor i in range(len(A)):\n ans *= A[i]\n if ans == 0:\n break\n \nif ans >= 10**18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nfor i in range(len(A)):\n ans *= A[i]\n \nif ans >= 10**18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s124945882', 's145212168', 's805318961', 's574028400'] | [9044.0, 21788.0, 21780.0, 21796.0] | [22.0, 2206.0, 2206.0, 52.0] | [187, 169, 144, 189] |
p02658 | u021849254 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['a=input()\na=a.split()\n\nb=int(a[0])\n\ndel a[0]\n\nc=1\nfor x in a:\n c=c*int(x)\n \nprint(c) ', 'a=input()\na=a.split()\n\nb=int(a[0])\n\ndel a[0]\n\nc=1\nfor x in a:\n c=c*int(x)\n \nif c > 10**18:\n print(-1)\nelse: \n print(c) ', 's=input()\na=input()\na=a.split()\n\n\nc=1\nfor x in a:\n c=c*int(x)\n \nif c =< 10**18:\n print(c)\nelse: \n print("-1") \n', 'a=int(input())\nA=list(map(int,input().split()))\nans=1\nif A.count(0)==0:\n for x in A:\n ans*=x\n if ans>10**18:\n break\n\n\n if ans>10**18:\n print(-1)\n else:\n print(ans)\nelse:\n print(0)\n '] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s401782101', 's618234823', 's763130754', 's187252402'] | [8972.0, 9144.0, 8816.0, 21636.0] | [30.0, 28.0, 25.0, 55.0] | [88, 124, 116, 219] |
p02658 | u022846086 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\n\nif ans >= 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >= 1000000000000000000:\n ans = -1\n break\n if A[i] == 0:\n ans = 0\n break\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for i in range(N):\n ans *= A[i]\n print(ans)\n if ans > 1000000000000000000:\n ans = -1\n break\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 1000000000000000000:\n ans = -1\n break\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s201804274', 's361661232', 's747092405', 's694673294'] | [21644.0, 21640.0, 21736.0, 21480.0] | [2206.0, 55.0, 80.0, 49.0] | [163, 221, 241, 222] |
p02658 | u023077142 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\n\nN = int(input())\n\nAs = map(int, input().split())\n\nif 0 in As:\n print(0)\n sys.exit(0)\n\nans = 1\nfor a in As:\n ans *= a\n\n if ans > 10**18:\n print(-1)\n sys.exit(0)\n\nprint(ans)\n', 'import sys\n\nN = int(input())\n\nAs = list(map(int, input().split()))\n\nif 0 in As:\n print(0)\n sys.exit(0)\n\nans = 1\nfor a in As:\n ans *= a\n\n if ans > 10**18:\n print(-1)\n sys.exit(0)\n\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s508324577', 's204997378'] | [19416.0, 21792.0] | [43.0, 49.0] | [210, 217] |
p02658 | u023229441 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nA=list(map(int,input().split()))\nans=1\nif 0 in A:\n print(0);exit()\nfor i in range(n):\n ans*=A[i]\n if ans>10**18:\n print(-1);exit()\nprint(-1)\n', 'n=int(input())\nA=list(map(int,input().split()))\nans=1\nif 0 in A:\n print(0);exit()\nfor i in range(n):\n ans*=A[i]\n if ans>10**18:\n print(-1);exit()\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s347347113', 's056102917'] | [21648.0, 21636.0] | [57.0, 56.0] | [172, 173] |
p02658 | u023958502 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\nprint(a)\nans = 1\nfor i in range(len(a)):\n ans *= a[i]\nif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nalready = False\nfor i in range(len(a)):\n if a[i] == 0:\n print(0)\n already = True\n break\nans = 1\nif not already:\n for i in range(len(a)):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n already = True\n break\n\nif ans <= 1000000000000000000 and not already:\n print(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s443326768', 's204475843'] | [21640.0, 21480.0] | [2206.0, 59.0] | [175, 405] |
p02658 | u024343432 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from sys import stdin,stdout\nLI=lambda:list(map(int,input().split()))\nMAP=lambda:map(int,input().split())\nIN=lambda:int(input())\nS=lambda:input()\nimport math\nfrom collections import Counter,defaultdict\n\nn=IN()\na=LI()\np=1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n p*=i\n print(p)\n if p>pow(10,18):\n print(-1)\n exit()\nprint(p)\n', 'from sys import stdin,stdout\nLI=lambda:list(map(int,input().split()))\nMAP=lambda:map(int,input().split())\nIN=lambda:int(input())\nS=lambda:input()\nimport math\nfrom collections import Counter,defaultdict\n\nn=IN()\na=LI()\np=1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n p*=i\n if p>pow(10,18):\n print(-1)\n exit()\nprint(p)\n'] | ['Wrong Answer', 'Accepted'] | ['s056336111', 's939353808'] | [22364.0, 22532.0] | [105.0, 82.0] | [353, 340] |
p02658 | u026155812 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nN = int(input())\nnum_list = 0\nfor i in range(N):\n a = int(input())\n num_list.append(a)\nif 0 in num_list:\n print(0)\nelse:\n mul = 1\n for a in num_list:\n mul *= a\n if mul > 10**18:\n print(-1)\n sys.exit()\n print(mul)', 'import sys\nN = int(input())\nnum_list = [int(i) for i in input().split()]\nif 0 in num_list:\n print(0)\nelse:\n mul = 1\n for a in num_list:\n mul *= a\n if mul > 10**18:\n print(-1)\n sys.exit()\n print(mul)\n'] | ['Runtime Error', 'Accepted'] | ['s773127950', 's985694329'] | [12800.0, 21568.0] | [37.0, 60.0] | [245, 219] |
p02658 | u027675217 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int,input().split()))\nsum = 1\nfor i in a:\n if i == 0\n sum = sum * i\n break\n else\n sum = sum * i\n\nif sum > 10**18:\n print(-1)\nelse:\n print(sum)\n', 'n = int(input())\na = list(map(int,input().split()))\nsum = 1\nif 0 in a:\n sum = 0\nelse:\n for i in a:\n sum = sum * i\n if sum > 10**18:\n sum = -1\n break\nprint(sum)\n'] | ['Runtime Error', 'Accepted'] | ['s551624441', 's481958820'] | [9016.0, 21584.0] | [22.0, 51.0] | [194, 202] |
p02658 | u028014940 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\nn=int(input())\na = list(map(int,input(). split ()))\nif 0 in a:\n print(0)\n return\n\nprod = 1\nfor a in A:\n prod *= a\n if prod > 10**18:\n print(-1)\n return\n\nprint(prod)\n', '\nn=int(input())\na = list(map(int,input().split()))\nif 0 in a:\n print(0)\n\nprod = 1\nfor a in A:\n prod *= a\n if prod > 10**18:\n print(-1)\n\nprint(prod)\n', '\nN = int(input())\n A = list(map(int,input().split()))\n\n if 0 in A:\n print(0)\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 10**18:\n print(-1)\n\n print(prod)', "\nn,*a=map(int,input().split())\n\nval=1\nfor x in a:\n val*=x\n\nprint(val if val<=10**18 else '-1')", '\ndef main ():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A:\n print(0)\n return\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n\n print(prod)\nmain ()\n', "\nn,*a=map(int,input().split)\n\nval=1\nfor x in a:\n val*=x\n\nprint(val if val<=10**18 else '-1')", '\nn=int(input())\na = list(map(int,input(). split ()))\nif 0 in a:\n print(0)\n\nprod = 1\nfor a in A:\n prod *= a\n if prod > 10**18:\n print(-1)\n\nprint(prod)\n', 'def main ():\nN = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n return\n\nprod = 1\nfor a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n\n print(prod)\nmain ()\n', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\n N = 0\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s132360245', 's193378646', 's277690828', 's429910554', 's515660860', 's725901801', 's806490444', 's880192458', 's180065253'] | [9048.0, 21652.0, 8944.0, 9180.0, 21616.0, 9096.0, 21632.0, 8904.0, 21556.0] | [25.0, 49.0, 22.0, 21.0, 66.0, 24.0, 51.0, 22.0, 55.0] | [192, 164, 202, 97, 278, 95, 166, 229, 177] |
p02658 | u030879708 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['a,b=open(0);c=1;\nfor i in b.split():c=[-1,d:=int(i)*c][-1<d<10**18]\nprint(c)', "input();a=1\nfor i in input().split():a*=int(i);a=[-1,a][1=<a<=eval('1'+'0'*18)]\nprint(a)", 'a=1\nfor i in[*open(0)][1].split():a*=int(i);a=[-1,a][-1<a<1e18]\nprint(a)', 'a=1\nfor i in[*open(0)][1].split():a*=int(i);a=[-1,a][-1<a<1e18]\nprint(a)', 'a=1\nfor i in[*open(0)][1].split():a*=int(i);a=[-1,a][-1<a<1e18]\nprint(a)1', 'a=1\nfor i in[*open(0)][1].split():a=[-1,a:=a*int(i)][-1<a<=1e18]\nprint(a)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s045973924', 's081086679', 's258867607', 's760155937', 's911825695', 's196322404'] | [19388.0, 8924.0, 19292.0, 19364.0, 9016.0, 19184.0] | [74.0, 30.0, 75.0, 75.0, 26.0, 76.0] | [76, 88, 72, 72, 73, 73] |
p02658 | u033287260 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n if A[i] < (10**18 / ans):\n ans *= A[i]\n print(ans)\n else:\n print(-1)\n sys.exit()\n\nprint(ans)\n', 'import math,sys\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n \n if A[i] > 10**18/ans:\n ans = ans*A[i]\n \n print(-1)\n sys.exit()\n\nprint(ans)\n', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n if A[i] < (10**18 / ans):\n ans *= A[i]\n else:\n print(-1)\n sys.exit()\n\nprint(ans)\n', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n if A[i] < (10**18 / ans):\n ans *= A[i]\n print(ans)\n else:\n print(-1)\n sys.exit()\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(N):\n if A[i] < (10**18 / ans):\n ans *= A[i]\n print(ans)\n else:\n print(-1)\n exit()\n\nprint(ans)\n', 'import math,sys\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n ans = ans*A[i]\n if ans > pow(10,18):\n print(-1)\n sys.exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015523230', 's681527789', 's794950577', 's943407808', 's982220178', 's651768359'] | [21744.0, 22388.0, 21596.0, 21808.0, 21676.0, 22340.0] | [102.0, 73.0, 65.0, 98.0, 99.0, 72.0] | [324, 428, 305, 260, 305, 297] |
p02658 | u034441456 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\ns = 1\nB = sort(A)\nfor i in B:\n s = s*i\n\tif s > 10**18:\n \ts = -1\n break\n if s == 0\n \tbreak\nprint(s)', 'N = int(input())\nA = list(map(int, input().split()))\ns = 1\nB = sorted(A)\nfor i in B:\n s = s*i\n if s > 10**18:\n s = -1\n break\n if s == 0:\n break\nprint(s)'] | ['Runtime Error', 'Accepted'] | ['s219239977', 's697111974'] | [9028.0, 21528.0] | [23.0, 80.0] | [168, 164] |
p02658 | u035445296 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(input().split()))\nans = 1\nif 0 in a:\n ans = 0\nfor i in range(n):\n ans *= a[i]\n print(i)\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n ans = 0\nfor i in range(n):\n ans *= a[i]\n print(i)\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans >= 10**18:\n ans = -1\nprint(ans)', 'import numpy as np\nn = int(input())\na = list(map(int, input().split()))\nans = np.prod(a)\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans >= 10**18:\n ans = -1\n break\nprint(ans)', 'n = int(input())\na = list(map(int ,input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > 10*18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(input().split()))\nans = 1\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s029655263', 's082074490', 's212649918', 's231709402', 's300454151', 's516276942', 's923943699', 's790917432'] | [19340.0, 21812.0, 21668.0, 40004.0, 21788.0, 21576.0, 19088.0, 21660.0] | [32.0, 2206.0, 2206.0, 148.0, 50.0, 2206.0, 37.0, 51.0] | [160, 165, 172, 128, 184, 131, 167, 183] |
p02658 | u035453792 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n= int(input())\na=list(map(int,input().split()))\na=np.array(a)\nans=1\nfor i in range(n):\n ans=ans*a[i]\nif ans<=(10**18):\n print(ans)\nelse:\n print(-1)', 'n= int(input())\na=list(map(int,input().split()))\na.sort()\nans=1\nfor i in a:\n ans=ans*i\n if ans>(10**18):\n print(-1)\n break\n elif ans==0:\n print(ans)\n break\nif ans<=(10**18)and ans!=0:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s089496988', 's809375791'] | [21468.0, 21640.0] | [47.0, 78.0] | [157, 235] |
p02658 | u036065030 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = 1\nfor _ in range(N):\n A = A * int(input())\n\nprint(A)', "N = int(input())\nA = list(map(int, input().split()))\n\nif A.count(0) >= 1:\n print(0)\n exit()\n\nanswer = 1\nfor _ in A:\n answer *= _\n if answer > 1000000000000000000:\n print('-1') \n exit()\n\nprint(answer)\n"] | ['Runtime Error', 'Accepted'] | ['s287564647', 's540242447'] | [12828.0, 21700.0] | [35.0, 51.0] | [76, 226] |
p02658 | u037754315 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n print(0)\n exit()\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+17\n res = -1\n break\n\nprint(res)\n', 'N = int(input())\nA = sorted(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+17\n res = -1\n break\n\nprint(res)', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n\nfor x in range(N) :\n res *= A[x]\n if res > 10**18\n res = -1\n break\n\nprint(res)\n', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n N = 0\n\nfor x in range(N) :\n res *= A[x]\n if res > 10**18\n res = -1\n break\n\nprint(res)', 'N = int(input())\nA = sorted(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+18\n res = -1\n break\n\nprint(res)\n', 'N = int(input())\nA = sorted(map(int, input().split()))\nres = 1\n\nif 0 in A :\n print(0)\n exit()\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+17\n print(-1)\n break\n\nprint(res)', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n print(0)\n exit()\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+17\n print(-1)\n break\n\nprint(res)', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+18\n res = -1\n break\n\nprint(res)', 'N = int(input())\nA = sorted(map(int, input().split()))\nres = 1\n\nif 0 in A :\n print(0)\n exit()\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10E+18\n print(-1)\n break\n\nprint(res)\n', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\n\nif 0 in A :\n res = 0\n\nfor x in range(N) :\n res = res*A[x]\n if res > 10**18\n res = -1\n break\n\nprint(res)\n', 'N = int(input())\nA = sorted(map(int, input().split()))\nans = 1\n\nif 0 in A :\n ans = 0\n\nfor x in range(N) :\n ans *= A[x]\n if ans > 10**18 :\n ans = -1\n break\n\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s058126859', 's150973320', 's163372010', 's235791676', 's407111067', 's559154936', 's678450184', 's865743699', 's906196093', 's980755079', 's892188182'] | [8976.0, 8924.0, 9028.0, 8928.0, 8924.0, 9036.0, 8928.0, 8920.0, 8964.0, 9040.0, 21708.0] | [22.0, 20.0, 24.0, 24.0, 22.0, 24.0, 24.0, 26.0, 22.0, 24.0, 93.0] | [201, 190, 186, 195, 191, 203, 201, 188, 204, 189, 189] |
p02658 | u038216098 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nA=[]\nresult=1\nfor i in range(N):\n A.append(int(input()))\nfor j in range(N):\n result=result*A[j]\nif(result>10**18):\n print(-1)\nelse:\n print(result)', 'def main():\nN = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n return\nprod = 1\nfor a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\nprint(prod)\n\nmain()\n', 'N=int(input())\nresult=1\nA=input().split()\nfor j in range(N):\n result=result*int(A[j])\n if(result>10**18):\n print(-1)\n return\nprint(result)', 'N=int(input())\nA=[]\nresult=1\nfor i in range(N):\n A.append(int(input().split()))\nfor j in range(N):\n result=result*A[j]\nif(result>10**18):\n print(-1)\nelse:\n print(result)', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A:\n print(0)\n return\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\n\nmain()'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s128907545', 's523109486', 's817418732', 's995807867', 's573720852'] | [12608.0, 9008.0, 8824.0, 19312.0, 21480.0] | [34.0, 22.0, 23.0, 34.0, 53.0] | [165, 206, 146, 173, 253] |
p02658 | u039065404 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nN = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n sys.exit()\nK = 1\nfor i in range(N):\n K = A[i]*K\n print(K)\n if K > 10**18:\n print(-1)\n sys.exit()\nprint(K)', 'import sys\nN = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n sys.exit()\nK = 1\nfor i in range(N):\n K = A[i]*K\n if K > 10**18:\n print(-1)\n sys.exit()\nprint(K)'] | ['Wrong Answer', 'Accepted'] | ['s316073515', 's403180214'] | [21472.0, 21664.0] | [81.0, 49.0] | [201, 190] |
p02658 | u039189422 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from sys import exit\n\nn=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\ntmp=1\nfor a in A:\n\ttmp*=a\n\tif tmp>10**8:\n\t\tprint("-1")\n\t\texit()\n\nprint(tmp)', 'from sys import exit\n\nn=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\ntmp=1\nfor a in A:\n\ttmp*=a\n\tif tmp>10**18:\n\t\tprint("-1")\n\t\texit()\n\nprint(tmp)'] | ['Wrong Answer', 'Accepted'] | ['s741735986', 's189495158'] | [21524.0, 21776.0] | [84.0, 84.0] | [155, 156] |
p02658 | u039355749 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\n\nn = int(input())\nAs = list(map(int, input().split()))\n\nans = 1\nfor i in range(n):\n ans = ans*As[i]\n \tif ans > 10**18:\n print(-1)\n sys.exit()\n\nprint(ans)', 'import sys\n \nn = int(input())\nAs = list(map(int, input().split()))\n\nif 0 in As:\n print(0)\n sys.exit()\n\nans = 1\nfor i in range(n):\n ans = ans*As[i]\n if ans > 10**18:\n print(-1)\n sys.exit()\n \nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s767888151', 's007074839'] | [9024.0, 21552.0] | [27.0, 53.0] | [176, 210] |
p02658 | u039860745 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = input()\nli = list(map(int, input().split())) \n\ntotal = 1\n\nif li.index(0):\n total = 0\n print(total)\nelse:\n for a in li:\n total *= a\n if 10 ** 18 < total:\n total = -1\n print(total)', 'from operator import mul\nfrom functools import reduce\n\nn = input()\nli = list(map(int, input().split())) \n\ntotal = 1\n\nif 0 in li:\n total = 0\n print(total)\nelse:\n total = reduce(mul, [10, 11, 12]) #=> 1320\n if 10 ** 18 < total:\n total = -1\n print(total)', 'n = input()\nli = list(map(int, input().split())) \n\ntotal = 1\nli.sort()\nfor a in li:\n if a == 0:\n total = 0\n break\n total *= a\n if 10 ** 18 < total:\n total = -1\n break\nprint(total)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s222611939', 's670878279', 's110189721'] | [21644.0, 22740.0, 21584.0] | [44.0, 56.0, 71.0] | [219, 273, 216] |
p02658 | u040298438 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['ans = 1\nn = input()\na = list(map(int, input().split()))\n\nfor i in range(n):\n ans *= a[i]\n\nif ans > 10 ** 18:\n print(-1)\nelse:\n print(ans)', 'n = input()\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10 ** 18:\n ans = -1\n break\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s271964353', 's504658008'] | [21772.0, 21580.0] | [53.0, 55.0] | [146, 204] |
p02658 | u040628883 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(intput())\narr=list(input().slpit())\narr.sort();\nx=int(1)\nfor i in arr:\n x=x*i\n if x>1e18:\n x=-1;\n break;\nprint(x)\n ', 'n=int(input())\narr=list(map(int,input().split()))\narr.sort();\nx=int(1)\nfor i in arr:\n x=x*i\n if x>1e18:\n x=-1;\n break;\nprint(x)\n \n'] | ['Runtime Error', 'Accepted'] | ['s257555493', 's464319376'] | [9012.0, 21636.0] | [26.0, 92.0] | [130, 139] |
p02658 | u042347918 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\n\n\nN = input()\n\n\nA = list(map(int, input().split()))\n\n#print(N)\n#print(A)\nans = 1\nfor i in A:\n #print(i)\n ans *= i\n #print(ans)\n\nif ans >= 10**18:\n print("-1")\n sys.exit()\nelse:\n print(ans)\n sys.exit()', 'import sys\n\n\nN = input()\n\n\nA = list(map(int, input().split()))\n\n#print(N)\n#print(A)\nans = 1\nif 0 in A:\n print("-1")\n sys.exit()\n\n\nfor i in A:\n #print(i)\n ans *= i\n #print(ans)\n if ans >= 10**18:\n print("-1")\n sys.exit()\n\nprint(ans)', 'import sys\n\n\nN = input()\n\n\nA = list(map(int, input().split()))\n\n#print(N)\n#print(A)\nans = 1\nif 0 in A:\n print(0)\n sys.exit()\n\n\nfor i in A:\n #print(i)\n ans *= i\n #print(ans)\n if ans > 10**18:\n print(-1)\n sys.exit()\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s252298594', 's888735862', 's374646324'] | [21700.0, 21548.0, 21580.0] | [2206.0, 59.0, 61.0] | [279, 310, 304] |
p02658 | u044459372 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["def main():\n n = int(input())\n a = [int(i) for i in input().split()]\n ans = solve(n, a)\n print(ans)\n\ndef solve(n, a):\n if 0 in a:\n return 0\n lim = 10 ** 18\n ans = 1\n for i in a:\n ans *= i\n print(f'{ans:}')\n if ans > lim:\n return -1\n return ans\n\nif __name__ == '__main__':\n main()", "def main():\n n = int(input())\n a = [int(i) for i in input().split()]\n ans = solve(n, a)\n print(ans)\n\ndef solve(n, a):\n if 0 in a:\n return 0\n lim = 10 ** 18\n ans = 1\n for i in a:\n ans *= i\n #print(f'{ans:}')\n if ans > lim:\n return -1\n return ans\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s987232269', 's926723562'] | [21336.0, 21628.0] | [73.0, 56.0] | [348, 349] |
p02658 | u044514121 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\nN=int(input())\n\ndata=[int(e) for e in input().split()]\n\ndata=data.sort(reverse=False)\n\njudge=True\n\nfor i in data:\n sum_1=sum_1*i\n\n if sum_1>1000000000000000000:\n print("-1")\n judge=False\n break\n\nif judge==True:\n print(sum_1)\n', 'import sys\n\ninput = sys.stdin.readline\n\nN = int(input())\nx = sorted(list(map(int, input().split())))\nt = 1\n\nfor num in x:\n t = t * num\n if t > 10 ** 18:\n print(-1)\n sys.exit()\n\nif (t > 10 ** 18):\n print(-1)\nelse:\n print(t)'] | ['Runtime Error', 'Accepted'] | ['s571777627', 's780480097'] | [21468.0, 21536.0] | [80.0, 88.0] | [256, 248] |
p02658 | u045939752 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = input()\nA = list(map(int,input().split()))\nA.sort()\nans = 1\nfor a in A:\n ans *= a\n if ans >= 10**18:\n ans = -1\n break\nprint(ans)\n', 'N = input()\nA = list(map(int,input().split()))\nA.sort()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s924749436', 's743992746'] | [21560.0, 21460.0] | [86.0, 87.0] | [141, 140] |
p02658 | u046595819 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nans = 1\nfor i in range(0, n):\n\tt = int(input())\n\tans *= t\nif ans > int(1e18):\n\tprint(-1)\nelse:\n\tprint(ans)', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n ans = 1\n for a in A:\n ans *= a\n if ans > int(1e18):\n print(-1)\n return\n\n print(ans)\n\nmain()'] | ['Runtime Error', 'Accepted'] | ['s739360628', 's061327143'] | [12776.0, 21464.0] | [35.0, 48.0] | [123, 259] |
p02658 | u047485390 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\nn = int(input())\nq = 1000000000000000000\nb = 1\ncek = True\na = list(map(int, input().split()))\nfor i in range(n):\n\tb = b * a[i] \n\tif b > q :\n\t\tcek = False\n\t\tbreak\nif cek :\n\tprint(b)\nelse :\n\tprint("-1")\n', 'n = int(input())\na = list(map(int, input().split()))\nn = int(input())\nq = 1000000000000000000\nb = 1\ncek = True\na = list(map(int, input().split()))\nfor i in range n :\n\tb = b * a[i] \n\tif b > q :\n\t\tcek = False\n\t\tbreak\nif cek :\n\tprint(b)\nelse :\n\tprint("-1")\n', 'n = int(input())\na = list(map(int, input().split()))\n\nq = 1000000000000000000\nb = 1\ncek = True\nzero = a.count(0)\nif zero > 0 :\n\tprint("0")\nelse :\n\tfor i in range(n) :\n\t\tb = b*a[i]\n\t\tif b > q :\n\t\t\tcek = False\n\t\t\tbreak\n\tif cek :\n\t\tprint(b)\n\telse :\n\t\tprint("-1")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s379369572', 's487878037', 's189885259'] | [21648.0, 9028.0, 21664.0] | [51.0, 22.0, 48.0] | [254, 254, 260] |
p02658 | u047662730 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\noutput = A[1]\nfor i in range(1, N):\n output = output * A[i]\n if output > pow(10, 18):\n output = -1\n break\n\nfor i in range(N):\n A[i] == 0\n output = 0\n\nprint(output)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\noutput = A[1]\nfor i in range(1, N):\n output = output * A[i]\n if output > pow(10, 18):\n output = -1\n break\n\nfor i in range(N):\n if A[i] == 0:\n output = 0\n\nprint(output)\n'] | ['Wrong Answer', 'Accepted'] | ['s497904806', 's807765223'] | [21648.0, 21540.0] | [81.0, 80.0] | [244, 252] |
p02658 | u047868530 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\n\ndef main(*, int=int, input=input):\n N = int(input())\n\n \n A = list(map(int, input().split()))\n\n if 0 in A:\n Alog = [0]\n else:\n Alog = [math.log10(x) for x in A]\n\n print()\n if sum(Alog)>18:\n print(-1)\n else:\n ans = 1\n for a in A:\n ans = ans * a\n if ans > 10**18:\n print(-1)\n else:\n print(ans)\n \n\n\nif __name__ == "__main__":\n import io, sys\n if "_INPUT" in locals():\n sys.stdin = io.StringIO(_INPUT)\n main()', 'import math\n\ndef main(*, int=int, input=input):\n N = int(input())\n\n \n A = list(map(int, input().split()))\n\n if 0 in A:\n Alog = [0]\n else:\n Alog = [math.log10(x) for x in A]\n\n if sum(Alog)>=18:\n print(-1)\n else:\n ans = 1\n for a in A:\n ans = ans * a\n print(ans)\n \n\n\nif __name__ == "__main__":\n import io, sys\n if "_INPUT" in locals():\n sys.stdin = io.StringIO(_INPUT)\n main()', 'import math\n \ndef main(*, int=int, input=input):\n N = int(input())\n \n \n A = list(map(int, input().split()))\n \n if 0 in A:\n print(0)\n return\n else:\n Alog = [math.log10(x) for x in A]\n \n if sum(Alog)>=18:\n print(-1)\n else:\n ans = 1\n for a in A:\n ans = ans * a\n print(ans)\n \nif __name__ == "__main__":\n import io, sys\n if "_INPUT" in locals():\n sys.stdin = io.StringIO(_INPUT)\n main()', 'import math\n\ndef main(*, int=int, input=input):\n N = int(input())\n\n \n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n else:\n Alog = [math.log10(x) for x in A]\n\n if sum(Alog)>18:\n print(-1)\n else:\n ans = 1\n for a in A:\n ans = ans * a\n if ans > 10**18:\n print(-1)\n else:\n print(ans)\n \n\n\nif __name__ == "__main__":\n import io, sys\n if "_INPUT" in locals():\n sys.stdin = io.StringIO(_INPUT)\n main()'] | ['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s460209830', 's679781507', 's738509154', 's954186527'] | [22712.0, 22684.0, 22712.0, 22644.0] | [2206.0, 2206.0, 60.0, 58.0] | [588, 512, 524, 589] |
p02658 | u048013400 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\n\nmulti = 1\ni = 0\n\nfor n in range(N):\n multi = multi*A[n]\n if multi > 1000000000000000000:\n i = 1\n break\n\nif i == 1:\n print(-1)\nelse:\n print(0)', 'N = int(input())\nA = list(map(int,input().split()))\n\nmulti = 1\ni = 0\n\nfor n in range(N):\n multi = multi*A[n]\n\nif multi > 1000000000000000000:\n print(-1)\nelse:\n print(0)', "N = int(input())\nA = list(map(int,input().split()))\nA.sort()\n\nmulti = 1\n\nif A[-1]==0:\n print('0')\nelse:\n for n in range(N):\n multi = multi*A[n]\n if multi>10**18:\n multi=-1\n break\n \n print(multi)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s039928729', 's167412689', 's522962386'] | [21632.0, 21708.0, 21660.0] | [47.0, 2206.0, 90.0] | [220, 177, 246] |
p02658 | u048800107 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\nl = list(map(int,input().split()))\n\nk = 1\n\nfor i in l:\n k = k*i\n if k > 10**18 and not 0 in l:\n print(-1)\n exit()\n\nif k > 10**18:\n print(-1)\nelse:\n print(k)', '\nn = int(input())\n\nl = list(map(int,input().split()))\n\nk = 1\n\nif 0 in l:\n print(0)\n exit()\n\nfor i in l:\n k = k*i\n if k > 10**18 :\n print(-1)\n exit()\n\nif k > 10**18:\n print(-1)\nelse:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s646377267', 's154039445'] | [9192.0, 21792.0] | [20.0, 51.0] | [183, 223] |
p02658 | u048826171 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nresult = 1\nfor i in range(N):\n result *= A[i]\n if result >= 10**18:\n result = -1\n break\nprint(result)', "N = int(input())\nA = list(map(int, input().split()))\nresult = 1\nfor i in range(N):\n result = result*A[i]\nif result >= 10**18:\n print('-1')\nelse:\n print(result)", 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nresult = 1\nfor i in range(N):\n result *= A[i]\n if result > 10**18:\n result = -1\n break\nprint(result)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s226554064', 's320365894', 's126101479'] | [21720.0, 21592.0, 21408.0] | [59.0, 2206.0, 96.0] | [162, 162, 170] |
p02658 | u048915776 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(input().split())\nans=1\nf=0\ni=0\nwhile(i<n):\n if f==0:\n ans=ans*int(a[i])\n if f==0 and ans>1000000000000000000:\n f=1\n if int(a[i])==0:\n print(0)\n exit()\n i+=2\nif f==1:\n print(-1)\n exit()\nprint(ans)', 'a,b=map(str,input().split())\nb1=int(b*100)\na1=int(a)\nans=int(a1*b1/100)\nprint(int(ans))', 'n=int(input())\na=list(input().split())\nans=1\nfor i in a:\n ans=ans*int(i)\n if f==0 and ans>1000000000000000000:\n f=1\n if int(i)==0:\n f=0\n print(0)\nif f==1:\n print(-1)\n exit()\nprint(ans)', 'n=int(input())\na=list(input().split())\nans=1\nf=0\ni=0\nwhile(i<n):\n if f==0:\n ans=ans*int(a[i])\n if f==0 and ans>1000000000000000000:\n f=1\n if int(a[i])==0:\n print(0)\n exit()\n i+=1\nif f==1:\n print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s240370383', 's411258547', 's666276796', 's136412453'] | [19512.0, 8928.0, 19392.0, 19436.0] | [50.0, 20.0, 33.0, 78.0] | [263, 87, 220, 263] |
p02658 | u049182844 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na_list = list(map(int,input().split()))\nc = 1 \nfor num in a_list:\n c *= num\nprint(c)\nif len(str(c)) >= 19:\n print(-1)\nelse:\n print(c)\n ', 'def main ():\n N = int(input())\n A = list(map(int,input(). split ()))\n if 0 in A:\n print(0)\n return\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain ()'] | ['Wrong Answer', 'Accepted'] | ['s798276612', 's622168125'] | [21668.0, 21692.0] | [2206.0, 58.0] | [156, 232] |
p02658 | u049191820 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nx = list(map(int, input().split()))\nans = 1\n\nif 0 in x: ans=0\n\nfor i in x:\n ans*=i\n print(i,ans)\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)', 'n = int(input())\nx = list(map(int, input().split()))\nans = 1\n\nif 0 in x: ans=0\n\nfor i in x:\n ans*=i\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s572458226', 's852150829'] | [21428.0, 21792.0] | [113.0, 60.0] | [198, 181] |
p02658 | u049679412 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#d\nimport math\nfrom collections import deque\n\n\nn = int(input())\na = []\nans = 0\nd = 2\nfor i in range(2,int(math.sqrt(n)+1)):\n \n if n%i==0:\n a.append(i)\n n/=i\nans = len(a)\nif ans == 0 and n >1:\n ans = 1\nprint(ans)', '#b\nn = int(input())\na = list(map(int,input().split()))\nans = 1\ne = 0\nm = 10**18\na.sort()\nfor i in range(n):\n ans *= a[i]\n if a[i] == 0:\n ans = 0\n e = 0\n break\n if ans > m:\n e = 1\n break\n\n\nif e == 1:\n print(-1)\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s439918616', 's978978742'] | [9556.0, 21788.0] | [24.0, 73.0] | [234, 277] |
p02658 | u050435651 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split(\' \')))\nif a.index(0) >= 0:\n\tprint(0)\nelse:\n\tlim = int(1e18)\n\tmult = 1\n\tfor v in a:\n\t\tif mult > lim:\n\t\t\tbreak\n\t\telse:\n\t\t\tmult *= v\n\tif mult > lim:\n\t\tprint("-1")\n\telse:\n\t\tprint(mult)', 'n = int(input())\na = list(map(int, input().split(\' \')))\nif a.count(0) > 0:\n\tprint("0")\nelse:\n\tlim = int(1e18)\n\tmult = 1\n\tfor v in a:\n\t\tif mult > lim:\n\t\t\tbreak\n\t\telse:\n\t\t\tmult *= v\n\tif mult > lim:\n\t\tprint("-1")\n\telse:\n\t\tprint(mult)'] | ['Runtime Error', 'Accepted'] | ['s972716498', 's853459527'] | [21612.0, 21652.0] | [58.0, 57.0] | [229, 230] |
p02658 | u050805798 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = [int(x) for x in input().split()]\nans = 1\nfor i in a:\n ans = ans * i\nif ans >= 10**18:\n print(-1)\nelif ans == 0:\n print(0)\nelse:\n print(ans)', 'n = int(input())\na = [int(x) for x in input().split()]\nans = 1\nfor i in a:\n ans = ans * i\n if ans == 0:\n print(0)\n break\n elif ans >= 10**18:\n if 0 in a[i:-1]:\n print(0)\n break\n else:\n print(-1)\n break\nif ans != 0 and ans <= 10**18:\n print(ans)', 'n = int(input())\na = [int(x) for x in input().split()]\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans = ans * i\n if ans > 10**18:\n print(-1)\n break\n if ans <= 10**18:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s052345095', 's183933514', 's547593071'] | [21704.0, 21712.0, 21644.0] | [2206.0, 52.0, 51.0] | [174, 328, 240] |
p02658 | u051358943 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\nimport numpy as np\n\nN = int(input())\nA = list(map(int,input().split()))\nans = 1\nA_log = A\ntry:\n A_log = list(map(math.log10,A))\nexcept ValueError:\n print(0)\nelse:\n print(A_log, sum(A_log))\n if sum(A_log) > 18:\n print(-1)\n else:\n for i in A:\n ans *= i\n if ans <= 1e18:\n print(ans)\n else:\n print(-1)', 'import math\nimport numpy as np\n\nN = int(input())\nA = list(map(int,input().split()))\nans = 1\nA_log = A\ntry:\n A_log = list(map(math.log10,A))\nexcept ValueError:\n print(0)\n exit()\n\nif sum(A_log) >= 18:\n print(-1)\nelse:\n for i in A:\n ans *= i\n print(ans)', 'import math\nimport numpy as np\n\nN = int(input())\nA = list(map(int,input().split()))\nans = 1\nA_log = list(map(math.log10,A))\n\nif sum(A_log) >= 18:\n print(-1)\nelse:\n for i in A:\n ans *= i\n print(ans)', 'import math\nimport numpy as np\n\nN = int(input())\nA = list(map(int,input().split()))\nans = 1\nA_log = A\ntry:\n A_log = list(map(math.log10,A))\nexcept ValueError:\n print(0)\nelse:\n if sum(A_log) > 18:\n print(-1)\n else:\n for i in A:\n ans *= i\n if ans <= 1e18:\n print(ans)\n else:\n print(-1)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s425038104', 's814698574', 's882100134', 's920503594'] | [40124.0, 40140.0, 40176.0, 40148.0] | [162.0, 159.0, 150.0, 137.0] | [385, 275, 213, 356] |
p02658 | u051613269 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nL = list(map(int,input().split()))\nC = 1\nfor i in range(N):\n if L[i] == 0:\n C = 0\n else:\n while C <= 10**18:\n C *= L[i]\nif C <= 10**18:\n print(C)\nelse:\n print(-1)\n ', 'N = int(input())\nL = list(map(int,input().split()))\nC = 1\nfor i in range(N):\n if L[i] == 0:\n C = 0\nwhile C <= 10**18:\n for i in range(N):\n C *= L[i]\nif C <= 10**18:\n print(C)\nelse:\n print(-1)\n ', 'N = int(input())\nL = list(map(int,input().split()))\nC = 1\nfor i in range(N):\n if L[i] == 0:\n C = 0\nwhile C <= 10**18:\n C *= L[i]\nif C <= 10**18:\n print(C)\nelse:\n print(-1)', 'N = int(input())\nli = list(map(int,input()))\nC = 1\nfor i in range(N):\n C *= li[i]\nif C <= 10 ** 18:\n print(C)\nelse: print(-1)', 'N = int(input())\nli = []\nC = 1\nwhile C <= 10**18:\n\tfor i in range(N):\n\t\tli.insert(i,int(input())\n \tC *= li[i]\nif C <= 10**18:\n\tprint(C)\nelse: print(-1)\n\n \n\t\n \n ', 'N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nc = 1\nfor i in range(N):\n c *= L[i]\n if c > 10**18:\n c = -1\n break\nprint(c)\n '] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s115615916', 's509885039', 's573461536', 's685346313', 's696779436', 's714804637'] | [21612.0, 21480.0, 21664.0, 12632.0, 9016.0, 21544.0] | [2206.0, 2206.0, 2206.0, 24.0, 25.0, 94.0] | [221, 222, 190, 127, 178, 161] |
p02658 | u052833850 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\na,b=map(str,input().split())\na=int(a)\nb=float(b)\n\n#x=int(a*b)\nx=math.floor(a*b)\nprint(x)', "import numpy as np\nn=int(input())\n\na=[0]*n\na=list(map(int,input().split()))\n\nx=np.prod(a)\n\nif x>=pow(10,18):\n print('-1')\nelse:\n print(x)", "import numpy as np\nn=int(input())\na=list(map(int,input().split()))\n\n\n\nx=np.prod(a)\n\nif x>=10**18:\n print('-1')\nelse:\n print(x)", 'n=int(input())\na=list(map(int,input().split()))\n\nx=a[0]\n\nif 0 not in a:\n for i in range (1,n):\n x=x*a[i]\n if x > pow(10,18):\n print(-1)\n exit() \n print(x) \nelse:\n print(0)\n'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s173079930', 's216653804', 's553831099', 's607758661'] | [9112.0, 41052.0, 40160.0, 21784.0] | [25.0, 150.0, 140.0, 69.0] | [100, 143, 132, 235] |
p02658 | u054662964 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["a = int(input())\nb = [int(i) for i in input().split()]\n\nans =1\nfor I in b:\n ans = ans*I\n if ans > 10**18:\n print('-1')\n break\n else:\n if I == b[-1]:\n print(ans)\n", 'a = int(input())\nb = input().split()\nc =[]\nfor i in range(a):\n d = int(b[i])\n c.append(d)\nfrom operator import mul\nfrom functools import reduce\nP = reduce(mul, c)\nif P>=10**18:\n print(-1)\nelse:\n print(P)\nprint(P)', 'a = int(input())\nb = input().split()\nc =[]\nfor i in range(a):\n d = int(b[i])\n c.append(d)\nfrom operator import mul\nfrom functools import reduce\nP = reduce(mul, c)\nif P>=10**18:\n print(-1)\nelse:\n print(P)\nprint(int(P))', 'a = int(input())\nb = input().split()\nc =[]\nfor i in range(a):\n d = int(b[i])\n c.append(d)\nfrom operator import mul\nfrom functools import reduce\nP = reduce(mul, c)\nif P>10**18:\n print(-1)\nelse:\n print(P)\nprint(P)', "a = int(input())\nb = [int(i) for i in input().split()]\n\nans =1\nb = sorted(b)\nfor I in b:\n ans = ans*I\n if b[0] == 0:\n ans = 0\n print(0)\n break\n elif ans > 10**18:\n print('-1')\n ans = -1\n break\nif ans >=1:\n print(ans)\n \n \n\n\n\n"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s410056125', 's688830476', 's740829004', 's871173882', 's763996049'] | [21480.0, 23296.0, 23000.0, 23004.0, 21648.0] | [81.0, 2206.0, 2206.0, 2206.0, 80.0] | [180, 224, 229, 223, 262] |
p02658 | u054717609 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n mal=mal*n[i]\n if(mal>=10**18):\n print(-1)\n break\nprint(mal)\n', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n mal=mal*n[i]\n if(mal>=10**18):\n mal=-1\n break\nprint(mal)\n\n \n \n\n \n', 'k=int(input()\nmal=1\na=[] \nfor i in range(1,k+1):\n n=int(input()\n a.append(n) \nfor i in range(0,len(a)-1):\n mal=mal*a[i]\nif(mal<=10**18):\n print(mal)\nelse:\n print(-1) ', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n if(n[i]==0):\n mal=0\n mal=mal*n[i]\n if(mal>10**18):\n mal=-1\n break\nprint(mal)\n\n \n \n', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n if(n[i]==0):\n mal=0\n break\n mal=mal*n[i]\n if(mal>10**18):\n mal=-1\n break\nprint(mal)\n\n \n \n', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n mal=mal*n[i]\n if(mal>10**18and n[i]!=0):\n mal=-1\n break\n if(n[i]==0):\n mal=0\n break\nprint(mal)\n\n \n \n', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n mal=mal*n[i]\n if(mal>10**18and n[i]!=0):\n mal=-1\n break\n if(n[i]==0):\n mal=0\n break\nprint(mal)\n\n \n \n', 'k=int(input())\nmal=1 \nn=list(map(int,input().split()))\n \n \nfor i in range(0,len(n)):\n mal=mal*n[i]\n if(mal>10**18):\n mal=-1\n break\nfor j in range(0,len(n)):\n if(n[j]==0):\n mal=0\nprint(mal) \n \n \n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s192099400', 's364858328', 's479457462', 's514900886', 's837244494', 's866699317', 's956185723', 's102605170'] | [21560.0, 21652.0, 9012.0, 21784.0, 9036.0, 9036.0, 9040.0, 21652.0] | [48.0, 43.0, 25.0, 57.0, 26.0, 23.0, 27.0, 61.0] | [217, 249, 218, 250, 260, 268, 271, 275] |
p02658 | u054798759 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n = int(input())\nans = 1\ns = input()\na = [int(x.strip()) for x in s.split(' ')]\nif 0 in a:\n print(0)\n return\nfor i in range(n):\n ans *= a[i]\n if ans>1000000000000000000:\n print(-1)\n return\nprint ans", "import sys\nn = int(input())\nans = 1\ns = input()\na = [int(x.strip()) for x in s.split(' ')]\nif 0 in a:\n print(0)\n sys.exit()\nfor i in range(n):\n ans *= a[i]\n if ans>1000000000000000000:\n print(-1)\n sys.exit()\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s935042044', 's968595214'] | [9048.0, 23752.0] | [21.0, 56.0] | [208, 229] |
p02658 | u054931633 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nn = int(input())\nl = list(map(int,input().split()))\ncount = 1\nfor i in l:\n count= count*i\nif count >= 10**18:\n print("-1")\n sys.exit()\nprint(count)', 'import sys\nn = int(input())\nl = list(map(int,input().split()))\nl.sort()\ncount = 1\nfor i in l:\n count= count*i\n if count == 0:\n print("0")\n sys.exit()\n elif count > 10**18:\n print("-1")\n sys.exit()\nif count > 10**18:\n print("-1")\n sys.exit()\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s877795203', 's691005470'] | [21772.0, 21472.0] | [2206.0, 80.0] | [175, 296] |
p02658 | u055875839 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nl = list(map(int, input().split()))\n\nans = 1\nfor i in l:\n ans *= i\nif ans >= 10 ** 18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\nl = list(map(int, input().split()))\n \nif 0 in l:\n print(0)\nelse:\n ans = 1\n for i in l:\n ans *= i\n if ans >= 10**18:\n ans = -1\n break\n else:\n continue\n print(ans)', 'n = int(input())\nl = list(map(int, input().split()))\n \nif 0 in l:\n print(0)\nelse:\n ans = 1\n for i in l:\n ans *= i\n if ans >= 10 ** 18:\n print(-1)\n else:\n print(ans)', 'n = int(input())\nl = list(map(int, input().split()))\n \nif 0 in l:\n print(0)\nelse:\n ans = 1\n for i in l:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n else:\n continue\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s182458046', 's333817505', 's975694574', 's745019837'] | [21640.0, 21616.0, 21580.0, 21796.0] | [2206.0, 53.0, 2206.0, 51.0] | [135, 206, 178, 205] |
p02658 | u057415180 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int ,input().split()))\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n', 'n = int(input())\na = list(map(int ,input().split()))\nans = 1\nfor i in a:\n ans *= i\n if ans >= 10**8:\n print(-1)\n break', 'n = int(input())\na = list(map(int ,input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\n if (10**18+1)//ans <= a[i]:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\na = list(map(int ,input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s466328013', 's549971120', 's802304686', 's426329145'] | [21476.0, 21592.0, 21652.0, 21568.0] | [47.0, 47.0, 54.0, 52.0] | [127, 126, 159, 179] |
p02658 | u057942294 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['num_list = list(map(int, input().split()))\n\nnum = 1\n\nfor i in num_list:\n num *= i\n\nif num > 10**18:\n num = -1\n\nprint(num)', 'N = int(input())\n\nnum_list = list(map(int, input().split()))\n \nnum = 1\n \nfor i in num_list:\n num *= i\n \n if num == 0:\n break\n\nif num > 1000000000000000000:\n num = -1\n break\n\nprint(num)', 'def product(list):\n num = 1\n\n if any([i == 0 for i in num_list]):\n print(0)\n return\n \n for i in num_list:\n num *= i\n if num > 1000000000000000000:\n num = -1\n break\n\n print(num)\n\n\nN = int(input())\n\nnum_list = list(map(int, input().split()))\n\nproduct(num_list)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s397553418', 's412012568', 's617077485'] | [9176.0, 9112.0, 21652.0] | [22.0, 23.0, 51.0] | [123, 214, 324] |
p02658 | u057948305 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from functools import reduce\nfrom operator import mul\n\nn = int(input())\n\na = [int(x) for x in input().split()]\n\na = sorted(a)\nans = 1\nfor x in a:\n ans = ans * x\n if (ans > 10*18):\n ans = -1\n break\n\nprint(ans)\n', 'import functools\nimport operator\n\nn = int(input())\n\na = [int(x) for x in input().split()]\n\nans = functools.reduce(operator.mul, a)\nprint(ans)\n\nprint(-1) if ans > 1e18 else print(ans)\n', 'from functools import reduce\nfrom operator import mul\n\nn = int(input())\n\na = [int(x) for x in input().split()]\n\na = sorted(a)\nans = 1\nfor x in a:\n ans = ans * x\n if (ans > 1e18):\n ans = -1\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s491030593', 's731321157', 's716340182'] | [22644.0, 22716.0, 22664.0] | [93.0, 2206.0, 96.0] | [229, 183, 228] |
p02658 | u058264533 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\n\nn = int(input())\na = list(map(int, input().split())) \n\ntotal = 1\n\nfor i in range(n):\n total *= a[i]\n if len(str(total)) >= 18:\n print("-1")\n sys.exit()\n\nprint(total)', 'import sys\n\nn = int(input())\na = list(map(int, input().split())) \n\ntotal = 1\n\nfor i in range(n):\n total *= a[i]\n\nif total > 100000000000000000:\n print("-1")\nelse:\n print(total)', 'import sys\n\nn = int(input())\na = list(map(int, input().split())) \n\ntotal = 1\na_sort = sorted(a)\nif a_sort[0] == 0:\n print("0")\n sys.exit()\n\nfor i in range(n):\n total *= a[i]\n if total > 1000000000000000000:\n print("-1")\n sys.exit()\n\nprint(total)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s385616682', 's535100137', 's456575412'] | [21688.0, 21700.0, 21688.0] | [66.0, 2206.0, 73.0] | [197, 185, 271] |
p02658 | u059331921 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['# cook your dish here\nn=int(input())\na=[int(x) for x in input().split()]\nans=1 \nfor i in range(n):\n ans*=a[i]\n if(ans>=1e18):\n ans=-1 \n break\nprint(ans)', '# cook your dish here\nn=int(input())\na=[int(x) for x in input().split()]\nans=1 \nmod=int(1e18)\nfor i in range(n):\n if a[i]==0:\n ans=0 \n break \nfor i in range(n):\n ans*=a[i]\n if ans>mod:\n ans=-1 \n break \n if ans==0:\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s740711739', 's156406605'] | [21472.0, 21620.0] | [61.0, 71.0] | [172, 279] |
p02658 | u060582659 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\nAnswer = 1\nfor i in range(N):\n Answer *= A[i]\n\nif Answer > pow(10, 18, 1):\n print(-1)\nelse:\n print(Answer)\n', '\nN = int(input())\nA = list(map(int, input().split()))\n\nB = set(A)\nAnswer = 1\nif 0 in B:\n print(0)\n exit()\nfor i in range(N):\n Answer *= A[i]\n if Answer > 1000000000000000000:\n print(-1)\n exit()\nprint(Answer)\n'] | ['Wrong Answer', 'Accepted'] | ['s446326413', 's122780186'] | [21656.0, 21648.0] | [2206.0, 62.0] | [170, 234] |
p02658 | u061518317 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\n\nn=int(input())\n\nm=list(map(int,input().split()))\n\nans=1\nif 0 in m:\n print(0)\n sys.exit()\n\nfor i in range(n):\n ans=ans*m[i]\n print(ans)\n if ans>pow(10,18):\n print(-1)\n sys.exit()\n\n\nif ans <=pow(10,18):\n print(ans)', 'import sys\n\nn=int(input())\n\nm=list(map(int,input().split()))\n\nans=1\nif 0 in m:\n print(0)\n sys.exit()\n\nfor i in range(n):\n ans=ans*m[i]\n print(ans)\n if ans>pow(10,18):\n print(-1)\n sys.exit()\n\n\nif ans <=pow(10,18):\n print(ans)', 'import sys\n\nn=int(input())\nm=list(map(int,input().split()))\n\nans=1\nif 0 in m:\n print(0)\n sys.exit()\n\nfor i in range(n):\n ans=ans*m[i]\n if ans>pow(10,18):\n print(-1)\n sys.exit()\n\nif ans<=pow(10,18):\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s273583123', 's543010834', 's185282952'] | [21588.0, 21648.0, 21796.0] | [105.0, 107.0, 70.0] | [236, 236, 220] |
p02658 | u062484507 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n, *a = map(int, read().split())\nif 0 in a:\n print('0')\n exit()\nans = 1\nfor x in a:\n ans = ans * x\n if ans > 10 ** 18:\n print('-1')\n exit()\nprint(ans)", "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, *a = map(int, read().split())\nif 0 in a:\n print('0')\n exit()\nans = 1\nfor x in a:\n ans = ans * x\n if ans > 10 ** 18:\n print('-1')\n exit()\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s074439821', 's350458189'] | [9092.0, 20116.0] | [22.0, 45.0] | [176, 293] |
p02658 | u063346608 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\n\nx = 1\nfor i in range(len(A)):\n\tx = x * A[i]\n\nif x >= 10 ** 18:\n\tprint("-1")\nelse:\n\tprint(x)', 'N = int(input())\nA = list(map(int,input().split()))\n\nflag = 0\nfor i in range(len(A)):\n\tif A[i]==0:\n\t\tflag =1\n\nif flag == 1 :\n\tprint("0")\nelse:\n\tx = 1\n\tfor i in range(len(A)):\n\t\tx = x * A[i]\n\t\tif x > 10 ** 18:\n\t\t\tbreak\n \n \n\tif x > 10 ** 18:\n\t\tprint("-1")\n\telse:\n\t\tprint(x)'] | ['Wrong Answer', 'Accepted'] | ['s542444934', 's495020057'] | [21664.0, 21564.0] | [2206.0, 64.0] | [144, 283] |
p02658 | u064122548 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['A, B = input().split()\nA = int(A)\nB = int(B)\nprint(A*B)', 'listed = input().split()\nmul = 1\nfor num in listed:\n num = int(num)\n if num == 0:\n mul = 0\n break\n if mul != -1:\n mul *= num\n if mul > 10**18:\n mul = -1\nprint(mul)', 'listed = input().split()\nmul = 1\nfor num in listed:\n num = int(num)\n if num == 0:\n mul = 0\n break\n if mul != -1:\n mul *= num\n if mul > 10**18:\n mul = -1\nprint(mul)', 'listed = input().split()\nmul = 1\nmaxi = 10**18\nfor num in listed:\n num = int(num)\n mul *=num\n if num == 0:\n print(mul)\n if num > maxi**18:\n print(mul)\nprint(mul)', 'listed = input().split()\nmul = 1\nmaxi = 10**18\nfor num in listed:\n num = int(num)\n mul *= num\n if num == 0:\n mul = 0\n break\n if num > maxi**18:\n mul = -1\n break\nprint(mul)', 'listed = input().split()\nmul = 1\nmaxi = 10**18\nfor num in listed:\n num = int(num)\n mul *= num\n if num == 0:\n print(0)\n if num > maxi**18:\n mul = -1\n break\nprint(mul)', 'listed = input().split()\nmul = 1\nfor num in listed:\n num = int(num)\n if num == 0:\n mul = 0\n break\n if mul != -1:\n mul *= num\n if mul > 10**18:\n mul = -1\nprint(int(mul))', 'listed = input().split()\nmul = 1\nmaxi = 10**18\nfor num in listed:\n mul*=num\n if num == 0:\n print(mul)\n if num > maxi**18:\n print(mul)\nprint(mul)', 'listed = input().split()\nmul = 1\nmaxi = 10**18\nfor num in listed:\n num = int(num)\n mul *= num\n if num == 0:\n print(mul)\n if num > maxi**18:\n print(-1)\nprint(mul)', 'listed = input().split()\nmul = 1\nfor num in listed:\n num = int(num)\n if num == 0:\n mul = 0\n break\n if mul != -1:\n mul *= num\n if mul > 10**18:\n mul = -1\nprint(mul)', 'N = input()\nlisted = input().split()\nmul = 1\nfor num in listed:\n num = int(num)\n if num == 0:\n mul = 0\n break\n if mul != -1:\n mul *= num\n if mul > 10**18:\n mul = -1\nprint(mul)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s278027080', 's296774616', 's323718684', 's522358824', 's628808800', 's815891254', 's847157345', 's917195207', 's936358300', 's954456661', 's196935826'] | [9124.0, 9192.0, 9176.0, 9172.0, 9084.0, 9180.0, 9188.0, 9120.0, 9204.0, 9188.0, 19300.0] | [21.0, 22.0, 22.0, 25.0, 27.0, 22.0, 22.0, 25.0, 23.0, 24.0, 57.0] | [55, 183, 183, 171, 187, 178, 188, 153, 171, 183, 195] |
p02658 | u066029197 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=input()\ns=list(map(int,(input().split(" "))))\nans=1\nfor i in s:\n ans*=i\nif ans>1e18:\n print(-1)\nelse:\n print(s)', 'n,*l=map(int,open(0).read().split())\na=1\nfor i in sorted(l):\n a*=i\n if a>10**18: a=-1; break\nprint(a)\n'] | ['Wrong Answer', 'Accepted'] | ['s565773154', 's526596220'] | [21584.0, 21696.0] | [2206.0, 84.0] | [122, 104] |
p02658 | u066120361 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy\nn = int(input())\nls = [int(input()) for _ in range(n)]\nif 0 in ls:\n print(0)\nres = numpy.prod(ls)\nelif res > 10**18:\n print(-1)\nelse:\n print(numpy.prod(ls))\n', 'import numpy\nn = int(input())\nls = list(map(int, input().split()))\nif 0 in ls:\n print(0)\nres = numpy.prod(ls)\nelif res > 10**18:\n print(-1)\nelse:\n print(numpy.prod(ls))\n', 'n = int(input())\nls = list(map(int, input().split()))\nres = 1\nif 0 in ls:\n print(0)\n quit()\nfor x in ls:\n res *= x\n if res > 10**18:\n print(-1)\n quit()\nprint(res)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s091101901', 's670422168', 's442376505'] | [9028.0, 8960.0, 21644.0] | [22.0, 23.0, 53.0] | [179, 178, 188] |
p02658 | u066455063 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in range(n):\n ans *= a[i]\n\nprint(ans if ans < 1000000000000000000 else -1)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s298032655', 's580536069'] | [21588.0, 21812.0] | [2206.0, 53.0] | [146, 212] |
p02658 | u067986264 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\nres = 1\nfor i in a:\n res *= 1\nif res > 10**18:\n print(-1)\nelse:\n print(res)', 'n = int(input())\na = list(map(int, input().split()))\nres = 1\nfor i in a:\n res *= 1\nif i > 10**18:\n print(-1)\nelse:\n print(res)', 'n = int(input())\na = list(map(int, input().split()))\nres = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n res *= a[i]\n if res > 10**18:\n print(-1)\n quit()\n print(res)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s035664776', 's768779940', 's460902252'] | [21648.0, 21704.0, 21712.0] | [53.0, 57.0, 49.0] | [137, 135, 214] |
p02658 | u068538925 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['def main():\n n = int(input())\n in_list = list(map(int,input().split()))\n result = 1\n if in_list.count(0)>0:\n print(0)\n return\n\n for i in range(n):\n result = result*in_list[i]\n if result >= 10**18:\n print(-1)\n return\n print(result)\n\nmain()', 'import numpy as np\nn = int(input())\nin_list = list(map(int,input().split()))\n\np = np.prod(in_list)\nif p<10**18:\n print(p)\nelse:\n print(-1)\n', 'def main():\n n = int(input())\n in_list = list(map(int,input().split()))\n result = 1\n if in_list.count(0)>0:\n print(0)\n return\n\n for i in range(n):\n result = result*in_list[i]\n if result >= 10**18:\n print(-1)\n print(result)\n\nmain()', 'def main():\n n = int(input())\n in_list = list(map(int,input().split()))\n result = 1\n if in_list.count(0)>0:\n print(0)\n return\n\n for i in range(n):\n result = result*in_list[i]\n if result > 10**18:\n print(-1)\n return\n print(result)\n\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s278916034', 's396549573', 's558466801', 's613086365'] | [21424.0, 40200.0, 21552.0, 21740.0] | [64.0, 148.0, 2206.0, 59.0] | [306, 145, 287, 305] |
p02658 | u068862829 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['a = int(input())\nb = input().split()\n\nfor i in range(a):\n if b[i] == 0:\n print(0)\n return\n\nc = 1\nfor i in range(a):\n c = c*int(b[i])\n if c > 1000000000000000000:\n break\n\nif c > 1000000000000000000:\n print(-1)\nelse:\n print(c)', 'a = int(input())\nb = input().split()\nc = 1\nfor i in range(a):\n if int(b[i]) == 0:\n c = 0\n\nif c == 1:\n for i in range(a):\n c = c*int(b[i])\n if c > 1000000000000000000:\n break\n\nif c > 1000000000000000000:\n print(-1)\nelse:\n print(c)'] | ['Runtime Error', 'Accepted'] | ['s009984322', 's867170750'] | [9056.0, 19504.0] | [22.0, 69.0] | [260, 273] |
p02658 | u068944955 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["from math import log10\nN = int(input())\nA = map(int, input().split())\n\nif 0 in A:\n print(0)\n exit()\n\ns = 1\nfor a in A:\n s *= a\n if s > 10 ** 18:\n print('-1')\n exit()\nprint(s)", "from math import log10\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\ns = 1\nfor a in A:\n\n s *= a\n if s > 10 ** 18:\n print('-1')\n exit()\nprint(s)"] | ['Wrong Answer', 'Accepted'] | ['s070307405', 's698481392'] | [19540.0, 22744.0] | [45.0, 49.0] | [200, 207] |
p02658 | u070069212 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = sorted(list(map(int, input().split())))\ns = 1\nif o in a:\n print(0)\n exit()\nfor i in range(n):\n s *= a[i]\n if s>10**18:\n print(-1)\n exit()\nprint(s)', 'n = int(input())\na = list(map(int, input().split()))\nfor i in range(n-1):\n a[i+1]*=a[i]\n print(a[i+1])\nprint(a[i+1] if a[i+1]<=10**18 else -1)\n', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n s *= a[i]\n if s>10**18:\n print(-1)\n exit()\nprint(s)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s273122577', 's665670350', 's998714878'] | [21504.0, 25088.0, 21540.0] | [80.0, 2228.0, 57.0] | [185, 145, 177] |
p02658 | u071916806 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nlist=[int(i) for i in input().split()]\nk=1\nlist.sort()\nx=list[0]\nwhile k<n:\n y=x*list[k]\n x=y\n if y<1000000000000000000:\n k=k+1\n else:\n k=n+1\n y=-1\nprint(y)', 'n=int(input())\nlist=[int(i) for i in input().split()]\nk=1\nlist.sort()\nx=list[0]\nwhile k<n:\n y=x*list[k]\n x=y\n if y<=1000000000000000000:\n k=k+1\n else:\n k=n+1\n y=-1\nprint(y)'] | ['Wrong Answer', 'Accepted'] | ['s166851569', 's864441136'] | [21708.0, 21652.0] | [106.0, 97.0] | [184, 185] |
p02658 | u073788720 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nl=list(map(int,input().split()))\nif min(l)=0:\n print(0)\nelse: \n s=1\n for x in l:\n s *= x\n \n if s>1000000000000000000:\n print(-1)\n else:\n print(s)', 'n=int(input())\nl=list(map(int,input().split()))\nif min(l)== 0:\n print(0)\nelse: \n s=1\n for x in l:\n s *= x\n if s>1000000000000000000:\n s=-1\n break\n \n print(s)', 'n=int(input())\nl=list(map(int,input().split()))\nif min(l)== 0:\n print(0)\nelse: \n s=1\n for x in l:\n s *= x\n if s>10**18:\n s=-1\n break\n print(s) '] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s393229135', 's709784440', 's908790024'] | [8912.0, 8992.0, 21732.0] | [26.0, 28.0, 57.0] | [202, 220, 201] |
p02658 | u073879055 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = 1\nfor i in range(0,n):\n a*=int(input())\n if(a>10**18):\n a=-1\nif(a<0):\n a=-1\nprint(a)', 'n = int(input())\na = 1\ns = list(map(int, input().split()))\nif 0 in s:\n print(0)\n exit()\nfor i in s:\n a*=s[i]\n if a>10**18:\n print(-1)\n exit()\nelse:\n print(a)', 'n = int(input())\na = 1\ns = list(map(int, input().split()))\nif 0 in s:\n print(0)\n exit()\nfor i in s:\n a*=i\n if a>10**18:\n print(-1)\n exit()\nelse:\n print(a)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s529413354', 's860254573', 's668165720'] | [12840.0, 21628.0, 21660.0] | [38.0, 57.0, 55.0] | [121, 186, 183] |
p02658 | u074294554 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nA=list(map(int,input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\nans = 1 \nfor i in range (N):\n ans *= A[i]\n if ans >= 10**18:\n print(-1)\n exit(0)\n \nprint(ans)\n ', 'N=int(input())\nA=list(map(int,input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\nans = 1 \nfor i in range A:\n ans *= i\n if ans >= 10**18:\n print(-1)\n exit(0)\n \nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\n \nans = 1 \nfor i in A:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit(0)\n \nprint(ans)\n \n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s432273119', 's466703037', 's931578018'] | [21740.0, 8972.0, 21664.0] | [57.0, 24.0, 57.0] | [211, 200, 205] |
p02658 | u076566148 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['x = input()\ny = [int(a) for a in input().split(" ")]\nif 0 in y:\n print(0)\n exit(0)\nres = 1\nfor i in y:\n res *= i\n print(res)\n if res > int(1e+18):\n print(-1)\n exit(0)\nprint(res)', 'x = input()\ny = [int(a) for a in input().split(" ")]\nif 0 in y:\n print(0)\n exit(0)\nres = 1\nfor i in y:\n res *= i\n if res > int(1e+18):\n print(-1)\n exit(0)\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s740198794', 's199401939'] | [21640.0, 21768.0] | [84.0, 53.0] | [188, 175] |
p02658 | u077013956 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#include <bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\n\nint main() {\n ll N;\n cin >> N;\n vector<ll> A(N);\n ll result = 1;\n for(int i=0;i<N;i++) {\n cin >> A.at(i);\n }\n\n if(find(A.begin(),A.end(),0) != A.end()) {\n cout << "0" << endl;\n exit(0);\n }\n for(int i=0;i<N;i++) {\n result = result * A.at(i);\n if (result > (ll)pow(10,18)) {\n cout << "-1" << endl;\n exit(0);\n }\n }\n cout << result << endl;\n}', 'N = int(input())\nA = [int(x) for x in input().split()]\n\nif 0 in A :\n print("0")\n exit()\nresult = 1\nfor i in range(N) :\n result *= A[i]\n if result > 10**18 :\n print("-1")\n exit()\n\nprint(result)'] | ['Runtime Error', 'Accepted'] | ['s507317391', 's366789086'] | [8924.0, 21428.0] | [25.0, 58.0] | [504, 218] |
p02658 | u077075933 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#include <bits/stdc++.h>\nusing namespace std;\n \n \nlong long LIMIT = 1000000000000000000;\n \nint main(){\n int n;\n cin >> n;\n vector<long long> vec(n);\n \n for (int i = 0; i < n; i++) {\n cin >> vec.at(i);\n }\n \n if ( std::find(vec.begin(), vec.end(), 0) != vec.end() ) {\n cout << 0 << endl;\n return 0;\n }\n \n long long products = 1;\n for (int i = 0; i < n; i++) {\n products *= vec.at(i);\n\tif(products > LIMIT) {\n cout << -1 << endl;\n return 0;\n }\n }\n \n cout << products << endl;\n \n return 0;', '\nN = int(input())\nA = list(map(int, input().split()))\n\ndef main():\n if(0 in A):\n print(0)\n return\n\n products = 1\n for a in A:\n products *= a\n if(products > 1000000000000000000):\n print(-1)\n return\n print(products)\n return\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s933274289', 's945768611'] | [9016.0, 21644.0] | [22.0, 52.0] | [527, 257] |
p02658 | u078181689 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\narr = list(map(int,input().split()))\narr.sort(reverse=True)\nans = 1\nlimit = 10 * 18\n\nif arr[-1] == 0:\n ans = 0\nelse:\n for i in arr:\n ans *= arr[i]\n if ans > limit:\n ans = -1\n break\nprint(ans)', 'n = int(input())\narr = list(map(int,input().split()))\narr.sort(reverse=True)\nans = 1\nlimit = 10**18\n\nif arr[-1] == 0:\n ans = 0\nelse:\n for i in arr:\n ans *= i\n if ans > limit:\n ans = -1\n break\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s762163398', 's492661934'] | [21424.0, 21472.0] | [95.0, 89.0] | [226, 221] |
p02658 | u078276601 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nnumlist = list(map(int, input().split()))\nif 0 in numlist:\n print(0)\nelse:\n ans = 1\n for i in numlist:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n\tprint(ans)', 'n = int(input())\nnumlist = list(map(int, input().split()))\nif 0 in numlist:\n print(0)\nelse:\n ans = 1\n for i in numlist:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n\tprint(ans)', 'n = int(input())\nnumlist = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n\tprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nif 0 in numlist:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', 'import sys\nn = int(input())\nnumlist = list(map(int, input().split()))\nif 0 in numlist:\n print(0)\nelse:\n ans = 1\n for i in numlist:\n ans *= i\n if ans > 10**18:\n print("-1")\n sys.exit()\n print(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s034576857', 's126091048', 's145239087', 's212332342', 's962303753'] | [8928.0, 9068.0, 8932.0, 21776.0, 21708.0] | [24.0, 25.0, 24.0, 53.0, 59.0] | [223, 223, 211, 210, 243] |
p02658 | u078527650 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n= int(input())\nA = list(map(int, input().split()))\n\nkakeru = A[0]\nfor i in range(n):\n \n temp = A[i]\n kakeru = kakeru*temp\nans = int(kakeru/A[0])\nif ans > 10**18-1:\n print("-1")\nelse:\n print(ans)', 'n= int(input())\nA = list(map(int, input().split()))\n\nzero = 0\nif zero in A:\n print("0")\nelse:\n for i in range(n):\n \n temp = A[i]\n if i ==0:\n kakeru = temp\n else:\n kakeru = kakeru*temp\n if kakeru >10**18:\n kakeru = -1\n break\n \n print(kakeru)\n'] | ['Wrong Answer', 'Accepted'] | ['s700695598', 's254008962'] | [21488.0, 21548.0] | [2206.0, 55.0] | [210, 328] |
p02658 | u079022693 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n):\n ans*=a[i]\n if ans>10**18:\n print(-1)\n break\nelse:\n print(ans)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nans=1\nfor i in range(n):\n ans*=a[i]\n if ans>10**18:\n print(-1)\n break\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s340184749', 's511266602'] | [21656.0, 21784.0] | [80.0, 85.0] | [161, 167] |
p02658 | u079783022 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int,input().split()))\nans = 1\nmark = False\nif 0 in a:\n print(0)\n mark = True\nif mark==False:\n for i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n mark = True\n print(-1)\n break\nif not mark: print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nmark = False\nfor i in range(n):\n if i==0:\n mark = True\n print(0)\n break\n ans *= a[i]\n if ans > 1000000000000000000:\n mark = True\n print(-1)\n break\nif not mark: print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nmark = False\nfor i in range(n):\n if i==0:\n ans = 0\n mark = True\n break\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n mark = True\n break\nif not mark: print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nmark = False\nif 0 in a:\n print(0)\n mark = True\nif mark==False:\n for i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n mark = True\n print(-1)\n break\nif not mark: print(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s607836265', 's643346242', 's696652832', 's267513933'] | [21640.0, 21640.0, 21664.0, 21688.0] | [50.0, 49.0, 49.0, 53.0] | [294, 282, 281, 298] |
p02658 | u080183144 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nA=map(int,input().split())\nans = 1\nif 0 in A:\n print(0)\n exit()\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n', 'N=int(input())\nA=map(int,input().split())\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\nelse:\n print(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nans = 1\nif 0 in A:\n\tprint(0)\n\treturn\nfor a in A:\n \tans *= a\n \tif ans > 1000000000000000000:\n \tprint(-1)\n \treturn\nprint(ans)\n', 'N=int(input())\nA=list(map(int,input().split()))\nans = 1\nif 0 in A:\n\tprint(0)\n\treturn\nelse:\n\tfor a in A:\n \tans *= a\n \tif ans > 1000000000000000000:\n \tprint(-1)\n \treturn\n\tprint(ans)\n', 'def main():\n N=int(input())\n A=list(map(int,input().split()))\n ans = 1\n if 0 in A:\n print(0)\n return\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n return\n print(ans)\n\n main()', 'N=int(input())\nA=list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n return\nelse:\n for a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n return\n print(ans)\n', 'N=int(input())\nA=list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n return\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n return\n print(ans)\n', 'N=int(input())\nA=list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n return\nelse:\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n return\n print(ans)\n', 'def main ():\n\tN = int(input())\n\tA = list(map(int,input(). split ()))\n\tif 0 in A:\n\t\tprint(0)\n\t\treturn\n\tprod = 1\n\tfor a in A:\n\t\tprod *= a\n\t\tif prod > 1000000000000000000:\n\t\t\tprint(-1)\n\t\t\treturn\n\tprint(prod)\nmain ()'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s126435506', 's407723525', 's464778658', 's653154983', 's715956298', 's805274995', 's876108731', 's903693875', 's608840461'] | [19464.0, 19500.0, 8964.0, 8984.0, 9108.0, 9104.0, 9108.0, 9104.0, 21648.0] | [47.0, 45.0, 23.0, 18.0, 23.0, 23.0, 26.0, 22.0, 46.0] | [187, 176, 186, 196, 239, 183, 193, 196, 212] |
p02658 | u080449987 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import functools\n\nn = int(input())\nxs = map(int, input().split())\n\ndef foldSum(acc, x):\n return acc*x\n\nif 0 in xs:\n print(0)\nelif len([x for x in xs if x > 1]) >= 60:\n print(-1)\nelse:\n res = functools.reduce(foldSum, xs, 1)\n\n if res > 1e18:\n print(-1)\n else:\n print(res)\n\n', 'import functools\n\nn = int(input())\nxs = input().split()\n\ndef foldSum(acc, x):\n return acc*int(x)\n\nif 0 in res:\n print(0)\nelse:\n res = functools.reduce(foldSum, xs, 1)\n\n if res > 1e18:\n print(-1)\n else:\n print(res)\n\n', 'import functools\n\nn = int(input())\nxs = list(map(int, input().split()))\n\ndef foldMulti(acc, x):\n return acc*x\n\nif 0 in xs:\n print(0)\nelif len([x for x in xs if x > 1]) >= 60:\n print(-1)\nelse:\n res = functools.reduce(foldMulti, xs, 1)\n\n if res > 1e18:\n print(-1)\n else:\n print(res)\n\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s506655234', 's917388484', 's640536834'] | [20368.0, 20184.0, 22664.0] | [47.0, 40.0, 58.0] | [304, 244, 314] |
p02658 | u081714930 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import functools\nimport operator\nn = int(input())\nnumber = map(int,input().split())\nX = functools.partial(functools.reduce, operator.mul)\ns=X(number)\nif s>=pow(10,18):\n print(-1)\nelse:\n print(s)', 'import functools\nimport operator\n\nn = int(input())\nnumber = map(int,input().split())\nX = functools.partial(functools.reduce, operator.mul)\n\ns=X(number)\nif s>=pow(10,18):\n print(-1)\nelse:\n print(s)', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n\n if 0 in A:\n print(0)\n return\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\nmain()', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n\n if 0 in A:\n print(0)\n return\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s362675935', 's428413790', 's556174241', 's388552330'] | [20748.0, 20644.0, 21528.0, 21708.0] | [2206.0, 2206.0, 51.0, 46.0] | [200, 202, 254, 270] |
p02658 | u085530099 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\ncount = 1\nfor i in a:\n count *= i\nif count > 100000000000000000:\n print(-1)\nelse:\n print(count)\n', 'n = int(input())\na = list(map(int, input().split()))\ncount = 1\nl = 0\nif (0 in a) == True:\n print(0)\nelse:\n for i in a:\n count *= i\n if count > 1000000000000000000:\n l = -1\n break\n if l == 0:\n print(count)\n else:\n print(l)'] | ['Wrong Answer', 'Accepted'] | ['s646963756', 's235007514'] | [21644.0, 21688.0] | [2206.0, 48.0] | [152, 247] |
p02658 | u086127549 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na = list(map(int,input().split()))\nmul = 1\nlarge = 0\nfor x in a:\n mul *= x\n if mul >= 10**18:\n large = 1\n break\nif large:\n print(-1)\nelse:\n print(mul)', 'def f(n, a):\n if 0 in a:\n return 0\n p = 1\n for x in a:\n p *= x\n if p > 10**18:\n return -1\n return p\n\nn = int(input())\na = list(int, input().split())\nprint(f(n, a))', 'def f(n, a):\n if 0 in a:\n return 0\n p = 1\n for x in a:\n p *= x\n if p > 10**18:\n return -1\n return p\n \nn = int(input())\na = list(map(int, input().split()))\nprint(f(n, a))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s004333072', 's767419062', 's297601217'] | [21796.0, 19352.0, 21764.0] | [51.0, 37.0, 51.0] | [175, 181, 187] |
p02658 | u086624329 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(map(int,input().split()))\n\ndef f(x):\n x.sort()\n if x[0]==0:\n return 0\n\n x.sort(reversed=True)\n \n ans=1\n \n for i in a:\n ans=ans*i\n\n if ans>10**18:\n return -1\n \n if n==0:\n return ans\n \n\n\nprint(f(a))', 'n=int(input())\na=list(map(int,input().split()))\n\ndef f(x):\n x.sort()\n if x[0]==0:\n return 0\n\n x.sort(reverse=True)\n \n ans=1\n \n for i in a:\n ans=ans*i\n\n if ans>10**18:\n return -1\n \n return ans\n \n\n\nprint(f(a))'] | ['Runtime Error', 'Accepted'] | ['s166456002', 's668624572'] | [21460.0, 21576.0] | [78.0, 77.0] | [253, 235] |
p02658 | u087470052 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['num = int(input())\n\nstr2 = input().split(" ")\nnums = [int(s) for s in str2]\n\nisOdd = num%2 == 1\navailable = range(len(nums))\n\nwhile available > 1:\n for i in range(available / 2)\n nums[i] = nums[2 * i] * nums[2 * i + 1]\n if(ans > 1000000000000000000):\n print(-1)\n quit()\n if isOdd:\n nums[available / 2 + 1] = nums[-1]\n available //= 2\n if isOdd:\n available += 1\n if a == 0:\n print(0)\n quit()\nprint(ans)\nquit()', 'num = int(input())\nstr2 = input().split(" ")\nnums = [int(s) for s in str2]\nnums.sort()\n\nfor i in range(len(nums)):\n ans = ans * nums[i]\n if(ans > 1000000000000000000):\n print(-1)\n quit()\nprint(ans)\nquit()', 'while available > 1:\n for i in range(available / 2):\n nums[i] = nums[2 * i] * nums[2 * i + 1]\n if(ans > 1000000000000000000):\n print(-1)\n quit()\n if isOdd:\n nums[available / 2 + 1] = nums[-1]\n available //= 2\n if isOdd:\n available += 1\n if a == 0:\n print(0)\n quit()\nprint(ans)\nquit()', 'num = int(input())\nstr2 = input().split(" ")\nnums = [int(s) for s in str2]\nnums.sort()\n\nans = 1\n\nfor i in range(len(nums)):\n ans = ans * nums[i]\n if(ans > 1000000000000000000):\n print(-1)\n quit()\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s370412712', 's417771089', 's503916521', 's294833015'] | [9040.0, 21740.0, 9012.0, 21968.0] | [23.0, 81.0, 23.0, 97.0] | [475, 224, 350, 226] |
p02658 | u088475928 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\na=list(map(int,input().split()))\na.sort()\na.reverse()\nif a.count(0)>0:\n print(0)\nelse:\n ans=a[0]\n flag=0\n for i in range(1,N):\n ans*=a[i]\n if ans>10**18:\n flag+=1\n print(-1)\n break\n ', 'import numpy as np\nN=int(input())\np=[int(input()) for i in range(N)]\nx=np.prod(p)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN = int(input())\np = list(map(int, input().split()))\nif np.prod(p) < 10**18:\n print(np.prod(p))\nelse:\n print("\'-1\'")', 'import numpy as np\nN=int(input())\np=list(map(int,input().split()))\nx=np.prod(p,axis=1)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN=int(input())\np=list(map(int,input().split()))\nx=np.prod(p)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN = int(input())\np = list(map(int, input().split()))\nif np.prod(p) < 10**18:\n print(np.prod(p))\nelse:\n print("-1")', 'import numpy as np\nN = int(input())\np = list(map(int, input().split()))\nif np.prod(p) < 10**18:\n print(np.prod(p))\nelse:\n print(-1)\n', 'N=int(input())\np=list(map(int,input().split()))\nx=0\nfor i in range(len(p)):\n x=x*i\nif x<10**18:\n print(x)\nelse:\n print(-1)\n ', 'import numpy as np\nN=map(int,input().split())\np=list(map(int,input().split()))\nx=np.prod(p)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN=map(int,input().split())\np=list(map,input().split())\nx=np.prod(p)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN=int(input())\nlista=[]\np=input().split()\nfor i in range(N):\n print(p[i])\n lista.append(p[i])\nif np.prod(lista)<10**18:\n print(np.prod(lista))\nelse:\n print(-1)\n', 'import numpy as np\nN=int(input())\np=list(int,input().split())\nx=np.prod(p)\nif x<10**18:\n print(x)\nelse:\n print(-1)', 'import numpy as np\nN = int(input())\np = list(map(int, input().split()))\nif np.prod(p) < 10**18:\n print(np.prod(p))\nelse:\n print(-1)\n', 'N=int(input())\na=list(map(int,input().split()))\na.sort()\na.reverse()\nif a.count(0)>0:\n print(0)\nelse:\n ans=a[0]\n flag=0\n for i in range(1,N):\n ans*=a[i]\n if ans>10**18:\n flag+=1\n print(-1)\n break\n if flag==0:\n print(ans)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s080379341', 's110779443', 's126465475', 's182648481', 's275998728', 's289067711', 's299483578', 's341988432', 's382438652', 's509680462', 's539573198', 's773589095', 's942417984', 's708393306'] | [21680.0, 31696.0, 39892.0, 39992.0, 40304.0, 40000.0, 40128.0, 21780.0, 40060.0, 37584.0, 52372.0, 37856.0, 40128.0, 21476.0] | [78.0, 128.0, 137.0, 137.0, 133.0, 145.0, 145.0, 57.0, 134.0, 118.0, 188.0, 123.0, 146.0, 78.0] | [227, 123, 141, 128, 121, 139, 138, 128, 133, 128, 183, 116, 138, 249] |
p02658 | u088553842 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n = int(input())\nmul = 1\nfor i in range(n):\n ai = int(input())\n mul = mul * ai\n if mul > 10 ** 18:\n print('-1')\n exit()", "n = int(input())\nlst = list(map(int, input().split()))\nmul = 1\nthr = 10 ** 18\nif 0 in lst:\n print('0')\n exit()\nfor i in range(n):\n mul = mul * lst[i]\n if mul > thr:\n print('-1')\n exit()\nprint(mul)"] | ['Runtime Error', 'Accepted'] | ['s789633108', 's146884987'] | [12720.0, 21464.0] | [32.0, 49.0] | [128, 206] |
p02658 | u088989565 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\nif(ans > 10**8):\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\nflag = 0\nif(0 in A):\n print(0)\nelse:\n for i in range(N):\n if(ans*A[i] > 10**18):\n flag = 1\n break\n else:\n ans *= A[i]\n if(flag == 1):\n print(-1)\n else:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s298360330', 's789894880'] | [21712.0, 21784.0] | [2206.0, 53.0] | [141, 255] |
p02658 | u089121621 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nargList =list(map(int, input().split())) \nret = 1\nfor i in argList:\n ret = ret*i\n if ret >= 10**18 :\n ret = -1\n break\nprint(ret)', 'n = int(input())\nargList =list(map(int, input().split())) \nret = 1\nif 0 in argList:\n ret = 0\nelse:\n\n for i in argList:\n ret = ret*i\n if ret > 10**18 :\n ret = -1\n break\nprint(ret)'] | ['Wrong Answer', 'Accepted'] | ['s322246825', 's406244458'] | [21624.0, 21736.0] | [46.0, 52.0] | [165, 220] |
p02658 | u090068671 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["from functools import reduce\nfrom operator import mul\nN = input()\nA = map(int, input().split())\nres = reduce(mul, A)\nif res < 10**18:\n\tprint(res)\nelse:\n\tprint('-1')", 'from functools import reduce\nfrom operator import mul\nN = input()\nA = map(int, input().split())\nres = reduce(mul, A)\nif res < 10**18:\n\tprint(res)\nelse:\n\tprint(-1)', "N = int(input())\nA = input().split()\nif '0' in A:\n\tprint(0)\nelse:\n\tcutoff = 10**18\n\tres = 1\n\tfor n in range(N):\n\t\tres *= int(A[n])\n\t\tif res > cutoff:\n\t\t\tres = '-1'\n\t\t\tbreak\n\tprint(res)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s248308006', 's637728157', 's512107786'] | [20576.0, 20444.0, 19436.0] | [2206.0, 2206.0, 53.0] | [164, 162, 184] |
p02658 | u090406054 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(int(input()))\nans=1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print(-1)\n exit()\n print(ans)\n \n \n \n \n ', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print(-1)\n exit()\n print(ans)\n '] | ['Runtime Error', 'Accepted'] | ['s208396287', 's964545827'] | [12660.0, 21712.0] | [36.0, 60.0] | [190, 180] |
p02658 | u092061507 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = map(int,input().split())\nret = 1\nif 0 in A:\n print(0)\n exit()\nfor i in A:\n ret *= i\n if ret > 10**18:\n ret = -1\n break\nprint(ret)\n', 'N = int(input())\nA = list(map(int,input().split()))\nret = 1\nif 0 in A:\n print(0)\n exit()\n\nfor i in A:\n ret *= i\n if ret > 10**18:\n ret = -1\n break\nprint(ret)\n'] | ['Wrong Answer', 'Accepted'] | ['s300646240', 's332991168'] | [19488.0, 21524.0] | [47.0, 55.0] | [177, 184] |
p02658 | u092860766 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nl = list(map(int,input().split()))\ns=1\nif 0 in l:\n print(0)\nelse:\n for i in l:\n s*=i\n print(s)\n if s>10**18:\n s=-1\n break\n print(s)', 'n=int(input())\nl = list(map(int,input().split()))\ns=1\nif 0 in l:\n print(0)\nelse:\n for i in l:\n s*=i\n if s>10**18:\n s=-1\n break\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s232633037', 's074202522'] | [21788.0, 21708.0] | [76.0, 49.0] | [198, 181] |
p02658 | u094092794 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["import sys \n\ninput=sys.stdin.readline \n\ndef main():\n\tn=int(input().strip())\n\ta=list(map(int,input().strip().split()))\n\tresult =1\n\tLIMIT =10**18\n\tif 0 in a:\n\t\tprint(0)\n\t\tsys.exit\n\tfor i in a:\n\t\tresult *=i\n\t\tif result >LIMIT:\n\t\t\tprint(-1)\n\t\t\tsys.exit()\n\t\tprint(result)\n\nif __name__=='__main__':\n\tmain()", '\nimport sys\ninput = sys.stdin.readline\n\ndef main():\n n = int(input().strip())\n a = list(map(int, input().strip().split()))\n result = 1\n LIMIT = 10**18\n if 0 in a:\n print(0)\n sys.exit()\n for i in a:\n result *= i\n if result > LIMIT:\n print(-1)\n sys.exit()\n print(result)\n\nmain()'] | ['Wrong Answer', 'Accepted'] | ['s132820337', 's228806412'] | [21652.0, 21488.0] | [69.0, 48.0] | [300, 305] |
p02658 | u094102716 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['a = int(input())\nb = list(map(int,input().split()))\nc = 1\nif 0 in b:\n print(0)\nelse:\n for i in range(a):\n c = c * b[i]\n if c > 10 ** 18:\n break\n if c > 10 ** 18:\n print(-1)\n else:\n print(c)\n', 'a = int(input())\nb = list(map(int,input().split()))\nc = 1\nif 0 in b:\n print(0)\nelse:\n for i in range(a):\n c = c * b[i]\n if c > 10 ** 18:\n break\n if c > 10 ** 18:\n print(-1)\n else:\n print(c)\n'] | ['Wrong Answer', 'Accepted'] | ['s602731866', 's039518496'] | [21640.0, 21464.0] | [76.0, 53.0] | [219, 211] |
p02658 | u094999522 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n,*a=map(int,open(0).read().split())\na.sort()\nfor i in a:\n s *= i\n if s > 1e18:\n print(-1)\n exit()\nprint(s)', 'n,*a=map(int,open(0).read().split())\ns=1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n s*=i\n if s >= 10**18:\n print(-1)\n exit()\nprint(s)', 'n,*a=map(int,open(0).read().split())\ns=1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n s*=a\n if s > 10**18:\n print(-1)\n exit()\nprint(s)', 'n,*a=map(int,open(0).read().split())\na.sort()\ns=1\nfor i in a:\n s *= i\n if s > 1e18:\n print(-1)\n exit()\nprint(s)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s048744711', 's351017586', 's521993504', 's655484349'] | [21716.0, 21708.0, 21640.0, 21668.0] | [73.0, 44.0, 44.0, 85.0] | [127, 155, 158, 131] |
p02658 | u095403885 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["def main():\n N = int(input('数字を入力して下さい'))\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n total = 1\n for a in A:\n total *= a\n if total > 10 ** 18:\n print(-1)\n return\n\n print(total)\n\n\nmain()", "M = int(input())\nN = input().split(' ')\nif '0' in N:\n print(0)\nelse:\n check = False\n total = 0\n f = 0\n N = [int(i) for i in N]\n for i in N:\n if i == 0:\n continue\n total += len(str(i))-1\n if i / 10 ** (len(str(i)) - 1) != 1:\n f += i / 10 ** (len(str(i)) - 1)\n if total + len(str(f)) > 18:\n check = True\n break\n\n\n if check:\n print(-1)\n else:\n base = N.pop(0)\n for i in N:\n if i == 1:\n continue\n base *= i\n print(base)", 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n total = 1\n for a in A:\n total *= a\n if total > 10 ** 18:\n print(-1)\n return\n\n print(total)\n\n\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s175876273', 's790029954', 's075316703'] | [21664.0, 21612.0, 21644.0] | [48.0, 130.0, 48.0] | [299, 576, 267] |
p02658 | u096147269 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = input()\nM = list(map(int,input().split()))\n \nmult = 1\n \nif 0 in A:\n print(0)\n return\n\nfor a in M:\n mult *= a\n if mult> 1000000000000000000:\n print(-1)\n \nprint(mult)', 'def main():\n N = input()\n M = list(map(int,input().split()))\n \n mult = 1\n \n if 0 in M:\n print(0)\n return\n \n for a in M:\n mult *= a\n if mult>10**18:\n print(-1)\n return\n \n print(mult)\n \nmain()'] | ['Runtime Error', 'Accepted'] | ['s529751696', 's969708701'] | [8952.0, 21608.0] | [24.0, 58.0] | [193, 277] |
p02658 | u096294926 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nA.sort()\ntotal = 1\nfor i in range(N):\n total *= A[i]\n if 10 ** 18 < total:\n break\n\nif 10**18 < total:\n print("-1")\nelse:', 'N = int(input())\nA = list(map(int,input().split()))\ntotal = 1\nif 0 < A.count(0):\n print(0)\nelse:\n for i in range(N):\n total *= A[i]\n if 10 ** 18 < total:\n break\n if 10**18 < total:\n print("-1")\n else:\n print(total)'] | ['Runtime Error', 'Accepted'] | ['s494867764', 's804352940'] | [9036.0, 21788.0] | [21.0, 53.0] | [188, 265] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.