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
u846117356
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 = input().split(' ')\ndef doit(a):\n m = 1\n for ai in a:\n \tif m > 10**18:\n return -1\n m = m*a\n \n return m\n\ndoit(a)", "\nn = int(input())\na = list(input().split(' '))\n# print(n, a)\ndef doit(n,a):\n m = 1\n for i in range(n):\n m = m*int(a[i])\n if m > 1000000000000000000:\n for y in range(i+1, n):\n if a[y] == '0':\n return 0\n return -1\n elif m==0:\n return 0\n\n# if m > 1000000000000000000:\n# return -1\n return m\n \nprint(doit(n,a))\n"]
['Runtime Error', 'Accepted']
['s816079917', 's829531451']
[9020.0, 19540.0]
[23.0, 43.0]
[139, 371]
p02658
u848535504
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 if ans >= 10**18:\n ans = -1\n break\n \nprint(ans)\n ', 'N = int(input())\nA = list(map(int,input().split()))\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >= 10**18:\n ans = -1\n break\n \nif 0 in A:\n print(0)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int,input().split()))\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >= 10**18:\n ans = -1\n break\n \nif 0 in A:\n print(0)\nelse:\n print(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)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s458176738', 's504216551', 's712221407', 's795153082']
[21608.0, 21568.0, 21596.0, 21596.0]
[59.0, 59.0, 57.0, 63.0]
[157, 182, 182, 197]
p02658
u848647227
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())\nar = list(map(int,input().split(" ")))\nb = 1\nfor r in ar:\n b *= r\n if b >= 10 ** 18:\n print(-1)\n exit()\nprint(b)', 'a = int(input())\nar = list(map(int,input().split(" ")))\nif 0 in ar:\n print(0)\n exit()\nb = 1\nfor r in ar:\n b *= r\n if b > 10 ** 18:\n print(-1)\n exit()\nprint(b)']
['Wrong Answer', 'Accepted']
['s738739401', 's790843384']
[21620.0, 21684.0]
[48.0, 48.0]
[137, 184]
p02658
u848680818
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 =[ [int(c) for c in l.split()] for l in sys.stdin]\na =a[0]\nm = 1\n\nif (0 in a)==True:\n m=0\nelse:\n for i in range(n):\n m=m*a[i]\n if m>10**18:\n m=-1\n break\n', 'import sys\nn = int(input())\na =[ [int(c) for c in l.split()] for l in sys.stdin]\na =a[0]\nm = 1\n\nfor i in range(n):\n m=m*a[i]\n\nif m<10**18:\n print(m)\nelse:\n print(-1)', 'import sys\nn = int(input())\na =[ [int(c) for c in l.split()] for l in sys.stdin]\na =a[0]\nm = 1\n\nif (0 in a)==True:\n m=0\nelse:\n for i in range(n):\n m*=a[i]\n if m>10**18:\n m=-1\n break\n\nprint(m)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s102592805', 's638974585', 's602008674']
[23496.0, 23476.0, 23572.0]
[54.0, 2206.0, 53.0]
[189, 165, 197]
p02658
u849341325
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 = ans * A[i]\n\nif ans >= 1e+18:\n print(-1)\nelse:\n print(ans)', 'N = input()\nA = list(map(int,input().split()))\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n\nif ans >= 1e+18:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nA.sort()\n\nans = 1\n\nfor i in range(N):\n if A[i] == 0:\n ans = 0\n break\n ans = ans * A[i]\n if ans > 1e+18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s317842382', 's995555300', 's867455090']
[21624.0, 21656.0, 21648.0]
[2206.0, 50.0, 84.0]
[147, 137, 199]
p02658
u851125702
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=list(map(int,input().split()))\nA=sorted(A,reverse=True)\nif(A[-1]==0):\n print(0)\nelse:\n ans=1\n flag=0\n for i in range(N):\n ans=ans*A[i]\n if(ans>10**18):\n flag=1\n break\n if(flag==0):\n print(ans)\n else:\n print(-1)', 'N=int(input())\nA=list(map(int,input().split()))\nA=sorted(A,reverse=True)\nif(A[-1]==0):\n print(0)\nelse:\n ans=1\n flag=0\n for i in range(N):\n ans=ans*A[i]\n if(ans>10**18):\n flag=1\n break\n if(flag==0):\n print(ans)\n else:\n print(-1)']
['Runtime Error', 'Accepted']
['s676148693', 's973205132']
[9208.0, 21788.0]
[25.0, 80.0]
[280, 295]
p02658
u851319680
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 as np\nn = int(input())\na = list(map(int, input().split()))\nans = np.prod(a)\nif ans // 10**18 == 0:\n print(ans)\nelse:\n print(-1)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\nelse: \n for i in a:\n ans*=i\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n \n']
['Wrong Answer', 'Accepted']
['s074355404', 's175528362']
[40168.0, 21712.0]
[149.0, 50.0]
[142, 184]
p02658
u851469594
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 = [int(a) for a in input().split()]\n\nans = 1\n\nif 0 in A:\n print(0)\n exit():\n\nfor i in range(len(A)):\n if ans > 10 ** 18:\n print(-1)\n exit()\n ans *= A[i]\n\n\nif ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'N = input()\nA = [a for a in input().split()]\n\nans = 1\n\nfor i in range(len(A)):\n if ans > 10 ** 18:\n print(-1)\n exit()\n ans *= A[i]\n\nprint(ans)', 'N = input()\nA = [int(a) for a in input().split()]\n\nans = 1\n\nfor i in range(len(A)):\n ans *= A[i]\n print(A[i])\n\n\nif ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'N = input()\nA = [int(a) for a in input().split()]\n\nans = 1\n\nif 0 in A:\n print(0)\n exit:\n\nfor i in range(len(A)):\n if ans > 10 ** 18:\n print(-1)\n exit()\n ans *= A[i]\n\n\nif ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'N = input()\nA = [int(a) for a in input().split()]\n\nans = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(len(A)):\n if ans > 10 ** 18:\n print(-1)\n exit()\n ans *= A[i]\n\n\nif ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s132793911', 's141346551', 's484043417', 's529627940', 's124798874']
[9012.0, 19216.0, 21796.0, 9024.0, 21652.0]
[24.0, 44.0, 2206.0, 21.0, 52.0]
[249, 162, 172, 247, 248]
p02658
u852798899
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\nflag = True\nfor i in a:\n ans *= i\n if ans >= 10**18:\n print(-1)\n flag = False\n break\n\nif flag:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in a:\n ans *= i\n \nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\nlimit = 10**18\nans = 1\n\n\n\n\nflag = True\n\nif 0 in a:\n print(0)\n flag = False\n\nif flag:\n for i in a:\n ans *= i\n if ans >= limit:\n print(-1)\n flag = False\n break\n\nif flag:\n print(ans)\n \n ', 'n = int(input())\na = list(map(int, input().split()))\nlimit = 10**18\nans = 1\n\n\n\n\nflag = True\n\nif 0 in a:\n print(0)\n flag = False\n\nif flag:\n for i in a:\n ans *= i\n if ans > limit:\n print(-1)\n flag = False\n break\n\nif flag:\n print(ans)\n \n ']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s110048904', 's234770675', 's957278982', 's425198504']
[21572.0, 21516.0, 21732.0, 21464.0]
[56.0, 2206.0, 59.0, 61.0]
[180, 136, 263, 262]
p02658
u853728588
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()\ntotal = 1 \nfor i in range(n):\n total * = a[i]\n if total > 10 ** 18:\n ans = -1\n break\nprint(total)\n\n', 'n = int(input())\na = list(map(int, input().split()))\ntotal = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n total* = a[i]\n if total > 10** 18\n print(-1)\n break\nprint(total)\n \n \n', 'n = int(input())\na = list(map(int, input().split()))\n \nif 0 in a:\n print(0)\n exit()\ntotal = 1 \nfor i in range(n):\n total * = a[i]\n if total > 10 ** 18:\n print(-1)\n break\n \nprint(total)', 'n = int(input)\nl = list(map(int, inpupt().split()))\nif 0 in l:\n print(0)\n exit()\ntotal = 1\nfor i in range(n):\n total *= l[i]\n if total > 10 ** 18:\n total = -1\n break\nprint(total)', 'n = int(input())\na = list(map(int, input().split()))\n \nif 0 in a:\n print(0)\n exit()\ntotal = 1 \nfor i in range(n):\n total * = a[i]\n if total > 10 ** 18:\n \tprint(-1)\n \tbreak\nprint(total)', 'n = int(input())\na = list(map(int, input().split()))\ntotal = 1\n \nif 0 in a:\n print(0)\n exit()\n \nfor i in range(n):\n total* = a[i]\n if total > 10 ** 18:\n print(-1)\n break\nprint(total)\n ', 'n = int(input())\na = list(map(int, input().split()))\ntotoal = 1\nfor i in a:\n total = total * a\n if total > 10**18:\n print("-1")\n\nprint(total)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit()\ntotal = 1 \nfor i in range(n):\n total* = a[i]\n if total > 10 ** 18:\n print(-1)\n break\nprint(total)\n \n', 'N = int(input())\nA = list(map(int, input().split()))\n \ndef solve():\n if 0 in A:\n return 0\n m = 1\n for a in A:\n m *= a\n if m > 10**18:\n return -1\n return m\n \nprint(solve())']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s008595157', 's028340840', 's183239500', 's245921760', 's258609003', 's443749876', 's660274547', 's842701763', 's080718780']
[8944.0, 9024.0, 8964.0, 9028.0, 8980.0, 8924.0, 21708.0, 8900.0, 21524.0]
[26.0, 26.0, 24.0, 26.0, 25.0, 23.0, 57.0, 28.0, 54.0]
[189, 198, 195, 188, 190, 191, 147, 190, 215]
p02658
u854117336
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\nkosuu = int(input())\narr = list(map(int, input().split()))\n\nhoge =1\nfor num in arr:\n hoge = hoge*num\n if hoge>=10**18:\n print(-1)\n kosuu=0\n break\n\nif kosuu>0:\n print(hoge)\n', 'import math\n\narr = list(map(int, input().split()))\n\nhoge =1\nfor num in arr:\n hoge = hoge*num\n\nif hoge <= 10**18:\n print(hoge)\nelse:\n print(-1)\n', 'import math\n\nkosuu = int(input())\narr = list(map(int, input().split()))\n\nhoge =1\n\nif 0 in arr:\n print(0)\n\nelse:\n for num in arr:\n hoge = hoge*num\n if hoge>1000000000000000000:\n print(-1)\n kosuu=0\n break\n if kosuu>0:\n print(hoge)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s176777862', 's938742456', 's625800711']
[22508.0, 9176.0, 22708.0]
[50.0, 24.0, 49.0]
[215, 152, 292]
p02658
u855831834
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.
['#B\nimport numpy as np\nimport sys\nn = int(input())\nA = np.array(list(map(int,input().split())))\nans = 1\nflag = True\nfor i in A:\n if flag:\n ans *= i\n if ans > 10**18:\n ans = -1\n flag = False\n else:\n if i == 0:\n ans = 0\nprint(ans)\n', '#B\nimport numpy as np\nimport sys\nn = int(input())\nA = np.array(list(map(int,input().split())))\nans = 1\nflag = True\nfor i in A:\n if flag:\n\t ans *= i\n\t\tif ans > 10**18:\n \t\tans = -1\n flag = False\n\telse:\n\t\tif i == 0:\n ans = 0\nprint(ans)\n', 'import numpy as np\nN = int(input())\nA = list(map(int,input().split()))\nA.sort()\nans = 1\n\nfor i in A:\n ans *= i\n if ans > 10**18:\n ans = -1\n print(ans)\n break\nelse:\n print(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s225869294', 's329019527', 's545574432']
[9040.0, 9028.0, 40104.0]
[21.0, 22.0, 175.0]
[280, 262, 206]
p02658
u855967722
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 return\n\ncount = 1\nfor i in A:\n count *= i\n if count > 10000000000000000000:\n print(-1)\n return\n\nprint(count)\n', 'N = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\n return\n\ncount = 1\nfor i in A:\n count *= a\n if count > 10000000000000000000:\n print(-1)\n return\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\nc = 1\nfor i in a:\n c = c*i\n \nif c >= 1E18:\n print(-1)\nelse:\n print(c)', 'N = int(input())\nA = list(map(int,input().split()))\n\ndef main():\n if 0 in A:\n print(0)\n return\n \n count = 1\n for i in A:\n count *= i\n if count > 1e18:\n print(-1)\n return\n \n print(count)\n\nmain()\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s063415742', 's091315662', 's354858267', 's776914642']
[8948.0, 9128.0, 21716.0, 21660.0]
[24.0, 22.0, 2206.0, 49.0]
[194, 193, 126, 220]
p02658
u856564576
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(" ")]\nmul = 1\n\nfor a in A:\n if(a == 0):\n mul = 0\n break\n mul *= a\n if(mul > 1e18):\n mul = -1\n break\n\nprint(-1)', 'n = int(input())\nA = [int(x) for x in input().split(" ")]\nmul = 1\n\nfor a in A:\n if(a == 0):\n mul = 0\n break\n mul *= a\n if(mul > 1e18):\n mul = -1\n\nprint(-1)', 'N = int(input())\nA = list(map(int,input(). split ()))\n\n\nprod = 1\nfor a in A:\n if a == 0:\n prod = 0\n prod *= a\n if prod > 1000000000000000000:\n prod = -1\n\nprint(prod)', 'n = int(input())\nA = [int(x) for x in input().split(" ")]\nmul = 1\n\nfor a in A:\n if(a == 0):\n mul = 0\n break\n mul *= a\n if(mul > 1e18):\n break\n\nprint(-1 if mul >= 1e18 else mul)\n', 'n = int(input())\nA = [int(x) for x in input().split(" ")]\nmul = 1\n\nfor a in A:\n if(a == 0):\n mul = 0\n break\n mul *= a\n\nprint(-1 if mul >= 1e18 else mul)\n', 'def main():\n n = int(input())\n A = [int(x) for x in input().split()]\n if 0 in A:\n print(0)\n return\n\n mul = 1\n for a in A:\n mul *= a\n\n if mul > 1e18:\n print(-1)\n return\n\n print(mul)\n\n\nmain()']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s167523283', 's393505750', 's447324788', 's596295930', 's940078307', 's064143450']
[21660.0, 21592.0, 8872.0, 21652.0, 21512.0, 21592.0]
[61.0, 2206.0, 25.0, 58.0, 2206.0, 61.0]
[199, 185, 172, 207, 173, 257]
p02658
u857147058
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()))\nmax = 10 ** 18\nres = 0\n\nfor i in range(n):\n res *= a[i]\n if res > max:\n print(-1)\n exit(0)\n\nprint(res)', 'n = int(input())\na = list(map(int, input().split()))\nmax = 10 ** 18\nres = 0\n\nfor i in range(n):\n res *= a[i]\n if res > max:\n print(-1)\n sys.exit()\n\nprint(res)', 'import sys\nn = int(input())\na = list(map(int, input().split()))\nlimit = 10 ** 18\nres = 1\n\nif 0 in a:\n print(0)\n sys.exit()\n\nfor i in range(n):\n res *= a[i]\n if res > limit:\n print(-1)\n sys.exit()\n\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s037543163', 's365501789', 's984353439']
[21640.0, 21656.0, 21588.0]
[65.0, 63.0, 51.0]
[175, 178, 233]
p02658
u857605629
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 = sorted(a)\nprod = 1\nfor x in a:\n prod *= x\n if prod > 10**18:\n prod = -1\n break\nprint(prod)', 'n = int(input())\na = list(map(int,input().split()))\na = sorted(a)\nprod = 1\nfor x in a:\n\tprod *= x\n\tif prod > 10**18:\n\t\tprod = -1\n\t\tbreak\nprint(prod)']
['Runtime Error', 'Accepted']
['s173266124', 's577000500']
[9188.0, 21652.0]
[23.0, 79.0]
[152, 148]
p02658
u857673087
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\n\nfor i in A:\n ans = i *ans\n if ans > 10**18:\n print(-1)\n break\n \n print(ans)\n\nif ans < 10**18:\n print(ans)', 'N = int(input())\nA =list(map(int,input().split()))\n\nans =1\n\nfor i in A:\n ans = i *ans\n if ans > 10**18:\n print(-1)\n break\n \n print(ans)', 'N = int(input())\nA =[map(int,input().split())]\n\nans =1\n\nfor i in A:\n ans = i *ans\n if ans > 10**18:\n break\n print(-1)\n\nprint(ans)', 'N = int(input())\nA =list(map(int,input().split()))\n\nans =1\n\nfor i in A:\n ans = i *ans\n if ans > 10**18:\n print(-1)\n break\n \n print(ans)\n\nif ans < 10**18:\n print(ans)', 'N = int(input())\nA =list(map(int,input().split()))\n\nans =1\n\nfor i in A:\n ans = i *ans\n if ans > 10**18:\n print(-1)\n break\n\nif ans < 10**18:\n print(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nlimit = 10 ** 18\nA.sort()\nresult = A[0]\nfor a in A[1:]:\n result *= a\n if result > limit:\n print(-1)\n exit()\nprint(result)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s164591072', 's251944591', 's286724334', 's387636826', 's692920442', 's577834422']
[21660.0, 21704.0, 19336.0, 21792.0, 21792.0, 21652.0]
[54.0, 50.0, 34.0, 43.0, 50.0, 91.0]
[178, 147, 137, 178, 161, 183]
p02658
u859059120
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())\nseq=list(map(int,input().split()))\np=1\nf=1\nfor i in range(n):\n p*=seq[i]\n if(p>=10**18):\n print(-1)\n f=0\n break\nif f==1:\n print(p)\n', 'n=int(input())\nseq=list(map(int,input().split()))\np=1\nf=1\nfor i in range(n):\n\tp*=seq[i]\n if(p>=10**18):\n\t\tprint(-1)\n f=0\n break\nif f==1:\n print(p)\n \n\t', 'n=int(input())\nseq=list(map(int,input().split()))\np=1\nf=1\nc=int(1e18)\nif 0 in seq:\n print(0)\nelse:\n for i in range(n):\n p*=seq[i]\n if p>c:\n print(-1)\n f=0\n break\n \n if f==1:\n print(p)\n\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s463017196', 's815966786', 's701033762']
[21592.0, 9028.0, 21772.0]
[48.0, 21.0, 51.0]
[174, 174, 259]
p02658
u862959195
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 as np\n\nN=int(input())\nA=list(map(int,input().split()))\n\nans=np.prod(A)\n\nif ans >= 10**18:\n\tprint(-1)\n\t\nelse:\n\tprint(ans)', 'import numpy as np\n\nN=int(input())\nA=list(map(int,input().split()))\n\nans=np.prod(A)\n\nif ans >= 10**18:\n\tprint("-1")\n\t\nelse:\n\tprint(ans)', 'import numpy as np\n\nN=int(input())\nA=list(map(int,input().split()))\n\nans=np.prod(A)\n\nif ans >= 10**17:\n\tprint(-1)\n\t\nelse:\n\tprint(ans)', 'import numpy as mul\nimport math\n\nN=int(input())\nA=[]\nfor i in range(N):\n\tA.append(list(map(int,input().split())))\n\n\nans=mul.prod(pyA)\n\n\nif int(math.log10(ans)) > 17:\n\tprint("-1")\n\t\nelse:\n\tprint(ans)', 'import numpy as np\n\nN=int(input())\nA=list(map(int,input().split()))\n\n\nans=np.prod(A)\n\n\nif ans > 10**18\n\tprint("-1")\n\t\nelse:\n\tprint(ans)', 'import numpy as np\n\nN=int(input())\nA=list(map(int,input().split()))\n\nans=np.prod(A)\n\nif ans >= 10**18:\n\tprint(-1)\n\t\nelse:\n\tprint(ans)', 'import numpy as mul\nimport math\n\nN=int(input())\nA=list(map(int,input().split()))\nans=mul.prod(A)\n\nif int(math.log10(ans)) > 17:\n\tprint("-1")\nelse:\n\tprint(ans)', 'N=int(input())\nA = [int(x) for x in input().split()]\n\nans=1\nif 0 in A:\n ans = 0\nelse:\n A.sort(reverse=True)\n for a in A:\n if a > 10**18:\n ans = -1\n break\n else:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n\n \n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s242911869', 's345253649', 's374198977', 's542061423', 's621779339', 's773282270', 's979345206', 's925920568']
[40196.0, 40060.0, 40180.0, 40140.0, 9028.0, 40084.0, 39964.0, 21376.0]
[138.0, 148.0, 151.0, 132.0, 25.0, 160.0, 144.0, 72.0]
[134, 136, 133, 199, 136, 133, 159, 332]
p02658
u863433366
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()) for _ in range(n)]\n\nans = 1\nfor i in range(n):\n ans = a[i]\n \nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\nans = 1\nfor i in a:\n ans *= a\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'n=int(input())\narr=list(map(int,input().split()))\narr=sorted(arr) \nans=1\nfor val in arr:\n ans*=val \n if ans>10**18:\n print(-1)\n break\nelse:\n print(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s376757311', 's727846688', 's643165228']
[19376.0, 21492.0, 21756.0]
[34.0, 52.0, 88.0]
[158, 165, 156]
p02658
u863723142
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())\nline=input().split(" ")\nchecklis=sorted(line)\nif checklis[0]=="0":\n res=0\nelse:\n res=1\n i=0\n while res<=1000000000000000000 and i<num:\n res *= int(line[i])\n print(res)\n i+=1\n \n if res>1000000000000000000:\n res= -1\n \nprint(res)\n', 'num=int(input())\nline=input().split(" ")\nchecklis=sorted(line)\nif checklis[0]=="0":\n res=0\nelse:\n res=1\n i=0\n while res<=1000000000000000000 and i<num:\n res *= int(line[i])\n i+=1\n \n if res>1000000000000000000:\n res= -1\n \nprint(res)\n']
['Wrong Answer', 'Accepted']
['s167358970', 's931491199']
[19532.0, 19196.0]
[92.0, 68.0]
[294, 275]
p02658
u864101743
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())\nsum = 1\nfor x in a:\n sum *= a\n if sum > 1e18:\n sum = -1\n break\nprint(sum)\n', 'n = int(input())\na = map(int, input().split())\nsum = 1\nfor x in a:\n sum *= x\n if sum > 1e18:\n sum = -1\n break\nif 0 in a:\n sum = 0\nprint(sum)\n']
['Runtime Error', 'Accepted']
['s177956626', 's571466659']
[19240.0, 19512.0]
[34.0, 45.0]
[129, 150]
p02658
u867200256
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.
['\nimport math\n\n\ndef main():\n N = int(input())\n A = [int(arg) for arg in input().split()]\n ans = 1\n for i in range(N+1):\n ans *= A[i]\n if ans > pow(10, 18) and i == N:\n ans = "-1"\n break\n\n print(ans)\n\n\nif __name__ == \'__main__\':\n main()\n', 'import math\n\n\ndef main():\n N = int(input())\n A = [int(arg) for arg in input().split()]\n ans = 1\n for i in range(N):\n ans *= A[i]\n if ans >= pow(10, 18):\n ans = "-1"\n break\n\n print(ans)\n\n\nif __name__ == \'__main__\':\n main()\n', "\ndef main():\n N = int(input())\n A = [int(arg) for arg in input().split()]\n ans = 1\n\n for i in range(N):\n if A[i] == 0:\n print(0)\n return\n\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n return\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s902608480', 's903099189', 's467038355']
[22508.0, 22500.0, 21652.0]
[2206.0, 65.0, 55.0]
[289, 276, 344]
p02658
u867320886
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 ans = 0\nelse:\n ans = 1\n for ai in a:\n ans *= ai\n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n ans = 0\nelse:\n ans = 1\n for ai in a:\n ans *= ai\n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s560392048', 's121038988']
[21476.0, 21656.0]
[48.0, 47.0]
[208, 212]
p02658
u867408000
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.
['allnum = int(input())\n\nlist = input().split()\n\nlist_i = [int(s) for s in list]\n\nresult = 0\n\nif 0 in list_i:\n \tprint(0)\nelse:\n for n in list_i:\n result = result * n\n if result > 1000000000000000000:\n result = -1\n break\n print(result)', 'n = int(input())\nary = list(input().split())\n\nif "0" in ary:\n print(0)\nelse:\n length = sum(map(len,ary))\n print(length-n)\n if length-n > 18:\n print(-1)\n else:\n multiple = 1\n while ary:\n multiple *= int(ary.pop())\n if multiple > 10**18:\n print(-1)\n else:\n print(multiple)\n', 'n = input()\nary = list(input().split())\n\nif "0" in ary:\n print(0)\nelse:\n length = sum(map(len,ary))\n if length > 18:\n print(-1)\n else:\n multiple = 1\n while ary:\n multiple *= int(ary.pop())\n print(multiple)\n', 'n = int(input())\nary = list(map(int,input().split()))\nimport cmath\nif 0 in ary:\n print(0)\nelse:\n multiple = 1\n while ary:\n multiple *= ary.pop()\n if multiple > 10**18:\n multiple = -1\n break\n print(multiple)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s099957584', 's285167011', 's600912389', 's723748314']
[21784.0, 19500.0, 19208.0, 21668.0]
[61.0, 56.0, 43.0, 58.0]
[275, 354, 257, 255]
p02658
u870736713
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=1\nn=input()\n\ns=input()\nfor i in range(len(s)):\n if i%2==1:\n continue\n a*=int(s[i])\nif a>10**18:\n print(-1)\nelse:\n print(a)', 'a=1\nn=input()\n\ns=input()\ncount=""\n#print(len(s))\nfor i in range(len(s)):\n #print(i,s[i],count)\n if a==0:\n print(0)\n break\n if s[i]==" ":\n a*=int(count)\n count=""\n continue\n elif i==len(s)-1:\n if len(count)==0:\n a*=int(s[i])\n else:\n count+=s[i]\n #print("--------")\n a*=int(count)\n else:\n count+=s[i]\n if a>10**18:\n print(-1)\n break\nif a<10**18 and a!=0:\n print(a)', 'import sys\n\n#1\n#a,b=map(int,input().split())\n#print(a*b)\n\n#2\nn=input()\ns=list(map(int,input().split())) \ncount=0\n\nif 0 in s:\n print(0)\n sys.exit()\nelse:\n a=1\n for i in s:\n a*=i\n if a>10**18:\n print(-1)\n sys.exit()\n\nprint(a)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s313000616', 's496583813', 's787757512']
[12576.0, 12748.0, 21792.0]
[60.0, 77.0, 52.0]
[131, 419, 243]
p02658
u871841829
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())\n\nans = 1\n\nimport sys\n\nif 0 in A:\n print(0)\n sys.exit()\n \n\nfor a in A:\n ans *= a\n\tif ans > pow(10, 18):\n \tprint(-1)\n \tsys.exit()\n\nprint(ans)\n ', 'N = int(input())\nA = map(int, input().split())\n\nans = 1\n\nimport sys\n\nif 0 in A:\n print(0)\n sys.exit()\n \nfor a in A:\n ans *= a\n if ans > pow(10, 18):\n print(-1)\n sys.exit()\n\nprint(ans)\n ', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nimport sys\n\nif 0 in A:\n print(0)\n sys.exit()\n \nfor a in A:\n ans *= a\n if ans > pow(10, 18):\n print(-1)\n sys.exit()\n\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s496039424', 's762528119', 's523740825']
[8956.0, 19280.0, 21528.0]
[21.0, 47.0, 68.0]
[195, 201, 204]
p02658
u871867619
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.
['result = 1\nif 0 in A:\n result = 0\nelse:\n for i in A:\n result *= i\n if result > 10**18:\n result = -1\n break\n\nprint(result)', 'N = int(input())\nA = list(map(int, input().split())) \n\nresult = 1\nif 0 in A:\n result = 0\nelse:\n for i in A:\n result *= i\n if result > 10**18:\n result = -1\n break\n\nprint(result)\n', 'N = int(input())\nA = list(map(int, input().split())) \n\nresult = 1\nif 0 in A:\n result = 0\nelse:\n for i in A:\n result *= i\n if result > 10**18:\n result = -1\n break\n\nprint(result)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s682274767', 's782260677', 's508761665']
[9096.0, 8956.0, 21504.0]
[21.0, 27.0, 50.0]
[163, 203, 219]
p02658
u873616440
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)\n exit()\nfor i in range(N):\n ans *= A[i]\n print(ans)\n if ans > 10**18:\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', 'Accepted']
['s266977678', 's673923316']
[21648.0, 21588.0]
[81.0, 52.0]
[192, 179]
p02658
u873736356
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 return\nans = 1\nfor i in a:\n ans *= i\n if ans >1000000000000000000:\n print(-1)\n return\n print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n return\nans = 1\nfor i in a:\n ans *= i\n if ans >1000000000000000000:\n print(-1)\n return\nprint(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n return\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n exit()\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s168750111', 's356874873', 's651129743', 's780951012']
[9044.0, 9080.0, 9044.0, 21752.0]
[23.0, 25.0, 25.0, 51.0]
[202, 198, 184, 184]
p02658
u875763012
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())\n\nnums = list(map(int, input().split()))\n\n\ndef solve(nums):\n if any(not n for n in nums):\n return 0\n\n print(list(nums))\n i = 1\n for n in nums:\n i *= n\n if i > 10 ** 18:\n return -1\n return i\n\nprint(solve(nums))\n', 'n = int(input())\n\nnums = list(map(int, input().split()))\n\n\ndef solve(nums):\n if any(not n for n in nums):\n return 0\n\n i = 1\n for n in nums:\n i *= n\n if i > 10 ** 18:\n return -1\n return i\n\nprint(solve(nums))\n']
['Wrong Answer', 'Accepted']
['s563070529', 's929235805']
[21776.0, 21652.0]
[68.0, 54.0]
[253, 233]
p02658
u875871419
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())\n\nP = int(input())\n\nout_range = 10**18\n\nfor i in range(N-1):\n tmp = int(input())\n if P > out_range or tmp > out_range:\n print(-1)\n P = tmp * P\n\nprint(P)\n', 'N = int(input())\n\nP = int(input())\n\nout_range = 10**18\n\nfor i in range(N-1):\n tmp = int(input())\n if P > out_range or tmp > out_range:\n print(-1)\n exit()\n if tmp == 0:\n print(0)\n exit()\n P = tmp * P\n\nprint(P)\n', 'N = int(input())\n\nP = int(input())\n\nout_range = 10**18\nfor i in range(N-1): \n tmp = int(input())\n if P > out_range || tmp > out_range:\n print(-1)\n P = tmp * P\n\nprint(P)\n', 'N = int(input())\n\nP = list(map(int, input().split()))\n\nout_range = 10**18\n\nans=1\nif 0 in P:\n print(0)\n exit()\n\nfor i in range(N):\n tmp = P[i]\n ans *= tmp\n if ans > out_range:\n print(-1)\n exit()\n\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s250313413', 's438872006', 's445581784', 's402948416']
[12772.0, 12724.0, 9012.0, 21660.0]
[32.0, 31.0, 22.0, 49.0]
[186, 250, 189, 237]
p02658
u877220920
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 = map(int, input().split())\n\nans = 1\n\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n\nfor a in sorted(A, reverse=True):\n ans *= a\n if 10**18 < ans:\n print(-1)\n sys.exit()\n\n\nprint(ans)\n', 'import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n\nfor a in sorted(A, reverse=True):\n ans *= a\n if 10**18 < ans:\n print(-1)\n sys.exit()\n\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s265104690', 's990763455']
[19496.0, 21440.0]
[47.0, 67.0]
[251, 257]
p02658
u877884213
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()))\np = 1\nif a.count(0):\n print(0)\n exit(0)\nfor i in range(n):\n p *= a[i]\n print(p, end=' ')\n if p > int(1E18):\n print(-1)\n exit(0)\nprint(p)", 'n = int(input())\na = list(map(int, input().split()))\np = 1\nif a.count(0):\n print(0)\n exit(0)\nfor i in range(n):\n p *= a[i]\n if p > int(1E18):\n print(-1)\n exit(0)\nprint(p)']
['Wrong Answer', 'Accepted']
['s898160348', 's109706342']
[21788.0, 21764.0]
[92.0, 56.0]
[218, 196]
p02658
u878173555
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\nfor i in range(n):\n ans*=a[i]\n if ans>10^18:\n print(-1)\n break\n elif i==n-1:\n print(ans)', 'n=int(input())\na=list(map(int, input().split()))\nans=1\n\nfor i in range(n):\n ans*=a[i]\n if i==n-1 and ans<10^18:\n print(ans)\n elif i==n-1:\n print(-1)', 'n=int(input())\na=list(map(int, input().split()))\nans=1\n\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 break\n elif i==n-1:\n print(ans)', 'n=int(input())\na=list(map(int, input().split()))\nans=1\n\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 break\n elif i==n-1:\n print(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s224480254', 's643675882', 's952805606', 's103002341']
[21692.0, 21648.0, 21656.0, 21468.0]
[48.0, 2206.0, 50.0, 52.0]
[156, 157, 198, 199]
p02658
u878384274
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()))\nanswer = 1.\nfor a in A_list:\n answer*=a\n\nif answer > 10**18:\n print("-1")\nelse:\n print(answer)\n ', 'N = int(input())\nA_list = list(map(int,input().split()))\nanswer = 1.\nfor a in A_list:\n answer*=a\n\nif answer > 10**18:\n print(-1)\nelse:\n print(answer)\n ', 'N = int(input())\nA_list = list(input().split())\n\nanswer = 1\ni = 0\nwhile len(str(answer-1))<=18 and i<N: \n answer *= int(A_list[i])\n i+=1\n\nif i==N-1:\n print(answer)\nelse:\n print(-1)', 'import math\nN = int(input())\nA_list = list(map(int,input().split()))\n#print(A_list)\n\nanswer = 1\ni_0 = 0.\nfor a in A_list:\n if a == 0:\n answer=0\n i_0=0.\n break\n else:\n answer *= a\n i_0 += math.log10(float(a))\n\nif i_0>=18:\n print(-1)\nelse:\n print(answer)', 'import math\nN = int(input())\nA_list = list(map(int,input().split()))\nanswer = 1.\nfor a in A_list:\n answer*=a\n\nif math.log10(answer) > 18:\n print("-1")\nelse:\n print(answer)\n', 'import math\nN = int(input())\nA_list = list(map(int,input().split()))\nanswer = 0.\nfor a in A_list:\n if a!=0.:\n answer+=math.log10(a)\n else:\n answer=0.\n break\n #print(answer)\n\nif answer > 18.:\n print(-1)\nelse:\n print(answer)\n', 'N = int(input())\nA_list = list(map(int,input().split()))\nA_list.sort()\n\nif A_list[0]==0:\n answer = 0\nelse: \n answer = 1\n for a in A_list:\n answer *= a\n if len(str(answer-1)) > 18:\n answer = -1\n break\nprint(answer)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s217227633', 's407666381', 's442968148', 's665725598', 's703545699', 's837237839', 's844766661']
[21816.0, 21576.0, 19500.0, 22096.0, 21764.0, 21928.0, 21604.0]
[58.0, 59.0, 75.0, 2206.0, 58.0, 70.0, 74.0]
[165, 163, 192, 299, 181, 259, 263]
p02658
u878389297
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=input()\na0=a.split()\nl=list()\nb=1\nq= "0" in a0\nif q==True:\n print(0)\n sys.exit()\nfor i in range (n):\n a1=int(a0[i])\n b=b*a1\n if b>10**18:\n print(-1)\n sys.exit()', 'import sys\nn=int(input())\na=input()\na0=a.split()\nl=list()\nb=1\nq= "0" in a0\nif q==True:\n print(0)\n sys.exit()\nfor i in range (n):\n a1=int(a0[i])\n b=b*a1\n if b>10**18:\n print(-1)\n sys.exit()\nprint(b)']
['Wrong Answer', 'Accepted']
['s210307381', 's237201509']
[19364.0, 19372.0]
[52.0, 51.0]
[217, 226]
p02658
u879309973
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 solve(n, a):\n for x in a:\n if x == 0:\n return 0\n ans = 1\n for x in a:\n ans *= x\n if ans >= 10**18:\n return -1\n return ans\n \nn = int(input())\na = list(map(int, input().split()))\nprint(solve(n, a))', 'def solve(n, a):\n for x in a:\n if x == 0:\n return 0\n ans = 1\n for x in a:\n ans *= x\n if ans > 10**18:\n return -1\n return ans\n \nn = int(input())\na = list(map(int, input().split()))\nprint(solve(n, a))']
['Wrong Answer', 'Accepted']
['s104283828', 's228856661']
[21716.0, 21396.0]
[57.0, 60.0]
[257, 256]
p02658
u880400515
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 a in A:\n ans = ans * a\n if (ans > 10 ** 18):\n print(-1)\n exit(0)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\n\nans = 1\nfor a in A:\n ans = ans * a\n if (ans > 10 ** 18):\n print(-1)\n exit(0)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s407293055', 's711532458']
[21708.0, 21464.0]
[48.0, 53.0]
[151, 200]
p02658
u880576099
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.
['l = list(map(int, input().split()))\nres = 1\nfor x in l:\n res *= x\nif res > 10**18:\n res = -1\nprint(res)', 'input()\nl = list(map(int, input().split()))\nl.sort()\nres = 1\nfor x in l:\n res *= x\n if res > 10**18:\n print(-1)\n exit(0)\nprint(res)']
['Wrong Answer', 'Accepted']
['s009940736', 's048386010']
[9200.0, 21616.0]
[24.0, 86.0]
[105, 139]
p02658
u881705752
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.
['numa, numb = input().strip().split()\nnuma, numb = [int(numa), float(numb)]\n\nnumb *= 100\nnumb = int(numb)\nans = int((numa*numb)/100)\nprint(ans)', 'numa, numb = input().strip().split()\nnuma, numb = [int(numa), float(numb)]\n\nnumb *= 100\nnumb = int(numb)\nans = int((numa*numb)/100)\nprint(ans)', 'import sys\n\nnumber = int(input())\nbox = list(map(int,input().split()))\n\nfor var in box:\n if var == 0:\n print("0")\n sys.exit()\n\noverflow = 1e18\nans = 1\nfor var in box:\n if overflow/var < ans:\n print("-1")\n sys.exit()\n ans *= var\n\nif ans <= overflow:\n print(ans)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s174928014', 's875280488', 's635103368']
[9088.0, 9064.0, 21552.0]
[22.0, 23.0, 56.0]
[142, 142, 320]
p02658
u882389182
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())\nnumber = list(map(int, input().split()))\nseki = 0\nseki2 = -1\nfor i in numebr:\n seki = seki*i\n if seki > 10 ** 18:\n print(seki2)\n else:\n print(seki)', 'n = int(input())\nnumber = list(map(int, input().split()))\nseki = 0\nseki2 = -1\nfor i in number:\n seki = seki*i\nif seki > 10 ** 18:\n print(seki2)\nelse:\n print(seki)', 'n = int(input())\nnumber = list(map(int, input().split()))\nseki = 0\nseki2 = -1\nfor i in number:\n seki = seki*i\n if seki > 10 ** 18:\n print(seki2)\n else:\n print(seki)', 'n = int(input())\nnumber = list(map(int, input().split()))\nseki = 1\nif 0 in number:\n seki = 0\nelse:\n for i in number:\n seki = seki*i\n if seki > 10 ** 18:\n seki = -1\n break\n else:\n continue\nprint(seki)\n \n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s296017970', 's706339615', 's820638829', 's976306131']
[9012.0, 21528.0, 8916.0, 21408.0]
[23.0, 58.0, 25.0, 55.0]
[167, 165, 167, 229]
p02658
u882514852
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()))\nx = 1\nfor i in range(N):\n y = x\n a = A[i]\n x = a*y\nif x//10**18 >= 1:\n print(-1)\nelse:\n print(x)', 'N = int(input())\nA = list(map(int,input().split()))\nx = 1\nif A.count(0) == 0:\n for i in range(N):\n y = x\n a = A[i]\n x = a*y\n if x//10**18 >= 1:\n break\n \n if x//10**18 >= 1:\n print(-1)\n else:\n print(x)\nelse:\n print(0)', 'N = int(input())\nA = list(map(int,input().split()))\nx = 1\nif A.count(0) == 0:\n for i in range(N):\n y = x\n a = A[i]\n x = a*y\n if x > 10**18:\n break\n \n if x > 10**18:\n print(-1)\n else:\n print(x)\nelse:\n print(0)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s276062229', 's878269450', 's365257234']
[21612.0, 21668.0, 21588.0]
[2206.0, 64.0, 64.0]
[153, 245, 238]
p02658
u882869256
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(' ')\nm=0\ns=0\nwhile m<a:\n s=s+int(b[m])\n m=m+1\nif s<10**18:\n print(-1)\nelse:\n print(s)\n", "a=int(input())\nb=input().split(' ')\nm=0\ns=1\nj=0\nwhile m<a:\n\tif b[m]==0:\n print(0)\n j=j+1\n\n m=m+1\n\nm=0\nwhile m<a and j==0:\n s=s*int(b[m])\n if s>10**18:\n\t\tprint(-1)\n\n m=m+1\n\n\nelse:\n print(s)", "a=int(input())\nb=input().split(' ')\nm=0\ns=1\ni=0\no=0\nwhile i<a:\n if int(b[i])==0:\n print(0)\n o=o+1\n i=i+1\nwhile m<a and o==1:\n s=s*int(b[m])\n m=m+1\n if s>10**18 and o==0:\n print(-1)\n o=o+1\n break\n\nif o==0:\n print(s)\n", "a=int(input())\nb=input().split(' ')\nm=0\ns=1\nj=0\nwhile m<a:\n\tif b[m]==0:\n print(0)\n j=j+1\n \n m=m+1\n\nm=0\nwhile m<a and j==0:\n s=s*int(b[m])\n if s>10**18:\n\t\tprint(-1)\n \n m=m+1\n\n\nelse:\n print(s)", 'a=int(input())\nb=input.split()\nm=0\ns=0\nwhile m<a:\n s=s+int(b[m])\n m=m+1\nif s<10**18:\n print(-1)\nelse:\n print(s)\n', "a=int(input())\nb=input().split(' ')\nm=0\ns=1\ni=0\no=0\nwhile i<a:\n if int(b[i])==0:\n print(0)\n o=o+1\n i=i+1\nwhile m<a and o==0:\n s=s*int(b[m])\n m=m+1\n if s>10**18 and o==0:\n print(-1)\n o=o+1\n break\n\nif o==0:\n print(s)\n"]
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s028138859', 's103551731', 's143818536', 's837102298', 's968136385', 's370554607']
[9184.0, 9032.0, 19404.0, 8992.0, 9184.0, 19408.0]
[22.0, 22.0, 2206.0, 23.0, 23.0, 78.0]
[127, 217, 268, 221, 124, 268]
p02658
u883134470
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 = []\n\nz=False\nfor x in input().split(' '):\n if x == 0:\n z = True\n arr.append(x)\nif z == True:\n print(0)\n\nelse:\n ans = 1\n for x in arr:\n ans *= x\n if ans > int(1e18):\n print(-1)\n else:\n print(ans)", "n = int(input())\narr = []\n\nz=False\nfor x in input().split(' '):\n if x == '0':\n z = True\n arr.append(int(x))\nif z == True:\n print(0)\n\nelse:\n ans = 1\n for x in arr:\n ans *= x\n if ans > int(1e18):\n print(-1)\n exit(0)\n \n print(ans)"]
['Runtime Error', 'Accepted']
['s023028171', 's484308948']
[19292.0, 21640.0]
[44.0, 62.0]
[273, 291]
p02658
u883674141
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())\nr = list(map(int,input().split()))\n\nfor i in range(n):\n if i == 0:\n x = r[i]\n else:\n x = x * r[i]\n \n if x >= 10**18:\n x = -1\n break\n\nprint(x)', 'n = int(input())\nr = list(map(int,input().split()))\n\nfor i in range(n):\n if i == 0:\n x = r[i]\n else:\n x = x * r[i]\n \n if x >= 10**18:\n x = -1\n break\n\nif x >= 10**18:\n x = -1\nprint(int(x))', 'n = int(input())\nr = list(map(int,input().split()))\n\nlim = int(10^18)\n\nfor i in range(n):\n if i == 0:\n x = r[i]\n else:\n x = x * r[i]\n \n if x >= lim*10:\n x = -1\n break\n\nif x > lim:\n x = -1\n\nprint(int(x))', 'import math\nn = int(input())\nr = list(map(int,input().split()))\n\nlim = math.pow(10,18)\n\nfor i in range(n):\n if i == 0:\n x = r[i]\n else:\n x = x * r[i]\n\n if x > 1000000000000000000:\n break\n\nif x > 1000000000000000000:\n x = -1\n\nif 0 in r:\n x = 0\n\nprint(math.floor(x))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s310948095', 's649867927', 's854254959', 's270618313']
[21716.0, 21784.0, 21656.0, 22476.0]
[50.0, 55.0, 51.0, 54.0]
[198, 234, 249, 300]
p02658
u883820415
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.
['input()\nnums = map(int,input().split())\n\nif 0 in nums:\n print(0)\n exit 0\n\nresult=1\nfor i in nums:\n result *= i\n\nif result > (10**18):\n print(-1)\nelse:\n print(result)', 'input()\nnums = map(int,input().split())\n\nif 0 in nums:\n print(0)\n exit(0)\n\nresult=1\nfor i in nums:\n result *= i\n\nif result > (10**18):\n print(-1)\nelse:\n print(result)', 'input()\nnums = list(map(int,input().split()))\n\nif nums.count(0):\n print(0)\n exit(0)\nprint(list(nums))\n\nresult=1\nfor i in nums:\n result *= i\n\nif result > (10**18):\n print(-1)\nelse:\n print(result)', 'input()\nnums = list(map(int,input().split()))\n\nif nums.count(0):\n print(0)\n exit(0)\n\nresult=1\nfor i in nums:\n result *= i\n if result > (10**18):\n print(-1)\n exit(0)\nprint(result)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s041190435', 's525011479', 's890108925', 's991496345']
[9036.0, 19380.0, 21564.0, 21508.0]
[31.0, 53.0, 2206.0, 63.0]
[180, 181, 209, 204]
p02658
u883866798
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()))\nover_value = 10 ** 18 + 1\ntotal = 1\nif A.index(0):\n print(0)\nelse:\n for i in A:\n total *= i\n if total > over_value:\n total = -1\n print(total)', 'N = int(input())\nA = list(map(int,input().split()))\nover_value = 10 ** 18\ntotal = 1\ncnt = 0\nwhile cnt < N:\n total *= A[cnt]\n if total > over_value:\n total = -1\n break\n cnt += 1\n \nfor i in range(N):\n if A[i] == 0:\n total = 0\nprint(total)']
['Runtime Error', 'Accepted']
['s168514280', 's016571851']
[21780.0, 21476.0]
[47.0, 57.0]
[219, 272]
p02658
u886286585
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())\n\na = list(map(int,input().split()))\n\nans = 1\n\nfor i in range(n - 1):\n ans = ans * a[i]\n if ans > (10 ** 18):\n print("-1")\n \nprint(ans)', 'n = int(input())\n\na = list(map(int,input().split()))\n\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans = ans * a[i]\n if ans > (10 ** 18): \n break\n \nif ans > (10 ** 18):\n print("-1") \nelse:\n print(ans)']
['Wrong Answer', 'Accepted']
['s945187572', 's670429376']
[21656.0, 21652.0]
[2206.0, 54.0]
[156, 231]
p02658
u886362575
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())\nnum = 1\nfor i in a:\n num = num*i\n if num >= 10**18:\n print(-1)\n exit()\n elif num == 0:\n print(0)\n exit()\nprint(num)', 'N = int(input())\na = map(int, input().split())\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n num = num*i\n if num > 10**18:\n print(-1)\n exit()\nprint(num)', 'N = int(input())\na = [int(i) for i in input().split()]\nif 0 in a:\n print(0)\n exit()\nnum = 1\nfor i in a:\n num = num*i\n if num > 10**18:\n print(-1)\n exit()\nprint(num)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s332960752', 's686670857', 's899262403']
[19372.0, 19372.0, 21572.0]
[44.0, 44.0, 56.0]
[177, 158, 174]
p02658
u886718563
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()))\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 > 10**18:\n print(-1)\n return\n \n print(prod)\n\nmain()', '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 ()\n']
['Runtime Error', 'Accepted']
['s203446626', 's782638789']
[12720.0, 21648.0]
[28.0, 57.0]
[221, 233]
p02658
u887080361
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())\ndata=list(map(int,input().split()))\ns=1\nfor d in data:\n if data == 0:\n print(0)\n break\nelse:\n for d in data:\n s *= d\n if s > 10**18:\n print(-1)\n else:\n print(s)', 'data=list(map(int,input().split()))\ns=1\nif 0 in data:\n print(0)\nelse:\n for f in data:\n s *= f\n if s > 10**18:\n print(-1)\n else:\n print(s)', 'N=int(input())\ndata=list(map(int,input().split()))\ns=1\nfor 0 in data:\n print(0)\n end()\nfor d in data:\n s *= d\nif s > 10**18:\n print(-1)\nelse:\n print(s)\n ', 'N=int(input())\ndata=list(map(int,input().split()))\ns=1\nfor d in data:\n if d == 0:\n print(0)\n break\nelse:\n for d in data:\n s *= d\n if s > 10**18:\n print(-1)\n else:\n print(s)', 'N=int(input())\ndata=list(map(int,input().split()))\nif 0 in data:\n print(0)\nelse:\n s=1\n for f in data:\n s *= f\n if s > 10**18:\n break\n if s > 10**18:\n print(-1)\n else:\n print(s)\n ']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s075423397', 's183368865', 's220285277', 's659615892', 's795006144']
[21560.0, 9184.0, 8884.0, 21440.0, 21648.0]
[2206.0, 28.0, 23.0, 2206.0, 56.0]
[238, 170, 171, 235, 235]
p02658
u888092736
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())\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10 ** 18:\n print(-1)\n break\nelse:\n print(ans)\n', 'N, *A = map(int, open(0).read().split())\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10 ** 18:\n print(-1)\n break\nelse:\n print(ans)\n']
['Runtime Error', 'Accepted']
['s722215477', 's885521798']
[19312.0, 21692.0]
[38.0, 57.0]
[184, 185]
p02658
u888933875
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 test():\n n=int(input())\n A=list(map(int,input().split()))\n if (0 in A):\n print("0")\n return\n a=1\n for i in range(n):\n a*=A[i]\n if a > 10**18:\n print("-1")\n return\n else:\n print(a)\ntest()', 'def test():\n n=int(input())\n A=list(map(int,input().split()))\n a=1\n\n if (0 in A):\n print("0")\n return\n\n for i in A:\n a*=i\n if a > 10**18:\n print("-1")\n return\n print(a) \ntest()']
['Wrong Answer', 'Accepted']
['s932465428', 's035020724']
[21584.0, 21764.0]
[82.0, 55.0]
[219, 204]
p02658
u890488173
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())\nli = list(map(int,input().split()))\n\nn=1\nfor i in list\n n*=n*list[i]\n\nif(n>1000000000000000000):\n print("-1")\nelse:\n print(n)\n', 'a=int(input())\nli = list(map(int,input().split()))\n\nn=1\nfor i in range(list)\n n*=n*list[i]\n\nif(n>1000000000000000000):\n print("-1")\nelse:\n print(n)\n', 'a=int(input())\nli = list(map(int,input().split()))\n \nn=1\nif(0 in li):\n\tprint(0)\nelse:\n\tfor i in li:\n\t\tn=n*i\n\t\tif(n>1000000000000000000):\n\t\t\tn=-1\n\t\t\tbreak\n\tprint(n)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s891220736', 's945627177', 's640735892']
[9024.0, 9024.0, 21788.0]
[23.0, 24.0, 51.0]
[151, 158, 163]
p02658
u890870565
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()\nif A[0] == 0:\n print(0)\nelse:\n ans = 1\n for i in A:\n if ans > 1000000000000000000:\n print(-1)\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit(0)\n\nm = 10**18\nans = 1\nfor x in a:\n ans *= x\n if ans > m:\n print(-1)\n exit(0)\n \nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s041092890', 's735242750']
[21540.0, 21440.0]
[77.0, 58.0]
[197, 199]
p02658
u891202624
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 0 in A:\n print(0)\nketa=1\nfor i in A:\n keta*=i\n if keta>1000000000000000000:\n print(-1)', 'N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\nketa=1\nfor i in A:\n keta*=i\n if keta>1000000000000000000:\n print(-1)\n else:\n print(keta)', 'N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print("0")\nketa=1\nfor i in A:\n keta*=i\n if keta>1000000000000000000:\n print("-1")\n ', 'N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\nelse:\n keta=1\n for i in A:\n keta*=i\n if keta>1000000000000000000:\n break\n \n if keta>1000000000000000000:\n print(-1)\n else: \n print(keta)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s118316653', 's167220995', 's349100124', 's908538505']
[21584.0, 21636.0, 21580.0, 21648.0]
[2206.0, 2206.0, 2206.0, 56.0]
[153, 183, 162, 267]
p02658
u891692185
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 ans = 1\n for a in A:\n ans *= a\n if ans >= pow(10, 10, 18):\n print(-1)\n return\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', '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 > pow(10, 18):\n print(-1)\n return\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s832571115', 's004624928']
[21644.0, 21648.0]
[94.0, 59.0]
[298, 293]
p02658
u893962649
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())\n\nprint(N)\n\nnl = map(int,input().split())\n\nans=1\nlim=10**18\nflg=0\n\nfor i in nl:\n ans=ans*i\n if ans>lim:\n flg=-1\n break\n \nif flg==0:\n print(ans)\nelse:\n print(-1)\n', 'N = int(input())\n\nprint(N)\n\nnl = map(int,input().split())\n\nans=1\nfor i in nl:\n ans = ans * i\n\nlim = 10**18\n\nif ans > lim:\n print(-1)\nelse:\n print(ans)', '\ndef main():\n N = int(input())\n nl = list(map(int,input().split()))\n\n if 0 in nl:\n print(0)\n return\n\n ans=1\n lim=10**18\n\n for i in nl:\n ans *= i\n if ans>lim:\n print(-1)\n return\n \n print(ans)\n \nmain()']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s432649224', 's733880821', 's734015305']
[19316.0, 19296.0, 21416.0]
[46.0, 2206.0, 49.0]
[190, 153, 232]
p02658
u894521144
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 A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n x = 1\n else:\n for a in A:\n x *= a\n if x > 10 ** 18:\n print(-1)\n exit()\n else:\n print(x)\n\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)", "def main(N):\n A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n x = 1\n for a in A:\n x *= a\n if x > 10 ** 18:\n print(-1)\n exit()\n else:\n print(x)\n\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)\n", "def main(N):\n A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n else:\n x = 1\n for a in A:\n x *= a\n \tif x > 10**18:\n \tprint(-1)\n exit()\n else:\n print(x)\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)\n", "from math import log10\n\ndef main(N):\n A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n else:\n x = 1\n for a in A:\n x *= a\n if log10(x) >= 18:\n print(-1)\n else:\n print(x)\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)", "from math import log10\n\ndef main(N):\n A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n else:\n x = 1\n for a in A:\n x *= a\n \tif x > 10**18:\n \tprint(-1)\n exit()\n else:\n print(x)\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)\n", "from math import log10\nimport numpy as np\n\ndef main(N):\n ans = np.prod(np.array(list(map(int, input().split()))))\n if log10(ans) >= 18:\n print(-1)\n else:\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)", "def main(N):\n A = list(map(int, input().split()))\n st_A = set(A)\n if 0 in st_A:\n print(0)\n else:\n x = 1\n for a in A:\n x *= a\n if x > 10 ** 18:\n print(-1)\n exit()\n else:\n print(x)\n\n\n\n\n\nif __name__ == '__main__':\n N = int(input())\n main(N)"]
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s125835164', 's261192118', 's320740727', 's483734804', 's532054091', 's657521249', 's161829281']
[21668.0, 21480.0, 8972.0, 22700.0, 9028.0, 40236.0, 21604.0]
[58.0, 60.0, 20.0, 2206.0, 26.0, 140.0, 56.0]
[346, 337, 338, 340, 362, 253, 346]
p02658
u894939163
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.
['if int(count) == 0:\n result = 0\nelse:\n nums_str = input().split()\n nums_int = []\n for strn in nums_str:\n nums_int.append(int(strn))\n \n result = 1\n\n else:\n for intn in nums_int:\n result *= intn\n if result > 10**18:\n result = -1\n break\n \nprint(result)', 'count = input()\nnums_str = input().split()\nnums_int = []\nfor strn in nums_str:\n nums_int.append(int(strn))\n\nresult = 1\nif count == 0:\n result = 0\nelif:\n for intn in nums_int:\n result *= intn\n if result > 10**18:\n result = -1\n break\n \nprint(result)', 'def process():\n count = int(input())\n if count == 0:\n result = 0\n else:\n nums_str = input().split()\n nums_int = []\n for strn in nums_str:\n nums_int.append(int(strn))\n\n if 0 in nums_int:\n result = 0\n return result\n else:\n result = 1\n for intn in nums_int:\n result *= intn\n if result > 1000000000000000000:\n result = -1\n return result\n \nprint(process())', 'def process():\n count = int(input())\n nums_str = input().split()\n nums_int = []\n for strn in nums_str:\n nums_int.append(int(strn))\n\n if 0 in nums_int:\n result = 0\n return result\n else:\n result = 1\n for intn in nums_int:\n result *= intn\n if result > 10**18:\n result = -1\n return result\n return result\n \nprint(process())']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s584135443', 's664596166', 's996017445', 's036644265']
[9140.0, 9040.0, 19492.0, 21752.0]
[21.0, 22.0, 2206.0, 57.0]
[290, 269, 452, 369]
p02658
u896741788
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=int(input())\nlim=10**18\nfor i in list(map(int,input().split())):\n ans*=i\nprint(ans if ans>lim else -1)', 'ans=1\nn=int(input())\nlim=10**18\nl=list(map(int,input().split()))\nif 0 in set(l):print(0);exit()\nfor i in l:\n ans*=i\n if ans>lim:print(-1);exit()\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s863716957', 's278605533']
[21636.0, 21620.0]
[2206.0, 60.0]
[113, 162]
p02658
u897328029
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().split()[0])\na_list = list(map(int, input().split()))\nt = 1\nfor a in a_list:\n t *= a\n if t >= 10**18:\n t = -1\n break\nprint(t)\n', 'N = int(input().split()[0])\na_list = list(map(int, input().split()))\nt = 1\nif 0 in a_list:\n t = 0\nelse:\n for a in a_list:\n \tt *= a\n \tif t > 10**18:\n \tt = -1\n \tbreak\nprint(t)\n']
['Wrong Answer', 'Accepted']
['s982071277', 's685968605']
[21644.0, 21620.0]
[49.0, 55.0]
[161, 200]
p02658
u898109279
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 = map(int, input().split())\n\nif 0 in A:\n print(0)\n sys.exit()\n\nresult = 1\nfor a in A:\n result *= a\n if (result > 10 ** 18):\n print(-1)\n sys.exit()\n\nprint(result)', 'import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n sys.exit()\n\nresult = 1\nfor a in list(A):\n result *= a\n if (result > 10 ** 18):\n print(-1)\n sys.exit()\n\nprint(result)\n']
['Wrong Answer', 'Accepted']
['s699722653', 's771590298']
[19340.0, 21680.0]
[55.0, 60.0]
[202, 231]
p02658
u898631971
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())\n\na = list(map(int,input().split()))\n\ncount = 1\n\nfor i in a:\n count*=i\n\nx = 10**18\n\nif count > x:\n print(-1)\n break\nelse:\n print(count)', 'n = int(input())\n\na = sorted(list(map(int,input().split())))\n\ncount = 1\n\nfor i in a:\n count*=i\n\nx = 10**18\n\nif count > x:\n print(-1)\n break\nelse:\n print(count)', 'n = int(input())\n\na = sorted(list(map(int,input().split())))\n\ncount = 1\n\nfor i in range(n):\n count*=a[i]\n if count>10**18:\n print(-1)\n break\n\nelse:\n print(count)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s795233449', 's856612521', 's041862786']
[9104.0, 9108.0, 21660.0]
[25.0, 29.0, 90.0]
[163, 171, 184]
p02658
u899782392
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())\nI = list(map(int, input().split()))\nans = 1\n\nkMax = 10**18\n\nif 0 in I:\n print(0)\n exit()\n\nfor i in map(int, input().split()):\n ans *= i\n if ans > kMax:\n print(-1)\n exit()\nprint(ans)\n\n', 'N = int(input())\nI = list(map(int, input().split()))\nans = 1\n\nkMax = 10**18\n\nif 0 in I:\n print(0)\n exit()\n\nfor i in I:\n ans *= i\n if ans > kMax:\n print(-1)\n exit()\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s845993562', 's940782002']
[21700.0, 21624.0]
[55.0, 55.0]
[226, 202]
p02658
u900548304
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 as np\n\nN = int(input())\nA = list(map(int,input().split()))\n#A = np.sort(np.array(A))\nA = np.array(A)\n\nans = np.prod(A)\nif ans > 10**8:\n ans = -1\n\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\n\nA.sort()\nans = 1\n\nfor i in range(N):\n if A[i] == 0:\n ans = 0\n break\n ans = ans * A[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s149204619', 's416816567']
[40084.0, 21580.0]
[147.0, 80.0]
[172, 222]
p02658
u900848560
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(" ")\nsum1=1\n\nfor i in range(a):\n\tsum1=sum1*int(b[i])\n\nif sum1<10**18:\n\tprint(sum1)\nelse:\n\tprint("-1")', 'a=int(input())\nb=input().split(" ")\nsum1=1\n\nif "0" in b:\n\tprint("0")\nelse:\n\tfor i in range(a):\n\t\tsum1=sum1*int(b[i])\n\t\tif sum1>10**18:\n\t\t\tsum1=-1\n\t\t\tbreak\n\tprint(sum1)\n']
['Wrong Answer', 'Accepted']
['s253001906', 's104940852']
[19512.0, 19336.0]
[2206.0, 49.0]
[132, 168]
p02658
u901466816
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())\n\nMAX_NUM = 10 ** 18\n\nnums = map(int, input().split())\n\nfor num in nums:\n if num == 0:\n print(0)\n exit()\n\nans = 1\n\nfor num in nums:\n ans *= num\n if ans > MAX_NUM:\n print(-1)\n exit()\n\nprint(ans)\n', 'n = int(input())\n\nMAX_NUM = 10 ** 18\n\nnums = map(int, input().split())\n\nfor num in nums:\n if num == 0:\n print(0)\n exit()\n\nans = 1\n\nfor num in nums:\n ans *= num\n if ans > MAX_NUM:\n print(-1)\n exit()\n\nprint(int(ans))\n', 'n = int(input())\n\nMAX_NUM = 10 ** 18\n\nnums = list(map(int, input().split()))\n\nfor num in nums:\n if num == 0:\n print(0)\n exit()\n\nans = 1\nfor num in nums:\n ans *= num\n if ans > MAX_NUM:\n print(-1)\n exit()\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s289513319', 's321576734', 's038166641']
[19384.0, 19364.0, 21484.0]
[46.0, 50.0, 51.0]
[225, 230, 230]
p02658
u901598613
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())\nlis=list(map(int,input().split()))\nans=1\nfor i in lis:\n ans*=i\n if ans>1000000000000000000:\n ans=-1\n break\nif 0 in lis:\n ans=0\nelse:\n print(ans)\n', 'n=int(input())\nlis=list(map(int,input().split()))\nans=1\nfor i in lis:\n ans*=i\n if ans>1000000000000000000:\n ans=-1\n break\nelse:\n print(ans)', 'n=int(input())\nlis=list(map(int,input().split()))\nans=1\nfor i in lis:\n ans*=i\n if ans>1000000000000000000:\n ans=-1\n break\nif 0 in lis:\n ans=0\n\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s138089017', 's413417456', 's973229835']
[9028.0, 8964.0, 21584.0]
[19.0, 23.0, 50.0]
[178, 154, 176]
p02658
u902917675
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())\ndata = list(map(int, input().split()))\ndata.sort()\ndata.reverse()\n \nans = 1\n\nif data[-1] == 0:\n ans = 0\n pass\nelse:\n for d in data:\n ans = ans * int(d)\n print(ans)\n if ans > 10**18:\n break\n \nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\ndata = list(map(int, input().split()))\n\nans = 1\n\nfor d in data:\n ans = ans * int(d)\n if ans >= 10**18:\n break\n\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\ndata = list(map(int, input().split()))\ndata.sort()\ndata.reverse()\n\nwhile data[-1] == 0:\n data.insert(0,0)\n data.pop(-1)\n \nans = 1\n\nfor d in data:\n ans = ans * int(d)\n if ans > 10*18 or ans == 0:\n break\n \nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\ndata = list(map(int, input().split()))\ndata.sort()\ndata.reverse()\n\nwhile data[-1] == 0:\n data.insert(0,0)\n data.pop(-1)\n \nans = 1\n\nfor d in data:\n ans = ans * int(d)\n if ans > 10**18 or ans == 0:\n break\n \nif ans > 10**18:\n print(-1)\nelse:\n print(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s083824438', 's589854652', 's803496304', 's826608802']
[21628.0, 21532.0, 21532.0, 21584.0]
[92.0, 58.0, 78.0, 78.0]
[272, 181, 275, 276]
p02658
u904924517
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())\nnums = list(map(int, input().split()))\nsum = 1\nflag = 1\nupper = pow(10, 18)\nfor num in nums:\n sum = sum * num\n if sum > upper && flag != 0:\n flag = 2\n if num == 0:\n flag = 0\nif flag == 2:\n print(-1)\nelse:\n print(sum * flag)', 'n = int(input())\nnums = list(map(int, input().split()))\nsum = 1\nflag = 1\nupper = pow(10, 18)\nfor num in nums:\n if flag == 1:\n sum = sum * num\n if sum > upper:\n flag = 2\n if num == 0:\n flag = 0\n break\nif flag == 2:\n print(-1)\nelse:\n print(sum * flag)']
['Runtime Error', 'Accepted']
['s098160829', 's596391263']
[9012.0, 21644.0]
[23.0, 52.0]
[251, 270]
p02658
u905895868
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())\nn_l = list(map(int, input().split()))\nprint(n_l)\n\nVORDER = 10 ** 18\nans = n_l[0]\n\nfor i in range(1, n):\n if 0 in n_l:\n ans = 0\n break\n ans = n_l[i] * ans\n if ans > VORDER:\n ans = -1\n break\n\nprint(ans)', "def check() -> int:\n n = int(input())\n n_l = list(map(int, input().split()))\n VORDER = 10 ** 18\n ans = 1\n \n if 0 in n_l:\n ans = 0\n break\n else:\n for i in n_l:\n ans = i * ans\n if ans > VORDER:\n ans = -1\n break\n return ans\nif __name__ == '__main__':\n print(check())\n", 'n = int(input())\nn_l = list(map(int, input().split()))\n\nVORDER = 10 ** 18\nans = 1\n\nif 0 in n_l:\n ans = 0\nelse:\n for i in n_l:\n ans = i * ans\n if ans > VORDER:\n ans = -1\n break\n\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s604573517', 's725630003', 's241131407']
[21548.0, 9112.0, 21608.0]
[2206.0, 23.0, 59.0]
[254, 365, 230]
p02658
u907566687
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())\nline = input().split()\n\nMAX = 1\nfor i in range(18):\n MAX = MAX * 10\n\nans = 1\n\nfor l in line:\n ans = int(l) * ans\n\nif ans < MAX:\n print(ans)\nelse:\n print(-1)\n', "N = int(input())\nline = input().split()\n\nMAX = 1000000000000000000\n\nans = 1\n\nif not '0' in line:\n for l in line:\n if l == 0:\n ans = 0\n break\n if not ans > MAX:\n ans = int(l) * ans\n\nelse:\n ans = 0\n\n\nif ans <= MAX:\n print(ans)\nelse:\n print(-1)\n"]
['Wrong Answer', 'Accepted']
['s671978431', 's917616014']
[19484.0, 19372.0]
[2206.0, 53.0]
[186, 301]
p02658
u909514237
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 collections\n\nN = int(input())\ncNum = collections.Counter(list(map(int, input().split())))\nans = 1\nif cNum[0] != 0:\n print("0")\n exit()\nfor n in cNum.keys():\n ans *= n**cNum[n]\n if ans > 10**8:\n ans = -1\n break\nprint(ans)', 'import collections\n\nN = int(input())\ncNum = collections.Counter(list(map(int, input().split())))\nans = 1\nif cNum[0] != 0:\n print("0")\n exit()\nfor n in cNum.keys():\n ans *= n**cNum[n]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s544518972', 's657445528']
[24048.0, 23992.0]
[67.0, 72.0]
[237, 238]
p02658
u910632349
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 0 not in a:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()\n print(ans)\nelse:\n print("0")', 'n=int(input())\na=list(map(int,input().split()))]\nif 0 not in a:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()\n print(ans)\nelse:\n print("0")', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nfor i in range(n):\n ans=ans*a[i]\nif len(ans)>19:\n print("-1")\n exit()\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nfor i in range(n):\n if ans<=10**18:\n ans*=a[i]\n elif ans>10**18\n print("-1")\n exit()\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))]\nif 0 in a:\n print("0")\n exit()\nelse:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()', 'n=int(input())\na=list(map(int,input().split()))]\nif 0 not in a:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()\n print(ans)\n exit()\nelse:\n print("0")', 'n=int(input())\na=list(map(int,input().split()))]\nif 0 in a:\n print("0")\n exit()\nelse:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nfor i in range(n):\n if ans<=10**18:\n ans*=a[i]\n elif ans>10**18\n print("-1")\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nif 0 in a:\n print("0")\n exit()\nelse:\n ans=1\n for i in range(n):\n ans*=a[i]\n if ans>10**18:\n print("-1")\n exit()\n print(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s018338744', 's073897347', 's101720074', 's534411614', 's652542368', 's791446612', 's935004838', 's977180069', 's978003309']
[8964.0, 8964.0, 21688.0, 9020.0, 8864.0, 8956.0, 9008.0, 9008.0, 21540.0]
[25.0, 26.0, 2206.0, 27.0, 24.0, 30.0, 25.0, 24.0, 59.0]
[208, 208, 143, 176, 208, 227, 208, 161, 222]
p02658
u911531682
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\nN = int(input())\nA = [int(_) for _ in input().split()]\n\nprint(A)\nans = A[0]\n\nfor i in range(1, N):\n ans *= A[i]\n\nif ans != 0:\n ans_size = int(math.log10(ans) + 1)\nelse:\n ans_size = 1\n\nif ans_size >= 19 and ans - (10**18) >= 1:\n print(-1)\nelse:\n print(ans)\n', 'import math\nN = int(input())\nA = [int(_) for _ in input().split()]\n\nans = A[0]\nisOver = False\n\nif 0 in A:\n print(0)\nelse:\n for i in range(1, N):\n ans *= A[i]\n ans_size = int(math.log10(ans) + 1)\n if ans_size >= 19 and ans - (10**18) >= 1:\n isOver = True\n break\n\n if isOver:\n print(-1)\n else:\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s216579540', 's629769871']
[22524.0, 22648.0]
[2206.0, 72.0]
[283, 373]
p02658
u912208257
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()))\np = 1\nfor i in range(N):\n p = p*A[i]\n if p >=10**18:\n p = -1\nprint(p)', 'N = int(input())\nA = list(map(int,input().split()))\np = 1\nfor i in range(N-1):\n p = p*A[i]\n if p >10**18:\n p = -1\n break\nprint(p)', 'N = int(input())\nA = list(map(int,input().split()))\np = 1\nfor i in range(N):\n p = p*A[i]\n if p >=10**18:\n p = -1\n break\nprint(p)', 'N = int(input())\nA = list(map(int,input().split()))\np = 1\nif A.count(0)>0:\n p = 0\nfor i in range(N):\n p = p * A[i]\n if p > 10**18:\n p=-1\n break\n if p == 0:\n break\nprint(p)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s627457712', 's806868957', 's950780376', 's449269658']
[21648.0, 21472.0, 21644.0, 21472.0]
[2206.0, 52.0, 51.0, 49.0]
[134, 149, 148, 205]
p02658
u912560297
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 \n ans = ans*a[i]\n \n\nif ans>10**8:\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 = ans*a[i]\n\nif ans>=10^18:\n print(-1)\nelse:\n print(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 i in range(n):\n ans = ans*a[i]\n if ans>10**18:\n print(-1)\n break\n else:\n pass\n \n\n if ans<=10**18:\n print(ans)\n \n\n \nmain()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s045031055', 's984723596', 's398250821']
[21588.0, 21468.0, 21644.0]
[2206.0, 2206.0, 50.0]
[162, 153, 335]
p02658
u914198331
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\nfor i in A:\n T = 1*i\n if T > 10^18:\n print(-1)\n else:\n print(T)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nfor i in A:\n T = 1\n T = T *i\n if T > 10^18:\n print(-1)\n else:\n print(T)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nT = 1\nfor i in A:\n T = T * i\n if T > 10**18:\n print("-1")\n else:\n print(T)', 'x, y = map(int, input().split())\nfor y in range(x):\n C = 1*Y\n if C >= 10^18:\n print(-1)\n else:\n print(C)', '\nN = int(input())\nA = list(map(int, input().split()))\n\nT = 1\nfor i in A:\n T = T * i\n if T > 10 ^ 18:\n print(-1)\n else:\n print(T)', 'n = int(input())\nlist = list(map(int, input().split()))\n\ni = 1\ntotal = all(i*list)\nif total > 10**18:\n print(-1)\nelse:\n print(total)', 'N = int(input())\nA = list(map(int, input().split()))\n\nT = 1\nfor i in A:\n T = T * i\n if T > 10**18:\n print(-1)\n else:\n print(T)', 'n = int(input())\nlist = list(map(int, input().split()))\n\na = 1\nif 0 in list:\n print(0)\n exit()\nelse:\n for i in list:\n a *= i\n if a > 10**18:\n print(-1)\n exit()\nprint(a)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s069698143', 's180923583', 's378577626', 's502009053', 's647656156', 's736316162', 's898230986', 's798177945']
[21648.0, 21548.0, 21632.0, 9176.0, 21652.0, 21716.0, 21552.0, 21480.0]
[92.0, 95.0, 2206.0, 24.0, 2206.0, 49.0, 2206.0, 51.0]
[141, 152, 151, 113, 151, 138, 149, 213]
p02658
u916662650
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 operator\nfrom functools import reduce\n\nn = int(input())\n\na = [int(x) for x in input().split() if x != "1"]\n\nprint(a)\nsum = reduce(operator.mul, a, 1)\n\n\n\nif sum > 10 ** 18:\n print(-1)\nelse:\n print(sum)\n\n', 'n = int(input())\n\na = [int(x) for x in input().split() ]\nsum = a[0]\n\nif 0 in a:\n sum = 0\nelse:\n for i in range(1,len(a)):\n sum = sum * a[i]\n if sum > 10**18:\n break\n \n\n\nif sum > 10**18:\n print(-1)\nelse:\n print(sum)']
['Wrong Answer', 'Accepted']
['s092152113', 's360198715']
[22716.0, 21688.0]
[2206.0, 52.0]
[215, 262]
p02658
u918817732
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 quick_sort(list):\n stand=list[0]\n over=[]\n same=[]\n under=[]\n for i in list:\n if(i>stand):\n over.append(i)\n elif(i<stand):\n under.append(i)\n else:\n same.append(i)\n if(len(over)>1):\n over=quick_sort(over)\n else:\n pass\n if(len(under)>1):\n under=quick_sort(under)\n else:\n pass\n\n return under+same+over\n\nN=int(input())\nA=list(map(int,input().split()))\nA=quick_sort(A)\nprint(A)\nans=1\nway=0\nfor i in A:\n ans*=i\n way=str(ans-1)\n if(len(way)>=19):\n ans=-1\n break\n else:\n pass\nprint(ans)', 'def quick_sort(list):\n stand=list[0]\n over=[]\n same=[]\n under=[]\n for i in list:\n if(i>stand):\n over.append(i)\n elif(i<stand):\n under.append(i)\n else:\n same.append(i)\n if(len(over)>1):\n over=quick_sort(over)\n else:\n pass\n if(len(under)>1):\n under=quick_sort(under)\n else:\n pass\n\n return under+same+over\n\nN=int(input())\nA=list(map(int,input().split()))\nA=quick_sort(A)\nans=1\nway=0\nfor i in A:\n ans*=i\n way=str(ans-1)\n if(len(way)>=19):\n ans=-1\n break\n else:\n pass\nprint(ans)']
['Wrong Answer', 'Accepted']
['s828787603', 's016869406']
[21716.0, 22316.0]
[292.0, 272.0]
[627, 618]
p02658
u919235786
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 0 in a:\n print(0)\nelse:\n s=1\n for i in a:\n s=s*i\n if s>10**18:\n s=-1\n break\n print(s)', 'n=int(input())\na=list(map(int,input().split()))\nif 0 in a:\n print(0)\nelse:\n s=1\n for i in a:\n s=s*i\n if s>10**18:\n s=-1\n break\n print(s)']
['Runtime Error', 'Accepted']
['s605651356', 's077612532']
[8960.0, 21640.0]
[23.0, 49.0]
[168, 184]
p02658
u921156673
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())\n\nA = sorted(list(map(int, input().split())))\nassert len(A) == N\nmul = 1\nfor a in A:\n mul *= a\n# print(a, mul)\n if a == 0:\n print(0)\n break\n if mul >= (10 ** 18):\n print(-1)\n break\nelse:\n print(mul)', 'N = int(input())\nA = list(reversed(sorted(list(map(int, input().split())))))\nassert len(A) == N\nmul = 1\nfor a in A:\n mul *= a\n if a == 0:\n print(0)\n break\n if mul >= 10 ** 18:\n print(-1)\n break\nelse:\n print(mul)', 'N = int(input())\nA = reversed(sorted(map(int, input().split())))\nassert len(A) == N\nmul = 1\nfor a in A:\n mul *= a\n if mul >= 10 ** 18:\n print(-1)\n break\nelse:\n print(mul)', 'N = int(input())\nA = list(map(int, input().split()))\nassert len(A) == N\nmul = 1\nfor a in A:\n mul *= a\nif mul >= 10 ** 18:\n print(-1)\nelse:\n print(mul)', 'N = int(input())\n\nA = sorted(list(map(int, input().split())))\nassert len(A) == N\nmul = 1\nfor a in A:\n mul *= a\n# print(a, mul)\n if a == 0:\n print(0)\n break\n if mul > (10 ** 18):\n print(-1)\n break\nelse:\n print(mul)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s192857844', 's463313705', 's868832782', 's998239797', 's600182491']
[21552.0, 21428.0, 21636.0, 21420.0, 21548.0]
[88.0, 85.0, 78.0, 2206.0, 84.0]
[291, 227, 179, 153, 290]
p02658
u921617614
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 as np\n\nn=int(input())\nA=np.array(list(map(int,input().split())))\na=np.prod(A)\n\nif a>=10**18:\n print("-1")\nelse:\n print(a)', 'import numpy as np\n\nn=int(input())\nA=np.array(list(map(int,input().split())))\na=np.prod(A)\n\nif a>=10**18:\n print(-1)\nelse:\n print(a)', 'n=int(input())\nA=list(map(int,input().split()))\nprod=1\nif 0 in A:\n prod=0\nfor i in A:\n prod*=i\n if prod>10**18:\n prod=-1\n break\nprint(prod)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s477757021', 's819514012', 's113769234']
[39880.0, 39860.0, 21608.0]
[150.0, 144.0, 64.0]
[140, 138, 162]
p02658
u922407376
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\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n ans = ans * i\n if ans > 1e18:\n print(-1)\n exit()\n else:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n ans = ans * i\n if ans > 1e18:\n print(-1)\n exit()\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s368369983', 's911877490']
[21644.0, 21648.0]
[86.0, 60.0]
[209, 192]
p02658
u922432452
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 unsigned long long ll;\nconst int maxn = 2e5 + 10;\nll a[maxn];\nint pos(ll x)\n{\n int num = 0;\n while (x)\n {\n num++;\n x /= 10;\n }\n return num;\n}\nint main()\n{\n int n, f = 0;\n cin >> n;\n for (int i = 1; i <= n; i++)\n cin >> a[i];\n ll sum = a[1];\n for (int i = 2; i <= n; i++)\n {\n int x = pos(sum);\n int y = pos(a[i]);\n if (x + y >= 21)\n {\n f = 1;\n break;\n }\n else\n sum *= a[i];\n if(sum>1000000000000000000)\n break;\n }\n if ((sum > 1000000000000000000) || f == 1)\n cout << -1 << endl;\n else\n cout << sum << endl;\n}', 'n = int(input())\nsum = 1\nMax = 1000000000000000000\nwhile n:\n sum*=int(input())\n n--\nif sum<=Max:\n print("%d" % sum)\nelse :\n print("%d" % -1)', 'n = int(input())\nsum = 1\nMax = 1000000000000000000\nwhile n:\n sum*=int(input())\n if sum>Max:\n break\n n-=1\nif sum<=Max:\n print("%d" % sum)\nelse :\n print("%d" % -1)\n', 'n = int(input())\nSum = 1\nMax = 1000000000000000000\n\nl = list(map(int, input().split()))\nf = 0\nfor i in range(n):\n if l[i]==0:\n f = 1\nfor i in range(n):\n Sum=Sum*l[i]\n if Sum>Max:\n break\nif f == 1:\n print("0")\nelif Sum<=Max:\n print("%d" % Sum)\nelse :\n print("%d" % -1)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s013961692', 's233239902', 's584871433', 's675479878']
[8948.0, 9020.0, 12816.0, 21468.0]
[24.0, 22.0, 33.0, 57.0]
[731, 144, 170, 281]
p02658
u922878570
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.
['inputs = input().split(" ")\ndecimal = int(float(inputs[1])*100)\nproduct = int(inputs[0])*(decimal)\nprint(product//100)', 'count = int(input())\nnums = input().split(" ")\n\nproduct = 1\n\nif ("0" in nums):\n print(0)\nelse:\n for i in nums:\n product *= int(i)\n if (product > 10**18):\n print(-1)\n exit()\n print(product)']
['Runtime Error', 'Accepted']
['s621697103', 's561169999']
[9128.0, 19504.0]
[20.0, 47.0]
[118, 233]
p02658
u923172145
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 = map(int,input().split())\nA = list(map(int, input().split()))\nans = 1\nfor a in A:\n ans *= a\n if ans >= 10**18:\n ans = -1\n break\n \nprint(ans)', 'N = map(int,input().split())\nA = list(map(int, input().split()))\nA.sort()\nans = 1\nfor a in A:\n ans *= a\n #print(ans)\n if ans >= 10**18:\n ans = -1\n break\nprint(ans)', 'N = map(int,input().split())\nA = list(map(int, input().split()))\nans = 1\nfor a in A:\n ans *= a\n\nif ans >= 10**18:\n ans = -1\n\nprint(ans)', 'N = map(int,input().split())\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\n\nprint(ans)', 'N = map(int,input().split())\nA = list(map(int, input().split()))\nA.sort()\nans = 1\nfor a in A:\n ans *= a\n #print(ans)\n if ans > 10**18:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s297615714', 's339786904', 's533826848', 's606406278', 's571987010']
[21696.0, 21768.0, 21780.0, 21636.0, 21636.0]
[49.0, 86.0, 2206.0, 92.0, 85.0]
[170, 172, 141, 159, 171]
p02658
u924828749
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()]\ndef check():\n ans = 1\n for i in range(n):\n ans *= a[i]\n if ans > 10**8:\n return -1\n return ans\n\nprint(check)', 'n = int(input())\na = [int(x) for x in input().split()]\n\ndef check():\n ans = 1\n for i in range(n):\n ans *= a[i]\n return ans\np = check()\n#print(p)\nif p < 10 ** 18:\n print(p)\nelse:\n print(-1)', 'n = int(input())\na = [int(x) for x in input().split()]\na.sort()\n\ndef check():\n ans = 1\n for i in range(n):\n ans *= a[i]\n if ans == 0:\n return 0\n if ans > 10 ** 18:\n return -1\n return ans\np = check()\nprint(p)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s163872745', 's427922473', 's503006428']
[21676.0, 21708.0, 21608.0]
[58.0, 2206.0, 81.0]
[177, 196, 229]
p02658
u925593325
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 numba import njit\nN = int(input())\na = list(map(int, input().split()))\n@njit()\ndef main():\n b = 1\n for i in range(N):\n b *= a[i]\n if 0 in a:\n b = 0\n break\n elif b > 10 ** 18:\n b = 'out'\n break\n if b == 'out':\n print(-1)\n else:\n print(b)\nmain()", "N = int(input())\na = list(map(int, input().split()))\nb = 1\nif 0 in a:\n b = 0\nelse:\n for i in range(N):\n b = b * a[i]\n if b > 10 ** 18:\n b = 'out'\n break\n\nif b == 'out':\n print(-1)\nelse:\n print(b)\n"]
['Runtime Error', 'Accepted']
['s579759414', 's752036931']
[118784.0, 21652.0]
[1121.0, 50.0]
[287, 216]
p02658
u926046014
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\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n if not 0 in a:\n print(-1)\n exit()\n else:\n print(0)\n exit()\n\nprint(ans)', 'n = int(input())\na = input().split()\n\nans = 1\n\nfor i in range(n):\n ans *= int(a[i])\n if ans > 10**18:\n if "0" in a:\n print(0)\n exit()\n else:\n print(-1)\n exit()\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s562119165', 's085732542']
[21708.0, 19492.0]
[51.0, 53.0]
[234, 235]
p02658
u926412290
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\n\nif 0 in A:\n ans = 0\nelse:\n for num in A:\n ans *= num\n if ans > 1e18:\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 num in A:\n ans *= num\n if ans > 1e18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s391821167', 's762046110']
[19328.0, 21596.0]
[46.0, 45.0]
[195, 201]
p02658
u928347588
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()))\na = 1\nfor x in li:\n a *= x\nif a > 10**18:\n print(-1)\nelif n > 10**5:\n print(-1)\nelse:\n print(a)', 'n = input()\nli = list(map(int, input().split()))\na = 1\nif 0 in li:\n print(0)\nelse:\n for x in li:\n a *= x\n if a > 10**18:\n print(-1)\n else:\n print(a)', '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']
['s166557254', 's476951798', 's326147998']
[21560.0, 8960.0, 21656.0]
[2206.0, 23.0, 54.0]
[156, 177, 188]
p02658
u929996201
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 as np\nn = int(input())\narr=list(map(int,input().split()))\np = np.prod(arr)\nif(len(str(p)) > 18):\n print("-1")\n exit(0)\nelse:\n print(p)', 'import numpy as np\nn = int(input())\np = np.prod(list(map(int,input().split())))\nif(len(str(p)) > 18):\n print("-1")\n exit(0)\nelse:\n print(p)', 'def main()\n\tn = int(input())\n \tarr = list(map(input().split()))\n if 0 in arr:\n print(0)\n return\n prod = 1\n for x in arr:\n prod *= x\n if prod > int(1e18):\n print(-1)\n return\n print(prod)\n\nif __name__ == "__main__":\n main()', 'import numpy as np\nn = int(input())\narr = []\narr = map(int, input().split())\np = np.prod(arr)\nif(len(str(p)) > 19):\n print("-1")\n exit(0)\nelse:\n print(c)', 'def main()\n\tn = input()\n \tarr = list(map(input().split()))\n if 0 in arr:\n print(0)\n return\n \tprod = 1\n for x in arr:\n prod *= x\n if prod > int(1e18):\n print(-1)\n return\n print(prod)\n\nif __name__ = "__main__":\n\tmain()', 'def main()\n\tn = input()\n \tarr = list(map(input().split()))\n if 0 in arr:\n return print(0)\n \tprod = 1\n for x in arr:\n prod *= x\n if prod > int(1e18):\n return print(-1)\n print(prod)\n\nif __name__ = "__main__":\n\tmain()', 'def main():\n n = int(input())\n arr = list(map(int, input().split()))\n if 0 in arr:\n print(0)\n return\n prod = 1\n for x in arr:\n prod *= x\n if prod > int(1e18):\n print(-1)\n return\n print(prod)\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s210118436', 's344682512', 's563499409', 's673292069', 's866303323', 's932931589', 's181758469']
[40308.0, 39876.0, 8996.0, 37952.0, 8900.0, 8960.0, 21676.0]
[139.0, 142.0, 24.0, 126.0, 24.0, 26.0, 53.0]
[150, 142, 287, 156, 277, 257, 297]
p02658
u930223782
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()))\nfor i in A:\n B = 1\n B = B * A[i]\n if B >= 10 ** 18\n print(-1)\n sys.exit()\nprint(B)', 'N = int(input())\nA = list(map(int, input().split()))\nfor i in A:\n B = B * A[i]\n if B >= 1000000000000000000\n return print(-1)\nprint(B)', 'N = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n return\nB = 1\nfor i in A:\n B = B * i\n if B >= 10 ** 18:\n print(-1)\n return\nprint(B)', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nB = 1\nfor i in A:\n B = B * i\n if B >= 10 ** 18:\n print(-1)\n sys.exit()\nprint(B)', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nB = 1\nfor i in A:\n B = B * i\n if B >= 10 ** 18\n print(-1)\n sys.exit()\nprint(B)', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n sys.exit()\nB = 1\nfor i in A:\n B = B * i\n if B >= 10 ** 18:\n print(-1)\n sys.exit()\nprint(B)\n', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n sys.exit()\nB = 1\nfor i in A:\n B = B * i\n if B > 10 ** 18:\n print(-1)\n sys.exit()\nprint(B)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s027435571', 's340583993', 's368071628', 's432668766', 's752930410', 's900815759', 's904316489']
[8820.0, 9028.0, 9040.0, 21588.0, 8904.0, 21644.0, 21640.0]
[25.0, 22.0, 24.0, 48.0, 24.0, 50.0, 53.0]
[169, 147, 183, 163, 162, 203, 202]
p02658
u931118906
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\nfor i in a:\n ans*=i\n print(i)\n print(ans)\nif ans>10**18:\n print(-1)\n sys.exit()\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nb=sorted(a,reverse=True)\n\nans=1\nif b[-1]==0:\n print(0) \nelse:\n for i in a:\n ans=ans*i\n if ans>10**18:\n print(-1)\n break\n else:\n print(ans)']
['Wrong Answer', 'Accepted']
['s284453621', 's520544591']
[21776.0, 21696.0]
[2218.0, 75.0]
[160, 238]
p02658
u931154139
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(raw_input())\nlst = list(map(int, raw_input().strip().split()))[:n]\nmx = 1000000000000000000\nif 0 in lst:\n print(0)\nelse:\n cur = lst[0]\n for x in lst[1:]:\n cur = cur * x\n if cur > mx:\n cur = -1\n break\n print(cur)\n', 'n = int(input())\nlst = list(map(int, input().strip().split()))[:n]\nmx = 1000000000000000000\nif 0 in lst:\n print(0)\nelse:\n cur = lst[0]\n for x in lst[1:]:\n cur = cur * x\n if cur > mx:\n cur = -1\n break\n print(cur)\n']
['Runtime Error', 'Accepted']
['s028562137', 's053994390']
[9116.0, 21624.0]
[22.0, 54.0]
[268, 260]
p02658
u931394483
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 = x[0]\nif 0 in x:\n\tans = 0\nelse:\n\tfor i in range(1,n):\n\t\tans = ans * x[i]\n\t\tif ans > 10 ** 18:\n\t\t\tans = -1\n break\nprint(ans)', 'n = int(input())\nx = list(map(int, input().split()))\nans = x[0]\nif 0 in x:\n\tans = 0\n\tbreak\nelse:\n\tfor i in range(1,n):\n\t\tans = ans * x[i]\n\t\tif ans > 10 ** 18:\n\t\t\tans = -1\n\t\t\tbreak\nprint(ans)', 'n = int(input())\nx = list(map(int, input().split()))\nans = x[0]\nif 0 in x:\n\tans = 0\nelse:\n\tfor i in range(1,n):\n\t\tans = ans * x[i]\n\t\tif ans > 10 ** 18:\n\t\t\tans = -1\n\t\t\tbreak\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s103640448', 's294178265', 's150722222']
[9040.0, 8928.0, 21424.0]
[25.0, 28.0, 57.0]
[192, 190, 183]
p02658
u931655383
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())\nt = list(map(int, input().split()))\nto = t[0]\nif 0 in t:\n print(0)\n exit()\nfor a in t[1:]:\n\tto *= a\n if to > 10**18:\n\tprint("-1")\n exit()\nelse:\n print(to)', 'n = int(input())\nt = list(map(int, input().split()))\nto = t[0]\nif 0 in t:\n print(0)\n exit()\nfor a in t[1:]:\n to *= a\n if to > (10**18):\n print("-1")\n exit()\nprint(to)']
['Runtime Error', 'Accepted']
['s664004915', 's027560488']
[8972.0, 21480.0]
[24.0, 54.0]
[180, 188]