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
u519939795
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\nl=list(map(int,input().split()))\na=l[0]\nfor i in range(1,n):\n a*=l[i]\nif a>10**8:\n print(-1)\nelse:\n print(a)', 'n=int(input())\nl=list(map(int,input().split()))\na=1\nfor i in range(n):\n a*=l[i]\nif a>10**8:\n print(-1)\nelse:\n print(a)', 'n=int(input())\nl=list(map(int,input().split()))\na=l[0]\nfor i in range(1,n):\n a*=l[i]\n if a>10**8:\n break\nif a>10**8:\n print(-1)\nelse:\n print(a)', 'n=int(input())\nl=list(map(int,input().split()))\na=l[0]\nfor i in range(1,n):\n a*=l[i]\n if a>=10**18:\n break\nif a>=10**18:\n print(-1)\nelse:\n print(a)', 'n=int(input())\nl=list(map(int,input().split()))\na=l[0]\nfor i in range(1,n):\n a*=l[i]\n if a>=10**8:\n break\nif a>=10**8:\n print(-1)\nelse:\n print(a)', 'n = int(input())\nan = list(map(int,input().split()))\nan.sort()\nif an[0]== 0:\n print(0)\n exit()\nans = 1\nfor a in an:\n ans *= a\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s113613443', 's238903467', 's492145594', 's779934969', 's859545172', 's603123234']
[21532.0, 21712.0, 21568.0, 21612.0, 21516.0, 21620.0]
[2206.0, 2206.0, 48.0, 52.0, 49.0, 80.0]
[132, 127, 162, 166, 164, 202]
p02658
u520843951
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif a.index(0):\n print(0)\n exit()\n \nfor i in range(n):\n ans *= a[i]\n if ans>10**18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n \nfor i in range(n):\n ans = ans * a[i]\n if ans>10**18:\n print(-1)\n exit()\nprint(ans)']
['Runtime Error', 'Accepted']
['s557087031', 's898537056']
[21660.0, 21648.0]
[49.0, 50.0]
[200, 201]
p02658
u521020719
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()))\nprint(nums)\n\nresult = 1\n\nfor num in nums:\n result *= num\n\nif result >= 10 ** 18:\n print(-1)\nelse:\n print(result)', 'N = int(input())\nnums = list(map(int, input().split()))\n\nif 0 in nums:\n print(0)\n exit()\n\nresult = 1\nfor num in nums:\n result *= num\n\n if result >= 10 ** 18:\n print(-1)\n exit()\n\nprint(result)\n\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\nresult = 1\n\nfor num in nums:\n result *= num\n\nif result >= 10 ** 18:\n print(-1)\nelse:\n print(result)', 'N = int(input())\nnums = list(map(int, input().split()))\n\nif 0 in nums:\n print(0)\n exit()\n\nresult = 1\nfor num in nums:\n result *= num\n\n if result >= 10 ** 18:\n print(-1)\n exit()\n\nprint(result)\n\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\nif 0 in nums:\n print(0)\n exit()\n\nresult = 1\nfor num in nums:\n result *= num\n\nif result >= 10 ** 18:\n print(-1)\nelse:\n print(result)\n\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\nif 0 in nums:\n print(0)\n exit()\n\nresult = 1\nfor num in nums:\n result *= num\n\n if result > 10 ** 18:\n print(-1)\n exit()\n\nprint(result)\n\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s138911971', 's520779431', 's702837020', 's797495615', 's846297542', 's299236380']
[21700.0, 21636.0, 21788.0, 21576.0, 21660.0, 21792.0]
[2206.0, 49.0, 2206.0, 50.0, 2206.0, 51.0]
[177, 219, 165, 219, 205, 218]
p02658
u522469665
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())\nnumbers = [int(n) for n in input().split()]\nmlt = 1\nif 0 in n:\n print(0)\nfor n in numbers:\n mlt *= n\n if mlt > 1000000000000000000:\n mlt = -1\n break\nprint(mlt)\n', 'N = int(input())\nnumbers = [int(n) for n in input().split()]\nmlt = 1\nif 0 in numbers:\n print(0)\nelse:\n for n in numbers:\n mlt *= n\n if mlt > 1000000000000000000:\n mlt = -1\n break\n print(mlt)\n']
['Runtime Error', 'Accepted']
['s719399041', 's162746946']
[21652.0, 21576.0]
[50.0, 58.0]
[200, 236]
p02658
u522937309
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \nlist_a.sort(reverse=True)\n# list_a = sort(list_a)\nresult = 1\nfor i in list_a:\n result = result * i\n if len(str(result)) > 18:\n print(-1)\n break\n\nif len(str(result)) <+ 18:\n print(result)\n', 'import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \n\nfor i in list_a:\n result = functools.reduce(operator.mul, list_a)\n\nif result < 10**18:\n print(result)\nelse :\n print(-1)', 'import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \n\nresult = functools.reduce(operator.mul, list_a)\n\nif result < 10**18:\n print(result)\nelse :\n print(-1)\n ', 'import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \nresult = 1\nfor i in list_a:\n result = result * i\n if len(str(result)) > 18:\n print(-1)\n break\n\nif len(str(result)) <+ 18:\n print(result)\n', 'import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \n\nresult = functools.reduce(operator.mul, list_a)\n\nif len(str(result)) < 18:\n print(result)\nelse :\n print(-1)\t\n ', 'n = int(input())\nlist_a=list(map(int, input().split())) \nresu = 1\nfor i in list_a:\n resu = resu * i\n\nif resu < 10**18:\n print(resu)\nelse :\n print(-1)', 'import functools\nimport operator\n\nn = int(input())\nlist_a=list(map(int, input().split())) \nlist_a.sort(reverse=True)\n# list_a = sort(list_a)\nresult = 1\nfor i in list_a:\n result = result * i\n if len(str(result)) > 18:\n print(-1)\n break\n\nif len(str(result)) <= 18:\n print(result)\n', '\nn = int(input())\nlist_a=list(map(int, input().split())) \nlist_a.sort(reverse=True)\n# list_a = sort(list_a)\nresult = 1\nif list_a[-1] == 0 :\n print(0)\nelse:\n for i in list_a:\n result = result * i\n if result > 1000000000000000000:\n print(-1)\n break\n\n if result <= 1000000000000000000:\n print(result)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s126501435', 's325318726', 's380926009', 's527771985', 's598395721', 's681099264', 's822179222', 's252486240']
[22892.0, 22988.0, 22904.0, 22928.0, 22896.0, 21668.0, 22816.0, 21780.0]
[82.0, 2206.0, 2206.0, 65.0, 2206.0, 2206.0, 82.0, 82.0]
[318, 237, 221, 268, 228, 175, 318, 367]
p02658
u523087093
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()))\n\nif 0 in A_list:\n print(0)\n exit()\n\ntotal = 1\nfor i in range(N):\n total = total*A_list[i]\n if total // 10**18 >= 1:\n print(-1)\n exit()\n\nprint(total)\n', 'N = int(input())\nA_list = list(map(int, input().split()))\n\nif 0 in A_list:\n total = 0\nelse:\n total = 1\n for i in range(N):\n total = total*A_list[i]\n if total > 10**18:\n total = -1\n break\nprint(total)\n']
['Wrong Answer', 'Accepted']
['s913534040', 's383282542']
[21696.0, 21772.0]
[54.0, 50.0]
[233, 245]
p02658
u524534026
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=A[0]\nfor i in range(len(A)):\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()))\nans=A[0]\nfor i in range(len(A)):\n ans*=A[i]\n\nif ans>3:\n =10**18:\n print(-1)\nelse:\n print(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nans=A[0]\nfor i in range(len(A)):\n ans*=A[i]\n\nif ans>3=10**18:\n print(-1)\nelse:\n print(ans)', 'import sys\nN=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\n sys.exit()\n\n\nans=1\nfor elem in A:\n ans*=elem\n if ans>10**18:\n print(-1)\n sys.exit()\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s208531180', 's517283241', 's588409506', 's610942356']
[21652.0, 8996.0, 9024.0, 21636.0]
[2206.0, 27.0, 26.0, 57.0]
[146, 153, 147, 201]
p02658
u525302207
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\na.sort()\n\nans = 1\nfor i in a:\n ans *= i\n if ans >= 1000000000000000000:\n ans = -1\n break\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\n\na.sort()\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 1000000000000000000:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s853799044', 's905440371']
[21652.0, 21604.0]
[84.0, 88.0]
[172, 171]
p02658
u526278960
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(i) for i in input().split()]\nx = 1\nf = 0\na.sort()\nfor i in range(n):\n print(a[i])\n x = x*a[i]\n if x == 0:\n print(0)\n f = 1\n break\n elif x > 1000000000000000000:\n print(-1)\n f = 1\n break\nif f == 0:\n print(x)', 'n = int(input())\na = [int(i) for i in input().split()]\nx = 1\nf = 0\na.sort()\nfor i in range(n):\n #print(a[i])\n x = x*a[i]\n if x == 0:\n print(0)\n f = 1\n break\n elif x > 1000000000000000000:\n print(-1)\n f = 1\n break\nif f == 0:\n print(x)']
['Wrong Answer', 'Accepted']
['s048260208', 's364741986']
[21640.0, 21668.0]
[82.0, 80.0]
[289, 290]
p02658
u526407267
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.
['スコード\nm\n1\nimport numpy\n2\nn = int(input())\n3\nm = list(map(int,input().split()))\n4\ns = 1\n5\na = 0\n6\nif 0 in m:\n7\n print(0)\n8\n a =1\n9\nelse:\n10\n for i in range(n):\n11\n s=s*m[i-1]\n12\n if s>10**18:\n13\n print(-1)\n14\n a = 1\n15\n break\n16\nif a == 0:\n17\n print(s)\n※ 512 KiB まで', 'import numpy\nn = int(input())\nm = list(map(int,input().split()))\ns = 1\na = 0\nif 0 in m:\n print(0)\n a =1\nelse:\n for i in range(n):\n s=s*m[i-1]\n if s>10**18:\n print(-1)\n a = 1\n break\nif a == 0:\n print(s)']
['Runtime Error', 'Accepted']
['s845141001', 's247170977']
[9032.0, 40276.0]
[21.0, 136.0]
[302, 226]
p02658
u528087569
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\nls=[int(s) for s in input().split(" ")]\n\nnum=1\n\nfor i in ls:\n num*=i\n \nif num <= 10**1:\n print(num)\nelse:\n print(-1)', 'n=int(input())\nls=[int(s) for s in input().split(" ")]\n\nif 0 in ls:\n print(0)\nelse:\n num=1\n for i in ls:\n num*=i\n if num>10**18:\n num=-1\n break\n\n print(num)']
['Wrong Answer', 'Accepted']
['s879259833', 's864977389']
[21704.0, 21768.0]
[2206.0, 51.0]
[136, 176]
p02658
u528303485
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nans = 1\n\nnums = list(map(lambda x : int(x),input().split()))\n\nfor i in range(n):\n ans *= nums[i]\n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nans = 1\n\nnums = list(map(lambda x : int(x),input().split()))\n\nfor i in range(n):\n if nums[i] == 0:\n ans = 0\n else:\n for k in range(n):\n ans *= nums[k]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nans = 1\n\nnums = list(map(lambda x : int(x),input().split()))\n\nfor i in range(n):\n if nums[i] == 0:\n ans = 0\n break\n \nfor k in range(n):\n ans *= nums[k]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s272676454', 's295019062', 's920672369']
[21784.0, 21648.0, 21792.0]
[51.0, 2206.0, 71.0]
[181, 286, 259]
p02658
u529633325
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['k=input()\na=list(map(int,input().split()))\np=1\ncount=0\nwhile(count<len(a)):\n p*=a[count]\n count+=1\n if(p>pow(10,18)):\n print("-1")\n break\nif(p<pow(10,18)):\n print(p)', 'k=input()\na=list(map(int,input().split()))\np=1\ncount=0\nif(len(a)==0):\n print("0")\nwhile(count<len(a)):\n p*=a[count]\n count+=1\n if(p>pow(10,18)):\n print("-1")\n break\nif(p<pow(10,18)and len(a)>0):\n print(p)', 'k=input()\na=list(map(int,input().split()))\np=1\ncount=0\nif(len(a)==0):\n print("0")\nelif 0 in a:\n print("0")\nelse:\n while(count<len(a)):\n p*=a[count]\n count+=1\n if(p>pow(10,18)):\n print("-1")\n break\n if(p<=pow(10,18)and len(a)>0):\n print(p)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s279979423', 's698650357', 's468043910']
[21644.0, 21580.0, 21584.0]
[79.0, 81.0, 85.0]
[191, 233, 300]
p02658
u529737989
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\nk = 0\nans = 1\nwhile k < n:\n ans = ans * A[k]\n k += 1\n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nA = list(map(int, input().split()))\n\nk = 0\nans = 1\nwhile k < n:\n ans = ans * A[k]\n k = +1\n if ans > 10**18:\n ans = 0\n break\n\nprint(ans)', 'n = int(input())\nA = sorted(list(map(int, input().split())))\n\nk = 0\nans = 1\nfor k in range(n):\n ans *= A[k]\n k += 1\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s181288841', 's277666957', 's102197213']
[21660.0, 21612.0, 21644.0]
[59.0, 2206.0, 98.0]
[177, 175, 185]
p02658
u529922586
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(i) for i in input().split()]\np = 1\nfor i in a:\n\tp*=i\n\tif p==0:\n \tbreak\n\tif p>10**18:\n\t\tp=-1\n break\nif p>10**18:\n\tp=-1\nprint(p)', 'n = int(input())\na = [int(i) for i in input().split()]\np = 1\nfor i in a: \n if i==0:\n print(0)\n exit(0)\nfor i in a:\n p*=i\n if p>10**18:\n p=-1\n break\nprint(p) ']
['Runtime Error', 'Accepted']
['s711045647', 's242965431']
[9016.0, 21468.0]
[24.0, 55.0]
[162, 197]
p02658
u531456543
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\ntotal = 1\nfor i in range(n):\n x = int(input())\n total = total*x\n\nif total <= 1000000000000000000:\n print(total)\nelse:\n print(-1)', 'n = int(input())\n \nList = [int(i) for i in input().split()]\nlst = sorted(List, reverse=True)\nif lst[-1] == 0:\n print(0)\n exit()\ntotal = 1\nfor i in lst:\n total = total*i\n if total > 1000000000000000000:\n print(-1)\n exit()\nprint(total)\n']
['Runtime Error', 'Accepted']
['s629905831', 's922723696']
[12824.0, 21648.0]
[33.0, 81.0]
[150, 244]
p02658
u532141811
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()\n\na = list(map(int, input().split()))\n\ntotal = 1\n\nif a in 0:\n\ttotal = 0\nelse:\n\tfor i in a:\n\t\ttotal *= i\n\nif total > 10**18:\n\ttotal = -1\n\nprint(total)\n', 'n = int(input())\n\na = set(map(int, input().split()))\n\ntotal = 1\n\nfor i in a:\n\ttotal *= i\n\nif total > 10**18:\n\tprint("-1")\nelse:\n\tprint(total)\n', 'n = int(input())\n \na = set(map(int, input().split()))\n \ntotal = 1\n \nfor i in a:\n\ttotal *= i\n \nif total > 10**18:\n\ttotal = -1\n \nprint(int(total))', 'n = int(input())\n\na = set(map(int, input().split()))\n\ntotal = 1\n\nfor i in a:\n\ttotal *= i\n\nif total > 10**18:\n\ttotal = -1\n\nprint(total)\n', 'n = input()\nli = list(map(int, input().split())) \n\ntotal = 1\nli.sort()\nfor a in li:\n if a == 0:\n total = 0\n break\n total *= a\n if 10 ** 18 < total:\n total = -1\n break\nprint(total)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s007071393', 's023137044', 's269548278', 's781879444', 's275039463']
[21768.0, 26980.0, 26924.0, 26984.0, 21584.0]
[51.0, 2206.0, 2206.0, 2206.0, 76.0]
[161, 142, 144, 135, 216]
p02658
u534308356
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 data = list(map(int, input().split()))\n if 0 in data:\n print(0)\n return\n \n c = 1\n for d in data:\n c *= d\n if c >= 10 ** 18:\n print(-1)\n return\n \n print(c)\n\n\nif __name__ == "__main__":\n main()\n', 'def main():\n n = int(input())\n data = list(map(int, input().split()))\n if 0 in data:\n print(0)\n return\n \n c = 1\n for d in data:\n c *= d\n \n if c >= 10 ** 18:\n print(-1)\n else:\n print(c)\n\n\nif __name__ == "__main__":\n main()\n', 'def main():\n n = int(input())\n data = list(map(int, input().split()))\n if 0 in data:\n print(0)\n return\n \n c = 1\n for d in data:\n c *= d\n if c > 10 ** 18:\n print(-1)\n return\n \n print(c)\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s398943916', 's562027430', 's337233759']
[21780.0, 21784.0, 21792.0]
[49.0, 2206.0, 49.0]
[254, 247, 253]
p02658
u534610124
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()))\ndef main():\n maxi = 10*18\n mult = 1\n for a in A:\n mult *= a\n if mult > maxi:\n print(-1)\n return \n print(mult)\n\nmain()', 'N = int(input())\nA = list(map(int, input().split()))\ndef main():\n maxi = 10*18\n mult = 1\n for a in A:\n mult *= a\n if mult > maxi:\n print("-1")\n return \n print(mult)\n\nmain()', 'N = int(input())\nA = list(map(int, input().split()))\nmaxi = 10**18\ndef main():\n if 0 in A:\n print(0)\n return\n mult = 1\n for a in A:\n mult *= a\n if mult > maxi:\n print(-1)\n return \n print(mult)\n\nmain()']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s549224121', 's920895185', 's878079857']
[21656.0, 21444.0, 21564.0]
[44.0, 50.0, 50.0]
[218, 220, 262]
p02658
u536560967
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.
['#!/usr/bin/env python3\nfrom decimal import Decimal\na, b = input().split()\na = Decimal(int(a))\nb = Decimal(b)\nprint(int(a * b))', '#!/usr/bin/env python3\nimport numpy as np\nn = int(input()) \nA = list(map(int, input().split()))\ni = 10 ** 18\nans = np.prod(A)\nelif ans > i:\n print(-1)\nelse:\n print(int(ans))', '#!/usr/bin/env python3\nn = int(input()) \nA = list(map(int, input().split()))\nb = 1\ni = 10**18\nA = sorted(A)\nfor a in A:\n if b > i:\n break\n b *= a\nprint(-1 if b > i else b)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s343431440', 's625078572', 's278164351']
[9736.0, 9028.0, 21716.0]
[27.0, 23.0, 96.0]
[126, 179, 176]
p02658
u536642030
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 decimal\nn = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(-1)\nelse:\n flag = True\n for i in a:\n ans *= i\n if ans >= (10 ** 18):\n print(-1)\n flag = False\n break\n if flag:\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 else:\n flag = True\n for i in a:\n ans *= i\n if ans > (10 ** 18):\n print(-1)\n return\n print(ans)\n \nmain()\n']
['Wrong Answer', 'Accepted']
['s171445107', 's377864583']
[22740.0, 21612.0]
[61.0, 59.0]
[245, 256]
p02658
u536685012
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\n if ans >= 10**18:\n for j in range(i, n):\n if a[j] == 0:\n ans = 0\n break\n else:\n ans = -1\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\na = sorted(a)\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n \n if ans == 0:\n break\n \n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\na = sorted(a)\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n \n if ans == 0:\n break\n \n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s001716537', 's294613412', 's753686023']
[21648.0, 21596.0, 21636.0]
[2206.0, 80.0, 82.0]
[277, 196, 196]
p02658
u537217069
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\nΠ = 1\nfor _ in A:\n Π *= _\n if(Π > 1000000000000000000):\n print(-1)\n return \n\nprint(Π)', 'N = int(input())\nA = list(map(int, input().split()))\n\nΠ = 0\nfor _ in A:\n Π *= _\n if(Π > 10e+18):\n print(-1)\n exit(0)\n\nprint(Π)\n', 'import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n sys.exit(0) \n\nΠ = 1\nfor _ in A:\n Π *= _\n if(Π > 1000000000000000000):\n print(-1)\n sys.exit(0)\n\nprint(Π)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s708605110', 's811732240', 's275442767']
[9164.0, 22276.0, 21836.0]
[25.0, 62.0, 60.0]
[200, 151, 222]
p02658
u537538698
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['x = input()\nt = int(x)\nx2 = input()\nn = list(map(int, x2.split(" ")))\n\n\ndef main():\n p = 1\n for v in range(t):\n p *= n[v]\n if (p >= 10 **18):\n print("-1")\n return\n print(p)\n\nmain()\n', 'x = input()\nt = int(x)\nx2 = input()\nn = list(map(int, x2.split(" ")))\n\n\ndef main():\n p = 1\n for v in t:\n p *= n[v]\n if (p >= 10 **18):\n print("-1")\n return\n print(p)\n\nmain()\n', 'x = input()\nt = int(x)\nx2 = input()\nn = list(map(int, x2.split(" ")))\n\n\ndef main():\n if 0 in n:\n print(0)\n return\n p = 1\n for v in range(t):\n p *= n[v]\n if (p > 10 **18):\n print("-1")\n return\n print(p)\n\nmain()\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s050339048', 's104216007', 's782182043']
[23608.0, 23472.0, 23464.0]
[45.0, 49.0, 48.0]
[200, 193, 236]
p02658
u537722973
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 = 1\na = list(map(int,input().split()))\nfor i in range(n):\n x *= a[i]\nif x >= 10**18:\n print(-1)\nelse:\n print(x)', 'n = input()\nlista = list(map(int,input().split()))\nr = 1\n\nif 0 in a:\n print(0)\nelse:\n for a in lista:\n r *= a\n if r > 10**18:\n print(-1)\n break\n else:\n print(r)', 'n = input()\nlista = list(map(int,input().split()))\nr = 1\n\nif 0 in lista:\n print(0)\nelse:\n for a in lista:\n r *= a\n if r > 10**18:\n print(-1)\n break\n else:\n print(r)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s215761060', 's523871103', 's990340619']
[21716.0, 21712.0, 21636.0]
[2206.0, 49.0, 50.0]
[133, 182, 186]
p02658
u538632589
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['from functools import reduce\nn = int(input())\na = list(map(int, input().split()))\nm = 10**18\n\nres = reduce(lambda x,y: x*y, a)\nres = 1\nfor n in a:\n res *= a\n if res > m:\n print(-1)\n exit()\n \nprint(res)', 'n = int(input())\na = list(map(int, input().split()))\nm = 10**18\nif 0 in a:\n print(0)\n exit()\nres = 1\nfor i in a:\n res *= i\n print(res)\n if res > m:\n print(-1)\n exit()\n\nprint(res)', 'n = int(input())\na = list(map(int, input().split()))\nm = 10**18\nif 0 in a:\n print(0)\n exit()\nres = 1\nfor i in a:\n res *= i\n if res > m:\n print(-1)\n exit()\n\nprint(res)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s566229723', 's863973953', 's913601072']
[22928.0, 21472.0, 21600.0]
[2206.0, 77.0, 50.0]
[224, 207, 192]
p02658
u540746268
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["from functools import reduce\nimport operator\n\n\n\nN = int(input())\n\na = list(map(int, input().split()))\n\n\n\nsum=reduce(operator.mul, a, 1)\n\n\n\nif sum < 1000000000000000000:\n print(sum)\nelse:\n print('-1')", "import numpy as np\n\nN=int(input())\n\n\na = list(map(int, input().split()))\n\n\n\nif np.prod(a)>=0:\n sum=np.prod(a)\nelse:\n print('-1')\n\nif sum<1000000000000000000:\n print(sum)\nelse:\n print('-1')\n", "import numpy as np\n\nN=int(input())\n\n\na = list(map(int, input().split()))\n\n\n\nif np.prod(a)>=0:\n sum=np.prod(a)\nelse:\n sum=-1\n\nif sum<1000000000000000000:\n print(sum)\nelse:\n print('-1')\n", "import numpy as np\n\nN = int(input())\n\na = list(map(int, input().split()))\n\nsum = a[0]\n\nif a.count(0)>=0:\n print('0')\n exit()\n\n\nfor i in range(1, N):\n sum = sum * a[i]\n if sum > pow(10, 18):\n print('-1')\n break\n\n", "import numpy as np\n\nN = int(input())\n\na = list(map(int, input().split()))\n\nsum = a[0]\n\n\nif 0 in a:\n print('0')\n exit()\n\nfor i in range(1, N):\n sum = sum * a[i]\n if sum > 10**18:\n print('-1')\n exit()\n\nprint(sum)\n\n\n"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s510074781', 's847870155', 's911263430', 's983950676', 's020872535']
[22756.0, 40000.0, 40060.0, 40248.0, 40096.0]
[2206.0, 146.0, 151.0, 138.0, 134.0]
[205, 201, 196, 237, 239]
p02658
u540877546
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())\nli = input().split(" ")\nx = 1\nif 0 in li:\n print(0)\nelse:\n for i in li:\n x = x * i\n if x > 10**18:\n print(-1)\n exit()\n print(x)\n', 'n = int(input())\nlist = input().split(" ")\nx = 1\nif 0 in list:\n print(0)\nelse:\n for i in list:\n x = x * i\n if x > 10**18:\n print(-1)\n exit()\n print(x)\n', 'n = int(input())\nlist = input().split(" ")\n\nif \'0\' in list:\n print(0)\n exit()\n\nx = 1\nfor i in list:\n x = x * int(i)\n if x > 10**18:\n print(-1)\n exit()\nprint(x)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s543261216', 's741662306', 's426572335']
[19308.0, 19348.0, 19408.0]
[36.0, 35.0, 45.0]
[190, 170, 186]
p02658
u541017633
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_ = input()\nA = list(map(int, input().split()))\nb = np.prod(A)\nb = b if b < 10 ** 18 else -1\nprint(b)', '_ = input()\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n if ans <= 10 ** 18:\n break\n\nans = ans if ans <= 10 ** 18 else -1\nprint(ans)\n', '_ = input()\nA = list(map(int, input().split()))\nb = np.prod(A)\nb = b if b < 10 ** 18 else -1\nprint(b)', '_ = input()\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n\n if ans > 10 ** 18:\n break\nans = 0 if 0 in A else ans\nans = ans if ans <= 10 ** 18 else -1\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s187327894', 's902322420', 's919910430', 's504581776']
[40064.0, 21636.0, 21776.0, 21624.0]
[142.0, 48.0, 49.0, 49.0]
[120, 169, 101, 195]
p02658
u542739769
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.
['\nA = input()\nN = input().split()\nN = [int(s) for s in N]\n\nans = 1\nmax = 1000000000000000000\nfor i in range(len(N)):\n ans = ans * N[i]\n\nif ans >= max:\n print(-1)\nelse:\n print(ans)', 'import sys\ninput = sys.stdin.readline\n\nA = input()\nN = list(map(int, input().split()))\n\nans = 1\nmax = 10**18\nif 0 in N:\n print(0)\nelse:\n for i in range(len(N)):\n ans = ans * N[i]\n if ans > max:\n ans = -1\n break\n print(ans)']
['Wrong Answer', 'Accepted']
['s891893694', 's025655689']
[21556.0, 21880.0]
[2206.0, 50.0]
[181, 241]
p02658
u543489264
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()))\nA.sort()\n\nans = int(0)\nif(A[0] == 0):\n ans = 0\nelse:\n ans = np.prod(A)\n\nif ans >= 1e18:\n print('-1')\nelse:\n print(f'{ans}')", "import numpy as np\nimport math\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\nans = np.prod(A)\n\nif ans >= pow(10,18):\n print('-1')\nelse:\n print(ans)", 'N = int(input())\nA = [map(int, input().split())]\nans = int(0)\nfor i in A:\n ans *= i\n if ans >= 1e18:\n ans = -1\n break', 'N = int(input())\nA = list(map(int,input().split()))\nMAX = 1e18\n\nA.sort()\n\nans = 1\nfor i in A:\n ans *= i\n if ans > MAX:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s399558369', 's809814843', 's929194660', 's257260125']
[40156.0, 40172.0, 19476.0, 21596.0]
[170.0, 162.0, 33.0, 86.0]
[209, 171, 125, 167]
p02658
u543690404
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int,input().split()))\nresult = 1\n\nfor an in a:\n if an == 0:\n result = 0\n break\n result = an*result\n print(result)\n \nif result > 10**18:\n result = -1\n \nprint(result)', 'n = int(input())\na = list(map(int,input().split()))\nresult = 1\ntarget = 10**18\n \nif a.count(0) >= 1:\n result = 0\nelse:\n for an in a:\n result = an*result\n print(result)\n if result > target:\n result = -1\n break\n \nprint(result)', 'n = int(input())\na = list(map(int,input().split()))\nresult = 1\ntarget = 10**18\n \nif a.count(0) >= 1:\n result = 0\nelse:\n for an in a:\n result = an*result\n if result > target:\n result = -1\n break\n \nprint(result)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s672095875', 's969216583', 's972398063']
[21788.0, 21632.0, 21464.0]
[2228.0, 74.0, 49.0]
[206, 245, 227]
p02658
u543951630
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 = input().split()\nmul = int(nums[0])\nif str(0) in nums:\n mul = 0\nelse:\n for i in nums[1:]:\n mul *= int(i)\n if len(str(mul)) >= 19:\n mul = -1\n break\nprint(mul)', 'N = int(input())\nnums = input().split()\nmul = int(nums[0])\nfor i in nums[1:]:\n if str(0) in mul:\n mul = 0\n break\n if len(str(mul)) > 19:\n mul = -1\n break\n mul *= int(i)\nprint(mul)', 'N = int(input())\nnums = input().split()\nmul = int(nums[0])\nif str(0) in nums:\n mul = 0\nelse:\n for i in nums[1:]:\n mul *= int(i)\n if len(str(mul)) >= 19:\n print(mul)\n mul = -1\n break\nprint(mul)', 'N = int(input())\nnums = input().split()\nmul = int(nums[0])\nif str(0) in nums:\n mul = 0\nelse:\n for i in nums[1:]:\n mul *= int(i)\n if len(str(mul)) >= 19 and str(mul) != "1000000000000000000":\n mul = -1\n break\nprint(mul)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s072915333', 's459073047', 's728640860', 's690951533']
[19376.0, 19440.0, 19376.0, 19404.0]
[72.0, 36.0, 69.0, 65.0]
[222, 216, 245, 260]
p02658
u544165032
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()))\nprod = 1\ndef main()\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()', '\nN = int(input())\nA = list(map(int, input().split()))\nfor i in range(N):\n B = B * A[i]\n if B > 10 ** 18:\n print(-1)\n break\nif B <= 10 ** 18:\n print(B)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n ans *= i\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s139488716', 's784652551', 's861433337']
[8972.0, 21632.0, 21736.0]
[23.0, 50.0, 51.0]
[257, 173, 187]
p02658
u544587633
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.
['#!/usr/bin/env python3\nimport sys\nimport numpy as np\n\ndef solve(N: int, A: "List[int]"):\n A = np.asarray(A)\n\n\n ans = np.prod(A)\n\n if ans >= 10**18:\n print(-1)\n else:\n print(ans)\n return\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n A = [int(next(tokens)) for _ in range(N)] # type: "List[int]"\n solve(N, A)\n\nif __name__ == \'__main__\':\n main()\n', '#!/usr/bin/env python3\nimport sys\n\ndef solve(N: int, A: "List[int]"):\n A.sort()\n ans =1\n for a in A:\n ans = ans * a\n\n if ans > 10**18:\n print(-1)\n return\n \n print(ans)\n return\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n A = [int(next(tokens)) for _ in range(N)] # type: "List[int]"\n solve(N, A)\n\nif __name__ == \'__main__\':\n main()\n']
['Wrong Answer', 'Accepted']
['s291117427', 's458664777']
[43104.0, 24308.0]
[150.0, 94.0]
[710, 725]
p02658
u545644875
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 0 in A:\n print(0)\n exit()\n\n \nans = 1\nA.sort(reverse = True)\nfor i in range(len(A)):\n ans = ans * A[i] \n if ans > lim:\n print(-1)\n exit()\n\nif ans > lim:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nlim = 10**18\n\nif 0 in A:\n print(0)\n exit()\n\n \nans = 1\nA.sort(reverse = True)\nfor i in range(len(A)):\n ans = ans * A[i] \n if ans > lim:\n print(-1)\n exit()\n\nif ans > lim:\n print(-1)\nelse:\n print(ans)']
['Runtime Error', 'Accepted']
['s127545116', 's381885047']
[9116.0, 21696.0]
[22.0, 60.0]
[196, 262]
p02658
u545805271
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 = input()\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n sys.exit()\n\nb=1\nfor i in range(0,N):\n b *= a[i]\n if b > 1000000000000000000:\n print(-1)\n sys.exit\n\nprint(b)', 'import sys\nN = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n sys.exit()\n\nb=1\nfor i in range(0,N):\n b *= a[i]\n if b > 1000000000000000000:\n print(-1)\n sys.exit()\n\nprint(b)']
['Runtime Error', 'Accepted']
['s227413805', 's451497051']
[21616.0, 21648.0]
[54.0, 52.0]
[215, 222]
p02658
u547608423
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\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > pow(10, 18):\n ans = -1\n break\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > pow(10, 18):\n ans = -1\n break\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s294735194', 's025275610']
[19352.0, 21468.0]
[44.0, 65.0]
[199, 205]
p02658
u547764399
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()))\nfor i in A:\n anser *= i\nif 0 in A:\n print(0)\nif anser > 10 ** 18:\n print("-1")\nelse:\n print(anser)', 'N = int(input())\nA = list(map(int,input().split()))\nanser = 0\nfor i in A:\n anser *= i\nif 0 in A:\n print(0)\nif anser > 10 ** 18:\n print("-1")\nelse:\n print(anser)', 'N = int(input())\nA = list(map(int,input().split()))\nanser = 1\nif 0 in A:\n print("0")\n exit()\nfor i in A:\n anser *= i\n if anser > 10 ** 18:\n print("-1")\n exit()\nprint(anser)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s473134902', 's868924279', 's167646451']
[21632.0, 21496.0, 21772.0]
[53.0, 54.0, 54.0]
[162, 172, 198]
p02658
u548069143
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.
['\na=int(input())\nb=list(map(int, input().split()))\nc=1\nif 0 in b:\n d=1\nfor i in range(a):\n c*=b[i]\n if d!=1 and c>10**18:\n print(-1)\n exit()\n\n\nprint(c)\n', '\na=int(input())\nb=list(map(int, input().split()))\nc=1\nd=0\nif 0 in b:\n print(0)\n exit()\nfor i in range(a):\n c*=b[i]\n if c>10**18:\n print(-1)\n exit()\n\n\nprint(c)\n']
['Runtime Error', 'Accepted']
['s619460661', 's016850727']
[21788.0, 21480.0]
[2206.0, 52.0]
[174, 185]
p02658
u548525760
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nans = 1\nlim = 10 ** 18\nl = 0\n\nA = list(map(int, input().split()))\n\nA0 = set(A)\nif 0 in A0:\n ans = 0\nelse:\n pass\n\nfor n in range(N):\n ans = ans * A[n]\n if ans == 0:\n break\n elif ans >= lim:\n l = 1\n break\n else:\n pass\n\nif l == 1:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nans = 1\n\nA = list(map(int, input().split()))\n\nfor n in range(N):\n ans = ans * A[n]\n\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nans = 1\nlim = 10 ** 18\nl = 0\n\nA = list(map(int, input().split()))\n\nA0 = set(A)\nif 0 in A0:\n ans = 0\nelse:\n pass\n\nfor n in range(N):\n ans = ans * A[n]\n if ans == 0:\n break\n elif ans > lim:\n l = 1\n break\n else:\n pass\n\nif l == 1:\n print(-1)\nelse:\n print(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s769137621', 's860885370', 's251518944']
[21608.0, 21744.0, 21648.0]
[65.0, 2206.0, 64.0]
[293, 150, 292]
p02658
u549383771
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())\nnum_list = list(map(int,input().split()))\nans = 1\nif 0 in num_list:\n print(0)\n \nelse:\n for i in num_list:\n print(ans)\n ans *= i\n if ans > 10**18:\n break\n\n if ans > 10**18:\n print(-1)\n\n else:\n print(ans)\n', 'n = int(input())\nnum_list = list(map(int,input().split()))\nans = 1\nif 0 in num_list:\n print(0)\n \nelse:\n for i in num_list:\n ans *= i\n if ans > 10**18:\n break\n\n if ans > 10**18:\n print(-1)\n\n else:\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s141823362', 's932818928']
[21648.0, 21644.0]
[77.0, 50.0]
[281, 262]
p02658
u551437236
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 ans = 1\n for i in a:\n ans = ans*i\n if ans > 1000000000000000000 and i !== 0:\n print(-1)\n ans = -1\n break\n if ans != -1:\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans = ans*i\n if i == 0:\n print(0)\n ans = -1\n break\n elif ans > 1000000000000000000 and i !== 0:\n print(-1)\n ans = -1\n break\nif ans != -1:\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans = ans*i\n if ans > 1000000000000000000:\n print(-1)\n ans = -1\n break\nif ans != -1\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans = ans*i\n if ans > 1000000000000000000:\n print(-1)\n ans = -1\n break\n if ans != -1:\n print(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s258783132', 's410792622', 's603792715', 's631169268']
[8960.0, 9036.0, 9024.0, 21436.0]
[24.0, 27.0, 24.0, 50.0]
[279, 278, 200, 267]
p02658
u551906883
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())\narray=input().split(" ")\nsum=1\nfor j in range(N):\n if array[j]=="0":\n sum=0\nif sum!=0:\n for i in range(N):\n sum=sum*int(array[i])\n if sum>1000000000000000000:\n sum=-1\n break\n else:\n continue\n break\n ', 'N=int(input())\narray=input().split(" ")\nsum=1\nfor j in range(N):\n if array[j]=="0":\n sum=0\nif sum!=0:\n for i in range(N):\n sum=sum*int(array[i])\n if sum>1000000000000000000:\n sum=-1\n break\n else:\n continue\n break\n ', 'N=int(input())\narray=input().split(" ")\nsum=1\nfor j in range(N):\n if array[j]=="0":\n sum=0\nif sum!=0:\n for i in range(N):\n sum=sum*int(array[i])\n if sum>1000000000000000000:\n sum=-1\n break\n else:\n continue\n break\nprint(sum)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s284098119', 's872617467', 's418777173']
[19364.0, 19300.0, 19440.0]
[54.0, 56.0, 56.0]
[253, 253, 259]
p02658
u552145906
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = input()\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nAns = 1\nfor i in range(0,len(A)):\n Ans *= A[i]\n if Ans > 10**9:\n print(-1)\n exit()\n else:\n continue\nprint(Ans)', 'N = int(input())\nA = list(map(int, input().split()))\nnum = 1\nfor i in range(0,N):\n if A[i]==0:\n \tnum=0\n \tbreak\n else:\n \t\tnum *= A[i]\n \nif num>10**18:\n print(-1)\nelse:\n print(num)', 'N = int(input())\nA = list(map(int, input().split()))\nnum = 1\nfor i in range(0,N):\n if A[i]==0:\n \tnum=0\n \tbreak\n else if num>10**18:\n break\n else:\n num *=A[i]\n \n \nif num>10**18:\n print(-1)\nelse:\n print(num)', 'N = input()\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nAns = 1\nfor i in range(0,len(A)):\n Ans *= A[i]\n if Ans > 10**18:\n print(-1)\n exit()\n else:\n continue\nprint(Ans)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s106917158', 's400434652', 's601195117', 's900796976']
[21620.0, 9032.0, 8924.0, 21632.0]
[49.0, 23.0, 23.0, 52.0]
[225, 202, 241, 226]
p02658
u552510302
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())\nnum_list=list(map(int,input().split()))\nans = 1\nfor i in n:\n ans = ans*num_list[i]\nif ans <1000000000000000000:\n print(ans)\nelse:\n print("-1")', 'n = int(input())\nnum_list=list(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans = ans*num_list[i]\nif ans <1000000000000000000:\n print(ans)\nelse:\n print("-1")', 'n,m = map(int,input().split())\nans = n *m\nif ans <1000000000000000000:\n print(ans)\nelse:\n print("-1")', 'n = int(input())\nnum_list=list(map(int,input().split()))\nans = 1\nflg = True\nif 0 in num_list:\n print("0")\nelse:\n for i in range(n):\n ans = ans*num_list[i]\n \n if ans > 10**18:\n print("-1")\n flg = False\n break\n if flg:\n print(ans)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s440408036', 's493926671', 's535688434', 's964263517']
[21748.0, 21656.0, 9176.0, 21660.0]
[47.0, 2206.0, 24.0, 50.0]
[162, 169, 103, 256]
p02658
u553308611
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()))\nif t > 1e18:\n print(-1)\nelse:\n print(np.prod(A))\n', 'N = int(input())\nA = list(map(int, input().split()))\nt = A[0]\nfor i in range(1, N):\n t *= A[i]\n if t > 1e18:\n print(-1)\n break\nif t < 1e18:\n print(t)\n', '#import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\n#A = np.array(A)\nt = A[0]\nfor i in range(1,N):\n t *= A[i]\n if int(t) > 1e18:\n for j in range(i,N):\n if A[j] == 0:\n t = 0\n break\nprint(t)\nif int(t) <= 1e18:\n print(int(t))\nelse:\n print(-1)\n', '#import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\n#A = np.array(A)\nt = A[0]\nfor i in range(N):\n t *= A[i]\n if int(t) > 1e18:\n for j in range(i,N):\n if A[j] == 0:\n t = 0\n break\nif int(t) <= 1e18:\n print(int(t))\nelse:\n print(-1)\n', '#import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\n#A = np.array(A)\nt = A[0]\nfor i in range(1,N):\n t *= A[i]\n if int(t) > 1e18:\n for j in range(i,N):\n if A[j] == 0:\n t = 0\n break\nif int(t) <= 1e18:\n print(int(t))\nelse:\n print(-1)\n']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s059286867', 's193746940', 's285909314', 's595598146', 's282434038']
[40276.0, 21644.0, 21780.0, 21656.0, 21708.0]
[131.0, 50.0, 58.0, 63.0, 59.0]
[127, 174, 313, 302, 304]
p02658
u553623615
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 x in a:\n ans *= x\n if ans >= (10 ** 18):\n ans = -1\n break\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nans = 1\nfor x in a:\n ans *= x\n if ans > (10 ** 18):\n ans = -1\n break\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s602434373', 's523879009']
[21628.0, 21780.0]
[48.0, 92.0]
[143, 150]
p02658
u554237650
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.
['str = int(input())\nstr2 = input()\n\nstr3 = str2.split(" ")\n\nres = 1\nfor i in range(0, str):\n res *= int(str3[i])\n\nif res >= 10 ** 18:\n res = -1\n \nprint(res)', 'str = int(input())\nstr2 = input()\n\nstr3 = str2.split(" ")\n\nres = 1\nfor i in range(0, str):\n res *= int(str3[i])\n if res >= 10 ** 18:\n res = -1\n break\n\n \nprint(res)', 'str = int(input())\nstr2 = input()\nstr3 = str2.split(" ")\nres = 1\nisZero = False\n\n\nfor i in range(0, str):\n if 0 == int(str3[i]):\n isZero = True\n res = 0\n\nif not isZero:\n for i in range(0, str):\n res *= int(str3[i])\n if res > 10 ** 18:\n res = -1\n break\n\n \nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s022135287', 's101104101', 's772415251']
[20268.0, 19512.0, 19404.0]
[2206.0, 46.0, 68.0]
[164, 186, 351]
p02658
u554781254
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\nsys.setrecursionlimit(10 ** 9)\ninput = sys.stdin.readline\n\nfrom operator import mul\nfrom functools import reduce\n\nimport numpy as np\n\n""" Input\nS = input().rstrip()\nN, A, B = map(int, input().split())\nA = list(map(int, input().split()))\nA = np.array(input().split(), dtype=np.float64)\nD = [int(input()) for _ in range(N)]\nAB = [[int(x) for x in input().split()] for _ in range(N)]\nPX = [[int(x) for x in input().split()] for _ in range(Q)]\n"""\n\nN = int(input())\nA = np.array(input().split(), dtype=np.int)\n# A = list(map(int, input().split()))\n\n\ntotal = A.prod()\nif total > 10 ** 18:\n print(-1)\nelse:\n print(total)\n', 'import sys\n\nsys.setrecursionlimit(10 ** 9)\ninput = sys.stdin.readline\n\n""" Input\nS = input().rstrip()\nN, A, B = map(int, input().split())\nA = list(map(int, input().split()))\nD = [int(input()) for _ in range(N)]\nAB = [[int(x) for x in input().split()] for _ in range(N)]\nPX = [[int(x) for x in input().split()] for _ in range(Q)]\n"""\nimport numpy as np\n\nN = int(input())\nA = np.array(input().split(), dtype=np.float128)\n\ntotal = np.prod(A)\nif total > 10 ** 18:\n print(-1)\nelse:\n print(total)\n\n\n', 'import sys\n\nsys.setrecursionlimit(10 ** 9)\ninput = sys.stdin.readline\n\nfrom operator import mul\nfrom functools import reduce\n\nimport numpy as np\n\n""" Input\nS = input().rstrip()\nN, A, B = map(int, input().split())\nA = list(map(int, input().split()))\nA = np.array(input().split(), dtype=np.float64)\nD = [int(input()) for _ in range(N)]\nAB = [[int(x) for x in input().split()] for _ in range(N)]\nPX = [[int(x) for x in input().split()] for _ in range(Q)]\n"""\n\nN = int(input())\nA = np.array(input().split(), dtype=np.int)\n# A = list(map(int, input().split()))\n\n\ntotal = A.cumprod()\nscore = total[-1]\n# print(total)\n\nif score > 10 ** 18:\n print(-1)\nelse:\n print(score)\n# if total > 10 ** 18:\n# print(-1)\n# else:\n# print(total)\n', 'import sys\n\nsys.setrecursionlimit(10 ** 9)\ninput = sys.stdin.readline\n\nN = int(input())\nA = list(map(int, input().split()))\n\nlimit = 10 ** 18\nA = sorted(A)\n\ntotal = A[0]\nif total == 0:\n print(total)\n exit()\n\nfor a in A[1:]:\n total *= a\n if total > limit:\n print(-1)\n exit()\nprint(total)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s366409266', 's574813860', 's941072903', 's265151850']
[44852.0, 45600.0, 44888.0, 21732.0]
[146.0, 190.0, 152.0, 75.0]
[657, 499, 760, 313]
p02658
u554850896
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\nt = 0\nfor i in range(N):\n x*= A[i]\n if x>= pow(10,18):\n t = 1\n break\nif t == 1:\n print(-1)\nelse:\n print(x)\n \n ', 'N = int(input())\nA = list(map(int,input().split()))\nx = 1\nt = 0\nA.sort()\nfor i in range(N):\n x*= A[i]\n if x>10**18:\n t = 1\n break\n \nif t == 1:\n print(-1)\nelse:\n print(x)\n \n \n']
['Wrong Answer', 'Accepted']
['s508750790', 's528569668']
[21588.0, 21524.0]
[82.0, 89.0]
[180, 187]
p02658
u554878981
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 prod = 1\n for el in A:\n prod *= el\n if prod > 1e18:\n print(-1)\n return\n print (prod)', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n \n if 0 in A:\n print(0)\n return\n \n prod = 1\n for el in A:\n prod *= el\n if prod > 1e18:\n print(-1)\n return\n print (prod)\n \n \nmain()']
['Wrong Answer', 'Accepted']
['s739507489', 's152035046']
[9108.0, 21588.0]
[23.0, 48.0]
[216, 229]
p02658
u556594202
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 if ans >= 10**18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\n\nans=1\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 ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s591852383', 's916635607']
[21696.0, 21592.0]
[57.0, 59.0]
[162, 208]
p02658
u558528117
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# from collections import defaultdict\n# from collections import Counter\n# from queue import Queue\nimport math\n\ndef main():\n N = int(input())\n\n As = [int(s) for s in input().split()]\n logsum = 0\n prod = 1\n for a in As:\n if a == 0:\n print('0')\n return\n\n logsum += math.log10(a)\n\n if logsum >= 18:\n print('-1')\n return\n\n for a in As:\n prod *= a\n\n print(prod)\n\n # As = []\n \n # tmp = int(input())\n # As.append(tmp)\n\n return 0\n\nif __name__ == '__main__':\n sys.exit(main())\n", "import sys\n# from collections import defaultdict\n# from collections import Counter\n# from queue import Queue\nimport math\n\ndef main():\n N = int(input())\n\n As = [int(s) for s in input().split()]\n logsum = 0\n prod = 1\n for a in As:\n if a == 0:\n print('0')\n return\n\n logsum += math.log10(a)\n # sys.stderr.write('{}\\n'.format(logsum))\n\n\n if logsum > 18:\n print('-1')\n return\n\n for a in As:\n prod *= a\n\n if prod >= 10 ** 18:\n print('-1')\n return\n print(prod)\n\n # As = []\n \n # tmp = int(input())\n # As.append(tmp)\n\n return 0\n\nif __name__ == '__main__':\n sys.exit(main())\n", "import sys\n# from collections import defaultdict\n# from collections import Counter\n# from queue import Queue\nimport math\n\ndef main():\n N = int(input())\n\n As = [int(s) for s in input().split()]\n logsum = 0\n prod = 1\n for a in As:\n logsum += math.log10(a)\n\n if logsum >= 18:\n print('-1')\n return\n\n for a in As:\n prod *= a\n\n print(prod)\n\n # As = []\n \n # tmp = int(input())\n # As.append(tmp)\n\n return 0\n\nif __name__ == '__main__':\n sys.exit(main())\n", "import sys\n# from collections import defaultdict\n# from collections import Counter\n# from queue import Queue\nimport math\n\ndef main():\n N = int(input())\n\n As = [int(s) for s in input().split()]\n logsum = 0\n prod = 1\n for a in As:\n if a == 0:\n print('0')\n return\n\n logsum += math.log10(a)\n # sys.stderr.write('{}\\n'.format(logsum))\n\n\n if logsum > 18.2:\n print('-1')\n return\n\n for a in As:\n prod *= a\n\n if prod > 10 ** 18:\n print('-1')\n return\n print(prod)\n\n # As = []\n \n # tmp = int(input())\n # As.append(tmp)\n\n return 0\n\nif __name__ == '__main__':\n sys.exit(main())\n"]
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s475054687', 's591592649', 's755055594', 's898443076']
[22524.0, 22204.0, 22828.0, 22080.0]
[65.0, 64.0, 63.0, 67.0]
[605, 715, 543, 716]
p02658
u558720836
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = [int(x) for x in input().split()]\nans = 1\nflag = False\nfor i in a:\n ans *= i\n if (ans >= pow(10,18)):\n flag = True\n\nif (flag):\n ans = -1\nif 0 in a:\n ans = 0\n\nprint(ans)\n\n\n', 'n = int(input())\na = [int(x) for x in input().split()]\nans = 1\nflag = False\nzeros = False\nover = pow(10,18)\nfor i in a:\n if flag == False:\n ans *= i\n if (ans > over):\n flag = True\n if i == 0:\n zeros = True\n\nif (flag):\n ans = -1\nif (zeros):\n ans = 0\n\nprint(ans)\n\n\n']
['Wrong Answer', 'Accepted']
['s621005086', 's072001572']
[21476.0, 21652.0]
[2206.0, 62.0]
[211, 299]
p02658
u558932457
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.
['# your code goes here\nn = int(input())\na = input().split()\nres = 1\nzero = 0\nfor e in range(n):\n\tif e == 0:\n\t\tzero = 1\nfor e in range(n):\n\tres *= int(a[e])\n\tif res > 1000000000000000000:\n\t\tbreak\nif zero == 1:\n\tprint(0)\nelif res > 1000000000000000000:\n\tprint(-1)\nelse:\n\tprint(res)', '# your code goes here\nn = int(input())\na = input().split()\nres = 1\nzero = 0\nfor e in range(n):\n\tif int(a[e]) == 0:\n\t\tzero = 1\nfor e in range(n):\n\tres *= int(a[e])\n\tif res > 1000000000000000000:\n\t\tbreak\nif zero == 1:\n\tprint(0)\nelif res > 1000000000000000000:\n\tprint(-1)\nelse:\n\tprint(res)']
['Wrong Answer', 'Accepted']
['s654269703', 's407260383']
[19524.0, 19388.0]
[57.0, 70.0]
[278, 286]
p02658
u560381579
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(input()).split()\na.sort()\nif a[0] == 0:\n print(0)\n return\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n return\nprint(ans)', 'import sys\nn = int(input())\na = list(map(int,input().split()))\na.sort()\nif a[0] == 0:\n print(0)\n sys.exit()\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n sys.exit()\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s032129516', 's507593947']
[8924.0, 21596.0]
[25.0, 80.0]
[180, 210]
p02658
u561294476
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 = [i for i in map(int, input().split())]\n\nAs = 1\nfor i in range(N):\n As = As*A[i]\n if 1000000000000000000 < As:\n print(-1)\n break\n\nif 1000000000000000000 < As:\n print(As)\n', 'N = int(input())\nA = [i for i in map(int, input().split())]\n\nif 0 in A:\n print(0)\nelse:\n As = 1\n for i in range(N):\n As *= A[i]\n if 10**18 < As:\n print(-1)\n break\n\n if As <= 10**18:\n print(As)\n\n']
['Wrong Answer', 'Accepted']
['s498246521', 's082372006']
[21700.0, 21776.0]
[50.0, 50.0]
[213, 249]
p02658
u561743922
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.
['intNum = int(input())\nnumList = [int(x) for x in input().split()]\n\ntotal = 1\njudgeNum = 10 ** 18\n\nif 0 in numList:\n total = 0\nelse:\n for num in numList:\n total *= num\n print("num", num)\n print("total", total)\n\n if total > judgeNum:\n total = -1\n break\n\nprint(total)', 'intNum = int(input())\nnumList = [int(x) for x in input().split()]\n\ntotal = 1\njudgeNum = 10 ** 18\n\nif 0 in numList:\n total = 0\nelse:\n for num in numList:\n total *= num\n\n if total > judgeNum:\n total = -1\n break\n\nprint(total)']
['Wrong Answer', 'Accepted']
['s725240228', 's474730565']
[21656.0, 21596.0]
[143.0, 50.0]
[320, 264]
p02658
u561966294
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 ():\nN = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\nprint(0)\nreturn\nprod = 1\nfor a in A:\nprod *= a\nif prod > 1000000000000000000:\nprint(-1)\nreturn\nprint(prod)\nmain ()', 'def cal():\n n=int(input())\n arr=list(map(int,input.split()))\n prod=1\n for i in range(0,n):\n prod*=arr[i]\n if(prod>=1000000000000000000):\n print(-1)\n return\n print(prod)\n return\n\ncal()', 'def main():\n n=int(input())\n arr=list(map(int,input.split()))\n prod=1\n for i in range(0,n):\n prod*=arr[i]\n if(prod>=1000000000000000000):\n print(-1)\n return\n \n print(prod)\n\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 \n print(prod)\nmain ()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s272953811', 's442218388', 's915280308', 's242119526']
[8988.0, 9052.0, 9192.0, 21648.0]
[23.0, 24.0, 23.0, 52.0]
[192, 205, 206, 237]
p02658
u562015767
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()))\na = np.array(a)\nans = np.prod(a)\n \nif ans >= 1000000000000000000:\n print(-1)\nelse:\n print(ans)', 'import numpy as np\nimport sys\ninput = sys.stdin.readline\n\nn = int(input())\na = list(map(int,input().split()))\nans = 1\n\nfor i in a:\n ans = ans*i\n if ans >= 1000000000000000000:\n ans = -1\n exit\n elif ans == 0:\n exit\n\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\n\nfor i in a:\n ans = ans*i\n\nif ans >= 1000000000000000000:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\n\nfor i in a:\n ans = ans*i\n if ans >= 1000000000000000000:\n ans = -1\n exit\n elif ans == 0:\n exit\n\nprint(ans)', 'import numpy as np\nimport sys\ninput = sys.stdin.readline\n \nn = int(input())\na = list(map(int,input().split()))\nans = 1\n\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n \nif 0 in a:\n ans = 0\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s238611351', 's252329839', 's895052412', 's954908385', 's396188167']
[40088.0, 40220.0, 21772.0, 21592.0, 39996.0]
[141.0, 2206.0, 2206.0, 2206.0, 140.0]
[173, 255, 155, 197, 233]
p02658
u562147608
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(" ")\ni = 0\ns = 1\nf = 0\nwhile i < a :\n if b[i] == "0" :\n f = f + 1\n i = i + 1\nwhile i < a :\n s = s * int(b[i])\n i = i + 1\n if s > (10 ** 18) and f == 0:\n print("-1")\n break\nif (s <= (10 ** 18)) and f == 0 :\n print(s)\nif f > 0 :\n print(0)', 'a = int(input())\nb = input().split(" ")\ni = 0\ns = 1\nf = 0\nwhile i < a :\n if b[i] == "0" :\n print(0)\n f = f + 1\n i = i + 1\ni = 0\nwhile (i < a) and f == 0 :\n s = s * int(b[i])\n i = i + 1\n if s > (10 ** 18):\n print("-1")\n break\n if (s <= 10 ** 18) and (i == a):\n print(s)\n']
['Wrong Answer', 'Accepted']
['s931791859', 's111691882']
[19448.0, 19524.0]
[49.0, 75.0]
[313, 322]
p02658
u562550538
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(i) for i in input().split()]\nresult=1\nfor i in range(n):\n\tresult = result * a[i]\n\tif result > 100000000000000000 and a[i] != 0:\n\t\tprint(-1)\n\t\texit()\nif result > 100000000000000000:\n\tprint(-1)\nelse:\n\tprint(result)\n', 'n=int(input())\na=[int(i) for i in input().split()]\nresult=1\nfor i in range(n):\n\tresult = result * a[i]\n\t#if result >= 100000000000000000:\n\t#\tprint(-1)\n\t#\texit()\nif result > 100000000000000000:\n\tprint(-1)\nelse:\n\tprint(result)', 'n=int(input())\na=[int(i) for i in input().split()]\nresult=1\nif 0 in a:\n\tprint(0)\n\texit()\nfor i in range(n):\n\tresult *= a[i]\n\tif result > 1000000000000000000 and a[i] != 0:\n\t\tprint(-1)\n\t\texit()\nprint(result)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s108424740', 's866301576', 's664722559']
[21788.0, 21480.0, 21756.0]
[54.0, 2206.0, 51.0]
[235, 224, 207]
p02658
u562577097
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\narr = list(map(int, input().split(" ")))\nans = 1\nfor i in arr:\n ans *= i\n if ans >= 10**18:\n print(-1)\n exit()\nprint(ans)\n ', 'n = int(input())\narr = list(map(int, input().split(" ")))\nif 0 in arr:\n print(0)\n exit()\nfor i in arr:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\narr = list(map(int, input().split(" ")))\nans = 1\nif 0 in arr:\n print(0)\n exit()\nfor i in arr:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s443380270', 's563631464', 's294792230']
[21432.0, 21552.0, 21792.0]
[47.0, 46.0, 47.0]
[149, 186, 194]
p02658
u565433835
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()) \nalist=list(map(int,input().split()))\na=1\nif 0 in alist:\n print("0")\nelse:\n for i in alist:\n if a<=10**18:\n a=a*i\n else:\n break\n if a>=10**18:\n print(\'-1\')\n else:\n print(a)', "n=int,input()\na=list(map(int,input().split()))\nfrom operator import mul\nfrom functools import reduce\nx=reduce(mul, a)\nif x>=10**18:\n print('-1')\nelse:\n print(x)", "n=int(input()) \nalist=list(map(int,input().split()))\na=1\nfor i in alist:\n if a<=10**18:\n a=a*i\n else:\n break\nif a>=10**18:\n print('-1')\nelse:\n print(a)", 'n=int(input()) \nalist=list(map(int,input().split()))\na=1\nif 0 in alist:\n print("0")\nelse:\n for i in alist:\n if a<=10**18:\n a=a*i\n else:\n break\n if a>10**18:\n print(\'-1\')\n else:\n print(a)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s445664430', 's709469442', 's977319299', 's389925726']
[21480.0, 21628.0, 21592.0, 21616.0]
[52.0, 2206.0, 52.0, 50.0]
[249, 166, 177, 248]
p02658
u565624841
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()\nx = list(map(int, input().split()))\n\nfor i in x:\n if i==0:\n print(0)\n exit(0)\n\nans=1\nfor i in x:\n ans*=i\n if ans>100000000000000000:\n print(-1)\n exit(0)\nprint(ans)', 'n=input()\nx = list(map(int, input().split()))\n\nfor i in x:\n if i==0:\n print(0)\n exit(0)\n\nans=1\nfor i in x:\n ans*=i\n if ans>1000000000000000000:\n print(-1)\n exit(0)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s361863355', 's898933192']
[21768.0, 21696.0]
[50.0, 53.0]
[188, 189]
p02658
u566371932
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\n\nn = int(input())\na = list(map(int, input().split()))\n\nif a.index(0):\n print(0)\n sys.exit()\n\nhg = 10 ** 18\nans = 1\nfor i in a:\n ans *= i\n if ans > hg:\n print(-1)\n sys.exit()\n\nprint(ans)', 'import sys\n\nn = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n sys.exit()\n\nhg = 10 ** 18\nans = 1\nfor i in a:\n ans *= i\n if ans > hg:\n print(-1)\n sys.exit()\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s635079670', 's507186368']
[21544.0, 21636.0]
[55.0, 56.0]
[222, 218]
p02658
u566574814
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 operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\nif 0 in a:\n print(0)\n exit()\n\n# ans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(a):\n ans *= a[i]\n if sum>limit:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\n# if ans > limit:\n# print(-1)\n# else:\nprint(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\nif 0 in a:\n print(0)\n exit()\n\n# ans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(a):\n ans *= a[i]\n if sum>limit:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\n# if ans > limit:\n# print(-1)\n# else:\n print(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\n# ans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(n):\n ans *= a[i]\n if a[i] == 0:\n break\n\nif ans > limit:\n print(-1)\nelse:\n print(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\n# limit=10**18\n\n# if 0 in a:\n# print(0)\n# exit()\n\nans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(n):\n ans *= a[i]\n if sum > 10 ** 18:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\nfor i in range(n):\n if a[i] == 0:\n ans = 0\n\n# if ans > limit:\n# print(-1)\n# else:\nprint(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\nans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(n):\n ans *= a[i]\n if a[i] == 0:\n break\n elif (ans*a[i]) > limit:\n ans = -1\n continue\n\nif ans > limit:\n print(-1)\nelse:\n print(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\nif 0 in a:\n print(0)\n exit()\n\nans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(a):\n ans *= a[i]\n if sum> limit:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\n# if ans > limit:\n# print(-1)\n# else:\nprint(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int,input().split()))\nlimit=10**18\n\n# if 0 in a:\n# print(0)\n# exit()\n\nans = 1\n# ans = reduce(mul, a) #=> 1320\n\nfor i in range(a):\n ans *= a[i]\n if sum> limit:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\nfor i in range(n):\n if a[i] == 0:\n ans = 0\n\n# if ans > limit:\n# print(-1)\n# else:\nprint(ans)\n', '# from operator import mul\n# from functools import reduce\n\nn=int(input())\na=list(map(int, input().split()))\n\nans = 1\n# ans = reduce(mul, a) #=> 1320\nif 0 in a:\n ans = 0\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10 ** 18:\n # if a[i] == 0:\n # break\n # elif (ans*a[i]) > limit:\n ans = -1\n break\n\n\n# if a[i] == 0:\n# ans = 0\n\n# # if ans > limit:\n# # print(-1)\n# # else:\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s067213358', 's208601442', 's405342184', 's495111299', 's740074256', 's747083498', 's930736041', 's580605975']
[21472.0, 21540.0, 21476.0, 21672.0, 21776.0, 21628.0, 21476.0, 21648.0]
[50.0, 49.0, 47.0, 54.0, 2206.0, 50.0, 47.0, 65.0]
[383, 385, 271, 444, 322, 382, 438, 421]
p02658
u567040223
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 = N.split(" ")\nA = list(map(int, A))\nresult = A[0]\nfor i in range(1,N):\n result = result*A[i]\n if result*A[i] > 10**18:\n result = -1\nprint(result)', 'N = int(input())\nA = input()\nA = A.split(" ")\nA = list(map(int, A))\nresult = A[0]\nfor i in range(1,N):\n result = result*A[i]\n if result*A[i] > 10**18:\n result = -1\nprint(result)', 'N = int(input())\nA = N.split(" ")\nA = list(map(int, A))\nresult = A[0]\nfor i in range(1,N):\n result = result*A[i]\n if result*A[i] > 10**18:\n print("-1")\n exit()\nprint(result)', 'N = int(input())\nA = input()\nA = A.split(" ")\nA = list(map(int, A))\nresult = 1\nfor i in range(N):\n result = result*A[i]\n if result > 10**18:\n result = 10**18 + 1\nif result == 10**18 + 1:\n result = -1\nprint(result)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s475798344', 's861670845', 's913283877', 's319392365']
[9200.0, 21572.0, 9200.0, 21792.0]
[24.0, 2206.0, 22.0, 66.0]
[170, 182, 181, 220]
p02658
u567474295
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a = int(input())\nb = [int(i) for i in input().split()]\nlast = 1\nfor i in b:\n last*=i\n if last > 10**18:\n \tlast = -1\n break\n \nprint(last)', 'a = int(input())\nb = [int(i) for i in input().split()]\nlast = 1\nif 0 not in b:\n for i in b:\n last*=i\n if last > 10**18:\n \tlast = -1\n break\n\nelse:\n last = 0\n \nprint(last)', 'a = int(input())\nb = [int(i) for i in input().split()]\nlast = 1\nfor j,i in enumerate(b):\n last*=i\n if last > 10**18 and 0 not in b[j:]:\n \tlast = -1\n break\n\n\n \nprint(last)', 'a = int(input())\nb = [int(i) for i in input().split()]\nlast = 1\nfor j,i in enumerate(b):\n last*=i\n if last > 10**18 and 0 not in b[j::]:\n \tlast = -1\n break\n\n\n \nprint(last)', 'input()\nb = [int(i) for i in input().split()]\n\nif 0 not in b:\n last = 1\n for i in b:\n last*=i\n if last > 10**18:\n last = -1\n break\n \nelse:\n last = 0\n \nprint(last)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s071422064', 's367525657', 's844109915', 's908582665', 's626573298']
[9020.0, 8968.0, 9040.0, 8948.0, 21560.0]
[25.0, 20.0, 21.0, 24.0, 52.0]
[155, 196, 189, 190, 195]
p02658
u568576853
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())\ns=1\nif any(a==0):\n print(0)\n exit()\nfor i in a:\n s*=i\n if s>1e18:\n print(-1)\n exit()\nprint(s)', 'import numpy as np\nn,*a=map(int,open(0).read().split())\ns=1\na=np.array(a)\nif any(a==0):\n print(0)\n exit()\nfor i in list(a):\n if i>=10**18/s:\n print(-1)\n exit()\n s=s*i\nprint(s)', 'n,*a=map(open(0).read().split())\nif 0 in a:\n print(0)\n exit()\ns=1\nfor i in a:\n s*=i\n if s>10**18:\n print(-1)\n exit()\nprint(s)', 'n,*a=map(int,open(0).read().split())\nif 0 in a:\n print(0)\n exit()\ns=1\nfor i in a:\n s*=i\n if s>10**18:\n print(-1)\n exit()\nprint(s)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s156767797', 's681858776', 's832363851', 's129273242']
[21784.0, 39628.0, 19324.0, 21776.0]
[44.0, 307.0, 33.0, 45.0]
[140, 185, 135, 140]
p02658
u569479281
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 k = input()\n m = k.split()\n \n if "0" in m == True:\n print(0)\n return\n \n ans = 1\n for hui in m:\n ans *= int(hui)\n \n if ans >= 10**18:\n ans = -1\n break\n \n print(ans)\n \nmain()', "def main():\n N = input()\n str_num = input()\n num_list = str_num.split()\n \n if '0' in num_list:\n print(0)\n return\n \n answer = 1\n for num in num_list:\n answer *=int(num)\n if answer > 10**18:\n answer = -1\n break\n\n print(answer)\n\nmain()\n"]
['Wrong Answer', 'Accepted']
['s684286836', 's516872281']
[19424.0, 19196.0]
[41.0, 45.0]
[249, 310]
p02658
u570018655
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in A:\n ans *= i\n if ans > 1e18:\n \tprint(-1)\n return\n \nif ans > 1e18:\n print(-1)\nelse:\n print(ans)\n', 'def solve():\n ans = 1\n if 0 in A:\n return 0\n for i in A:\n ans *= i\n if ans > 1e18:\n return -1\n return ans\n\n\nN = int(input())\nA = list(map(int, input().split()))\nprint(solve())\n']
['Runtime Error', 'Accepted']
['s644583725', 's486080465']
[8964.0, 21652.0]
[22.0, 49.0]
[174, 194]
p02658
u571281863
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())]\na=1\nwhile A:\n a*=A.pop()\n if a >= 10**18:\n print(-1)\n break\nelse:\n print(a)', "from decimal import Decimal\nN=int(input())\nA=[*map(str,input().split())]\na=Decimal('1')\nwhile A:\n a=a*Decimal(A.pop())\n if a > Decimal('10'**'18'):\n print(-1)\n break\nelse:\n print(a)", 'N=int(input())\nA=[*map(int,input().split())]\na=1\nif 0 in A:\n a=0\nelse:\n while A:\n a*=A.pop()\n if a>10**18:\n a=-1\n break\nprint(a)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s151194066', 's771631594', 's585697512']
[21604.0, 20952.0, 21744.0]
[48.0, 45.0, 48.0]
[129, 190, 146]
p02658
u571395477
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\ndef main():\n N = int(input())\n A_list = [int(_) for _ in input().split()]\n ans = 1\n \n for i in range(N):\n ans *= A_list[i]\n if ans>10**18:\n ans = -1\n break\n out = ans\n\n print(out)\n\nmain()', 'import sys\ndef main():\n N = int(input())\n A_list = [int(_) for _ in input().split()]\n ans = 1\n \n if 0 in A_list:\n out = 0\n print(out)\n sys.exit()\n \n for i in range(N):\n ans = ans * A_list[i]\n \n if ans>1000000000000000000:\n ans = -1\n break\n out = ans\n print(out)\n\nmain()']
['Wrong Answer', 'Accepted']
['s968024843', 's894633695']
[21612.0, 21648.0]
[51.0, 56.0]
[251, 360]
p02658
u572032237
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(s) for s in input().split()]\nans = 1\nfor i in a:\n ans *= i\n if ans <= (10 ** 18):\n ans = -1\n break\nprint(ans)', 'def main():\n n = int(input())\n a = [int(s) for s in input().split()]\n ans = 1\n if 0 in a:\n print(0)\n return\n for i in a:\n ans *= i\n print(ans)\n if ans > (10 ** 18):\n ans = -1\n break\n print(ans)\nmain()', 'def main():\n n = int(input())\n a = [int(s) for s in input().split()]\n ans = 1\n if 0 in a:\n print(0)\n return\n for i in a:\n ans *= i\n if ans > (10 ** 18):\n ans = -1\n break\n print(ans)\nmain()']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s881228623', 's918879587', 's914146455']
[21604.0, 21424.0, 21712.0]
[62.0, 76.0, 58.0]
[155, 275, 256]
p02658
u577415482
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())\nAs = map(int,input().split())\n\nsum = 1\n\nif any(a == 0 for a in As):\n\tsum = 0\nelse:\n\tfor a in As:\n\t\tsum*=a\n\t\tif sum > 1000000000000000000:\n\t\t\tsum = -1\n\t\t\tbreak\nprint(sum)\n\n\n#A,B=map(int,input().split())\n\n\n\n\n', 'N = int(input())\nAs = list(map(int,input().split()))\n\nsum = 1\n\nif any(b == 0 for b in As):\n\tsum = 0\nelse:\n\tfor a in As:\n\t\tsum*=a\n\t\tif sum > 1000000000000000000:\n\t\t\tsum = -1\n\t\t\tbreak\nprint(sum)\n\n\n#A,B=map(int,input().split())\n\n\n\n\n']
['Wrong Answer', 'Accepted']
['s729404876', 's776562989']
[19376.0, 21640.0]
[54.0, 53.0]
[234, 240]
p02658
u580126681
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())\nstr_list = input().split()\n\nresult = 1\n\nfor i in range(n):\n if(int(str_list[i]) == 0):\n result = 0\n break\n result = result * int(str_list[i])\n\nif(result >= 1000000000000000000):\n print('-1')\nelse:\n print(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nresult = 1\n\nfor i in range(n):\n result = result + str_list(i)\n \nt = 1\nfor j in range(18)\n t = t * 10\nif(result > t):\n print('-1')\nelse:\n print(result)\n ", "n = int(input())\nstr_list = input().split()\n\nresult = 1\n\nfor i in range(n):\n result = result * int(str_list[i])\n \nt = 1\nfor j in range(18)\n t = t * 10\nif(result > t):\n print('-1')\nelse:\n print(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nlist = [int(k) for k in str_list]\n\nlist.sort(reverse=True)\n\nresult = 1\n\nif(0 in list):\n print('0')\n return\n\nfor i in range(n):\n result = result * list[i]\n if(result >= 1000000000000000000):\n print('-1')\n return\n\nprint(result)\n \n", "n = int(input())\nlist = int(input().split())\n\nlist.sort(reverse=True)\n\nresult = 1\n\nif(0 in list):\n print('0')\n return\n\nfor i in range(n):\n result = result * list[i]\n if(result >= 1000000000000000000):\n print('-1')\n return\n\nprint(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nresult = 1\n\nfor i in range(n):\n result = result * int(str_list(i))\n \nt = 1\nfor j in range(18)\n t = t * 10\nif(result > t):\n print('-1')\nelse:\n print(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nlist = [int(k) for k in str_list]\n\nlist.sort(reverse=True)\n\nresult = 1\n\nif(0 in list):\n print('0')\n exit()\n\nfor i in range(n):\n result = result * list[i]\n if(result >= 1000000000000000000):\n print('-1')\n exit()\n\nprint(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nresult = 1\n\nif('0' in str_list):\n print('0')\n exit()\n\nfor i in range(n):\n result = result * int(str_list[i])\n if(result >= 1000000000000000000):\n print('-1')\n exit()\n\nprint(result)\n \n", "n = int(input())\nstr_list = input().split()\n\nlist = [int(k) for k in str_list]\n\nlist.sort(reverse=True)\n\nresult = 1\n\nif(0 in list):\n print('0')\n exit()\n\nfor i in range(n):\n result = result * list[i]\n if(result > 1000000000000000000):\n print('-1')\n exit()\n\nprint(result)\n \n"]
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s026302473', 's028134596', 's085631449', 's461150763', 's657604075', 's723170718', 's915032368', 's974821295', 's355429905']
[19420.0, 8964.0, 9028.0, 9112.0, 9108.0, 8976.0, 21968.0, 19524.0, 22048.0]
[2206.0, 22.0, 20.0, 24.0, 25.0, 23.0, 84.0, 53.0, 81.0]
[243, 204, 210, 284, 250, 210, 284, 239, 283]
p02658
u580404776
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()))\nL=10**18\nans=A[0]\nfor i in range(1,N):\n ans*=A[i]\nprint(ans if ans<L else -1)\n ', 'N=int(input())\nA=list(map(int,input().split()))\nL=10**18\nans=A[0]\nif 0 in A:\n ans=0\nelse:\n for i in range(1,N):\n if ans<=L:\n ans*=A[i]\n else:\n print(-1)\n exit()\n \nprint(ans if ans<=L else -1)\n ']
['Wrong Answer', 'Accepted']
['s433294513', 's062223432']
[21720.0, 21480.0]
[2206.0, 57.0]
[133, 252]
p02658
u580774391
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()]\n\nreg = A[0]\nflg=True\nif 0 in A:\n print(0)\n flg=False\n reg=0\nfor i in range(1, N):\n reg *= a\n if reg>10**18:\n print(-1)\n flg=False\n break\nif flg:\n print(reg)', ' = int(input())\nA = [int(x) for x in input().split()]\n\nreg = A[0]\nflg=True\nif 0 in A:\n print(0)\n flg=False\n reg=0\nfor i in range(1, N):\n reg *= A[i]\n if reg>10**18:\n print(-1)\n flg=False\n break\nif flg:\n print(reg)', 'N = int(input())\nA = [int(x) for x in input().split()]\n\nreg = A[0]\nflg=True\nif 0 in A:\n print(0)\n flg=False\n reg=0\nfor i in range(1, N):\n reg *= A[i]\n if reg>10**18:\n print(-1)\n flg=False\n break\nif flg:\n print(reg)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s363781939', 's580521884', 's466651943']
[21488.0, 8944.0, 21604.0]
[51.0, 20.0, 64.0]
[250, 252, 253]
p02658
u580920947
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 = tuple(map(int, input().split()))\nans = 1\nfor a in A:\n ans *= a\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)', "#!/usr/bin/env python\n\ndef main():\n N = int(input())\n A = tuple(map(int, input().split()))\n ans = 1\n for a in A:\n if a == 0:\n print('0')\n exit()\n for a in A:\n ans *= a\n if ans > 10 ** 18:\n print('-1')\n exit()\n print(ans)\n\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Accepted']
['s364538672', 's186774252']
[9176.0, 21740.0]
[24.0, 51.0]
[136, 342]
p02658
u581403769
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\n\nx = 1\nfor i in range(n):\n x *= a[i] \n if x > 1000000000000000000:\n if 0 in a:\n print(0)\n else:\n print(-1)\n else:\n print(x)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nx = 1\nflag = False\nINF = 10**18\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n if flag == False:\n x *= a[i]\n if x > INF:\n flag = True\n \n if flag:\n print(-1)\n else:\n print(x)\n']
['Wrong Answer', 'Accepted']
['s166463208', 's432813706']
[21660.0, 21624.0]
[2206.0, 59.0]
[232, 294]
p02658
u583455650
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 = map(int, input().split())\nA.sort()\n\nans = 1\n\nif A[0] == 0:\n print(0)\nelse:\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n break\n print(ans)\n', '_, *A = map(int, input().split())\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > 10 ** 18:\n ans = -1\n break\nprint(ans)\n', '_, *A = map(int, open(0).read().split())\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > 10 ** 18:\n ans = -1\n break\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s647743914', 's936562792', 's699559208']
[9168.0, 9176.0, 21656.0]
[20.0, 23.0, 49.0]
[186, 158, 165]
p02658
u586305367
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 calc(num_list) -> int:\n result = 1\n max = 10**18\n\n if 0 in num_list:\n return 0\n \n for num in num_list:\n result *= num\n if result > max:\n return -1\n return result\n\nn = int(input())\nnum_list = map(int, input().split())\n\nprint(str(calc(num_list)))', 'n = int(input())\nnum_list = map(int, input().split())\n\nmax = pow(10, 18)\nresult = 1\nfor num in num_list:\n if num == 0:\n print(0)\n break\n else:\n result = result * num\n if result > max:\n print(-1)\n break \n print(result)', 'def calc(num_list) -> int:\n result = 1\n max = 10**18\n\n if 0 in num_list:\n return 0\n\n for num in num_list:\n result *= num\n if result > max:\n return -1\n return result\n\nn = int(input())\nnum_list = list(map(int, input().split()))\n\nprint(str(calc(num_list)))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s068010693', 's228265930', 's984331920']
[19384.0, 8928.0, 21704.0]
[43.0, 22.0, 49.0]
[302, 258, 300]
p02658
u589257616
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.
["dontt_use = input()\nn = map(int,list(input().split()))\ntotal = 1\nfor number in n:\n total = total * number\n\nprint(total) if total<10**18 else print('-1')", "dontt_use = input()\nn = map(int,list(input().split()))\ntotal = 1\nfor number in n:\n total = total * number\n if total > 10**18:\n print('-1')\n return\nprint(total)", "dontt_use = input()\nstr_list = list(input().split())\nn = map(int,str_list)\n\ndef foo(n):\n total = 1 \n for number in n:\n total = total * number\n print(total)\n if total > 10**18:\n print('-1')\n return\n print(total)\nif '0' in str_list :\n print(0)\nelse:\n foo(n)", "dontt_use = input()\nstr_list = list(input().split())\nn = map(int,str_list)\n\ndef foo(n):\n total = 1 \n for number in n:\n total = total * number\n if total > 10**18:\n print('-1')\n return\n print(total)\nif '0' in str_list :\n print(0)\nelse:\n foo(n)"]
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s294682593', 's326466537', 's716350321', 's853733543']
[19180.0, 9020.0, 19144.0, 19284.0]
[2206.0, 27.0, 75.0, 45.0]
[155, 179, 314, 293]
p02658
u589783652
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()))\n\ncumul = 1\nfor i in range(N):\n cumul *= nums[i]\n\nif cumul > 10 ** 18: print(-1)\nelif:print(cumul)\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\ncumul = 1\nfor i in range(N):\n \tcumul *= nums[i]\n if cumul > 10**18:\n \tprint(-1)\n break\n\nif cumul < 10**18: print(cumul)', 'N = int(input())\nnums = list(map(int, input().split()))\n\ncumul = 1\nfor i in range(N):\n cumul *= nums[i]\n if cumul > 10 ** 18:\n print(-1)\n break\n\nif cumul < 10 ** 18: print(cumul)\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\ncumul = 1\nif 0 in nums: print(0)\nelse:\n\tfor i in range(N):\n \tcumul *= nums[i]\n\t\tif cumul > 10 ** 18:\n \t\tprint(-1)\n \t\tbreak\n\tif cumul <= 10 ** 18: print(cumul)\n', 'N = int(input())\nnums = list(map(int, input().split()))\n\ncumul = 1\nif 0 in nums:\n print(0)\nelse:\n for i in range(N):\n cumul *= nums[i]\n if cumul > 10 ** 18:\n print(-1)\n break\n if cumul <= 10 ** 18: print(cumul)\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s211285694', 's667040203', 's895331669', 's907504376', 's836228757']
[8996.0, 8964.0, 21660.0, 8992.0, 21644.0]
[26.0, 20.0, 52.0, 25.0, 51.0]
[157, 190, 199, 229, 256]
p02658
u590748872
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()))\nmu = 1\n\nfor i in range(n):\n mu = mu*a[i]\n if mu==0: break\n# print(mu)\nif mu<10**18:\n print(mu)\nelse:\n print(-1)\n', 'n = int(input())\na = list(map(int,input().split()))\nmu = 1\nif 0 in a:\n print(0)\nelse:\n fl=0\n for i in range(n):\n mu = mu*a[i]\n if mu>10**18:\n print(-1)\n fl=1\n break\n # print(mu)\n if fl==0:\n print(mu)\n']
['Wrong Answer', 'Accepted']
['s082168824', 's467128389']
[21652.0, 21640.0]
[2206.0, 47.0]
[176, 269]
p02658
u591143370
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["N = int(input())\nList = list(map(int, input().split()))\na=1\nif 0 in List:\n print(0)\nelse:\n for i in range(N):\n\n a=a*List[i]\n if a>10**18:\n print('-1')\n break \n print(a)\n if not a>10**18:\n print(a)", "N = int(input())\nList = list(map(int, input().split()))\na=1\nif 0 in List:\n print(0)\n\nelse:\n for i in List:\n a=a*i\n if a>10**18:\n print('-1')\n break\nif not a>10**18 and not 0 in List:\n print(a)"]
['Wrong Answer', 'Accepted']
['s687959512', 's864517142']
[21644.0, 21792.0]
[51.0, 50.0]
[254, 238]
p02658
u591182368
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\nimport math\n \nsys.setrecursionlimit(10 ** 8)\ninput = sys.stdin.readline\n \ndef main():\n K = int(input())\n s = list(map(int, input().split()))\n prod = 1\n a = 10 ** 18\n if 0 in s:\n print(0)\n sys.exit()\n for k in range(K):\n prod = prod * s[k]\n if prod >= a:\n print(-1)\n sys.exit()\n \n print(prod)\n\nif __name__ == '__main__':\n main()", "import sys\nimport math\n \nsys.setrecursionlimit(10 ** 8)\ninput = sys.stdin.readline\n \ndef main():\n K = int(input())\n s = list(map(int, input().split()))\n prod = 1\n if 0 in s:\n print(0)\n sys.exit()\n for k in range(K):\n prod = prod * s[k]\n if prod >= 10 ** 18:\n print(-1)\n else:\n print(prod)\n\nif __name__ == '__main__':\n main()", "import sys\nimport math\n \nsys.setrecursionlimit(10 ** 8)\ninput = sys.stdin.readline\n \ndef main():\n K = int(input())\n s = list(map(int, input().split()))\n prod = 1\n a = 10 ** 18\n if 0 in s:\n print(0)\n sys.exit()\n for k in range(K):\n prod = prod * s[k]\n if prod > a:\n print(-1)\n sys.exit()\n \n print(prod)\n\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s036958311', 's230867968', 's604137982']
[21936.0, 21772.0, 21924.0]
[48.0, 2206.0, 48.0]
[369, 347, 368]
p02658
u591295155
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#import cython\n\ndef main():\n read = lambda: sys.stdin.readline().rstrip()\n \n #N: cython.longlong = 0\n n = int(read.input())\n a = list(map(int,read().split()))\n ans = 1\n flag = True\n for num in a:\n ans *= num\n if ans > 10**18:\n flag = False\n break\n print(ans if flag else -1)\n \nif __name__ == "__main__":\n main()', 'import sys\n#import cython\n \ndef main():\n read = lambda: sys.stdin.readline().rstrip()\n \n #N: cython.longlong = 0\n n = int(read())\n a = list(map(int,read().split()))\n ans = 1\n flag = True\n iszero = any(num == 0 for num in a)\n if iszero: print(0)\n else:\n for num in a:\n ans *= num\n if ans > 10**18:\n flag = False\n break\n print(ans if flag else -1)\n \nif __name__ == "__main__":\n main()']
['Runtime Error', 'Accepted']
['s283138453', 's632517641']
[9128.0, 21476.0]
[23.0, 49.0]
[376, 469]
p02658
u591322332
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 n=int(input())\n a=list(map(int,input().split()))\n ans=1\n a.sort()\n \n for i in a:\n ans*=i\n if(ans>=1000000000000000000):\n print("-1")\n return\n \n print(ans)\n\nsolve()', 'def solve():\n n=int(input())\n a=list(map(int,input().split()))\n ans=1\n a.sort()\n \n for i in a:\n ans*=i\n if(ans>1000000000000000000):\n print(-1)\n return\n \n print(ans)\n\nsolve()']
['Wrong Answer', 'Accepted']
['s115546625', 's205477401']
[21788.0, 21648.0]
[86.0, 76.0]
[237, 234]
p02658
u592248346
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int,input().split()))\ns = a[0]\nfor i in range(1,n):\n s*=a[i]\nif s>100000000000000000: print(-1)\nelse: print(s)', 'n = int(input())\na = sorted(list(map(int,input().split())))\nif a[0]==0:\n print("0")\nelse:\n sum = 1\n for i in a:\n sum*=i\n if sum>10**18:\n print("-1")\n break\n else:\n print(sum)']
['Wrong Answer', 'Accepted']
['s963298096', 's955134412']
[21632.0, 21600.0]
[2206.0, 85.0]
[143, 229]
p02658
u592547545
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 readinput():\n n=int(input())\n a=list(map(int,input().split()))\n return n,a\n\ndef main(n,a):\n if(a.count(0)!=0):\n return 0\n \n res=a[0]\n for i in range(1,n):\n res*=a[i]\n if res>INFTY:\n return -1\n return res\n\nif __name__=='__main__':\n n,a=readinput()\n ans=main(n,a)\n print(ans)", "INFTY=10**18\n\ndef readinput():\n n=int(input())\n a=list(map(int,input().split()))\n return n,a\n\ndef main(n,a):\n if(a.count(0)!=0):\n return 0\n \n res=a[0]\n for i in range(1,n):\n res*=a[i]\n if res>INFTY:\n return -1\n return res\n\nif __name__=='__main__':\n n,a=readinput()\n ans=main(n,a)\n print(ans)"]
['Runtime Error', 'Accepted']
['s587109214', 's297504487']
[21580.0, 21644.0]
[47.0, 52.0]
[346, 360]
p02658
u592601397
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=int(input())\na=list(map(int,input().split()))\nsum_=1\nfor i in range(N):\n while sum_ < 10**18:\n sum_ *= a[i]\n if sum_ > 10**18:\n sum_ =-1\n break\n if sum_ = 0:\n break\nprint(sum_)', 'N=int(input())\na=list(map(int,input().split()))\nsum_=1\nfor i in range(N):\n while sum_ < 10**18:\n sum_ *= a[i]\n if sum_ > 10**18:\n sum_ =-1\n break\n if sum_ = 0:\n break\nprint(sum_)', 'N=int(input())\na=list(map(int,input().split()))\nsum_=1\nif 0 in a:\n print (0)\nelse:\n for i in range(N):\n sum_ *= a[i]\n if sum_> 10**18:\n sum_ =-1\n break\n print(sum_)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s064399552', 's886754085', 's878853784']
[8900.0, 9032.0, 21788.0]
[26.0, 25.0, 54.0]
[227, 231, 209]
p02658
u593019570
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\nfor _ in range(n):\n if ans >= 10 ** 18:\n print(-1)\n exit()\n ans = ans * a[i]\n\nprint(ans)', '\nn = int(input())\n\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\n if ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)\n', 'n = int(input())\n\na = list(map(int,input().split()))\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\nif ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)', '\nn = int(input())\n\na = list(map(int,input().split()))\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\n if ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\n\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s018677893', 's048388612', 's622736410', 's764135828', 's204016448']
[21600.0, 21488.0, 21472.0, 21640.0, 21664.0]
[45.0, 46.0, 2206.0, 48.0, 48.0]
[170, 208, 158, 171, 205]
p02658
u595786324
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\nok = True\n_n = int(input())\na = list(map(int,input().split()))\nfor i in a:\n ans *= i\n\nif ans > 1e18:\n print(-1)\nelse \n print(ans)', 'ans = 1\nok1 = True\n_n = int(input())\na = list(map(int,input().split()))\nok2 = False\nif 0 in a:\n ok2 = True\n\nfor i in a:\n ans *= i\n if ans > 1e18:\n ok1 = False\n break\n\nif ok2:\n print(0)\nelif ok1:\n print(ans)\nelse :\n print(-1)\n \n']
['Runtime Error', 'Accepted']
['s836938781', 's033283357']
[9028.0, 21676.0]
[25.0, 58.0]
[146, 262]
p02658
u596681540
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["n = int(input())\nans = 1\nflg = True\n\nif '0' in list(input().split()):\n print(0)\nelse:\n for a in input().split():\n _a = int(a)\n ans *= _a\n if ans > 10 ** 18:\n print(-1)\n flg = False\n break\n\n if flg:\n print(ans)\n", "n = int(input())\nans = 1\nflg = True\ninput_a = list(input().split())\n\nif '0' in input_a:\n print(0)\nelse:\n for a in input_a:\n _a = int(a)\n ans *= _a\n if ans > 10 ** 18:\n print(-1)\n flg = False\n break\n\n if flg:\n print(ans)\n"]
['Runtime Error', 'Accepted']
['s826420816', 's381605048']
[19492.0, 19336.0]
[37.0, 50.0]
[280, 290]
p02658
u598696606
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())\nnum = list(map(int,input().split(" ")))\n \ns = num[0]\n \nfor i in range(1,n):\n s = s * num[i]\n \nif len(str(s)) > 17:\n print(-1)\nelse:\n print(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n\nsum = num[0]\n\nfor i range(1,n):\n if len(str(sum)) > 16:\n sum = -1\n break\n sum = sum * num[i] \n\nprint(sum)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n \ns = num[0]\n \nfor i range(1,n):\n s = s * num[i] \n \nprint(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n \nzero=num.count(0)\n\nif zero != 0:\n print(0)\nelse:\n s = num[0]\n for i in range(1,n):\n s = s * num[i]\n if len(str(s)) > 18:\n s=-1\n break\n print(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n \nzero=num.count(0)\n\nif zero != 0:\n print(0)\nelse:\n s = num[0]\n for i in range(1,n):\n s = s * num[i]\n if len(str(s)) > 18:\n print(-1)\n else:\n print(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n\ns = num[0]\n\nfor i range(1,n):\n if len(str(s)) > 16:\n s = -1\n break\n s = s * num[i] \n\nprint(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n \ns = num[0]\n \nfor i in range(1,n):\n s = s * num[i]\n \nif len(str(s)) > 18:\n print(-1)\nelse:\n print(s)', 'n = int(input())\nnum = list(map(int,input().split(" ")))\n \nzero=num.count(0)\nz= 10 **18\nif zero != 0:\n print(0)\nelse:\n s = num[0]\n for i in range(1,n):\n s = s * num[i]\n if s > z:\n s=-1\n break\n print(s)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s011283992', 's032060507', 's095021764', 's375902100', 's389206141', 's864959705', 's880212937', 's857753179']
[21704.0, 8992.0, 9024.0, 21596.0, 21652.0, 9028.0, 21608.0, 21784.0]
[2206.0, 25.0, 23.0, 69.0, 2206.0, 20.0, 2206.0, 51.0]
[164, 171, 118, 222, 221, 159, 164, 221]
p02658
u600261652
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 resolve():\n N = int(input())\n list = list(map(int, input().split()))\n no = 0\n non = 0\n ans = 1\n lens = 0\n if (list.count("0") >= 1):\n print("0")\n exit()\n else:\n for i in range(N):\n lens = lens + len(list[non])\n non += 1\n if (lens >= 19):\n print("-1")\n exit()\n else:\n for j in range(N):\n ans = ans * list[no]\n no += 1\n print(ans)\nresolve()', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n reduce(lamda x, y: x * y, (list))\n from operator import mul\n ans = reduce(mul, (list))\n print(ans if ans <= 10**18 else "-1")\nresolve()', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 1\nans = list[0]\nfor i in range(N):\n ans = ans*list[no]\n no += 1\nprint(ans if ans <= 10**18 else "-1")', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n no = 0\n non = 0\n ans = 1\n lens = 0\n if (list.count("0") >= 1):\n print("0")\n exit()\n else:\n for i in range(N):\n lens = lens + len(list[non])\n non += 1\n if (lens >= 19):\n print("-1")\n exit()\n else:\n for j in range(N):\n ans = ans * list[no]\n no += 1\n print(ans)\nresolve()', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 0 \nans = 1\nc = 0\nif list.count("0") >0:\n print("0")\n exit()\nelse:\n for i in range(N):\n ans = ans * list[no]\n c = c + len(str(list[no]))\n no += 1\n if lens >= 19:\n exit()\n else:\n continue\nprint(ans)', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 0 \nans = 1\nlens = 0\nif list.count("0") >0:\n print("0")\n exit()\nelse:\n for i in range(N):\n ans = ans * list[no]\n lens = lens + len(list[no])\n no += 1\n if lens >= 19:\n exit()\n else:\n continue\nprint(ans)', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 0 \nans = 1\nlens = 0\nif list.count("0") >0:\n print("0")\n exit()\nelse:\n for i in range(N):\n ans = ans * list[no]\n lens = lens + len(list[no])\n no += 1\n if lens >= 19:\n exit()\n else:\n continue\nprint(ans if ans <= 10**18 else "-1")', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n lists = np.array(list)\n print(np.prod(lists) if np.prod(lists)<=10**18 else "-1")\nresolve()', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 0 \nans = 1\nc = 0\nif list.count("0") >0:\n print("0")\n exit()\nelse:\n for i in range(N):\n ans = ans * list[no]\n c = c + len(str(list[no]))\n no += 1\n if c >= 19:\n exit()\n else:\n continue\nprint(ans)', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n if A in "0":\n print("0")\n else:\n for i in A:\n ans *= i\n if ans > 10**18:\n print("-1")\n exit()\n print(ans)\nresolve()', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n no = 0\n non = 0\n ans = 1\n lens = 0\n if (list.count("0") >= 1):\n print("0")\n exit()\n else:\n for i in range(N):\n lens = lens + len(list[non])\n non += 1\n if (lens >= 19):\n print("-1")\n exit()\n else:\n for j in range(N):\n ans = ans * list[no]\n no += 1\n print(ans)\nresolve()', 'def resolve():\n import numpy as np\n N = int(input())\n list = list(map(int, input().split()))\n print(numpy.prod(list) if numpy.prod(list)<=10**18 else "-1")\nresolve()', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n import numpy as np\n ans = np.prod(list)\n print(ans if ans <= 10**18 else "-1")\nresolve()', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n no = 0\n ans = 1\n if (list.count("0") >= 1):\n print("0")\n exit()\n else:\n for i in range(N):\n ans = ans * list[no]\n no += 1\n print(ans if ans <= 10**18 else "-1")\nresolve()', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n if A in "0":\n print("0")\n exit()\n for i in A:\n ans *= i\n if ans > 10**18:\n print("-1")\n exit()\n print(ans)\nresolve()', 'def resolve():\n N = int(input())\n list = list(map(int, input().split()))\n print(np.prod(list) if np.prod(list)<=10**18 else "-1")\nresolve()', 'N = int(input())\nlist = list(map(int, input().split()))\nno = 0 \nans = 1\nc = 0\nif list.count("0") >0:\n print("0")\n exit()\nelse:\n for i in range(N):\n ans = ans * list[no]\n c = c + len(str(list[no]))\n no += 1\n if c >= 19:\n print("-1")\n exit()\n else:\n continue\nprint(ans if ans <= 10**18 else "-1")', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n if A in "0":\n print("0")\n exit()\n else:\n for i in A:\n ans *= i\n if ans > 10**18:\n print("-1")\n exit()\n print(ans)\nresolve()', 'def resolve():\n from operator import add\n N = int(input())\n list = list(map(int, input().split()))\n ans = reduce(add, (list))\n print(ans if ans <= 10**18 else "-1")\nresolve()', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n if 0 in A:\n print(0)\n exit()\n for i in A:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\nresolve()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s011652387', 's016390282', 's116054001', 's141287474', 's155068928', 's163198304', 's220161580', 's341240926', 's342073615', 's360994214', 's376629975', 's587014245', 's610998554', 's679541424', 's849470275', 's879906850', 's918648034', 's943804710', 's967518512', 's228523113']
[9240.0, 9020.0, 21644.0, 9012.0, 21700.0, 21792.0, 21476.0, 9176.0, 21660.0, 21612.0, 9208.0, 27104.0, 9180.0, 9208.0, 21732.0, 9172.0, 21476.0, 21612.0, 9228.0, 21584.0]
[22.0, 24.0, 2206.0, 25.0, 53.0, 55.0, 55.0, 23.0, 49.0, 53.0, 24.0, 102.0, 21.0, 26.0, 56.0, 25.0, 49.0, 55.0, 20.0, 60.0]
[437, 227, 164, 433, 285, 289, 316, 177, 282, 283, 469, 177, 177, 294, 264, 148, 327, 298, 189, 258]
p02658
u601235270
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()\nelse:\n for i in range(n):\n ans *=i\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()\nelse:\n for i in a:\n ans *=i\n if ans >10**18:\n print(-1)\n exit()\nprint(ans)']
['Wrong Answer', 'Accepted']
['s214368525', 's804115086']
[21712.0, 21468.0]
[58.0, 50.0]
[212, 205]