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
u602544363
2,000
1,048,576
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()))\nanswer = 1\nfor i in range(n):\n answer * A[i]\nif answer > pow(10,18):\n print('-1')\nelse:\n print(answer)", "n = int(input())\nA = list(map(int,input().split()))\nanswer = 1\nflag = 1\nzero = 0\nfor i in range(n):\n answer *= A[i]\n if answer > pow(10,18):\n flag = 0\n break\nif 0 in A:\n print(0)\nelif flag ==0:\n print('-1')\nelse:\n print(answer)"]
['Wrong Answer', 'Accepted']
['s130737224', 's426167168']
[21792.0, 21604.0]
[66.0, 77.0]
[163, 256]
p02658
u602773379
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\ndef input2():\n\treturn map(int,input().split())\n \nn=int(input())\nA=input_array()\nMAX=10**18\nans=A[0]\n\nfor i in range(1,len(A)):\n\tans*=A[i]\n\tif ans==0:\n\t\tbreak\n\telif ans>MAX:\n\t\tans=-1\n\t\tbreak\n\telse:\n\t\tpass\n\nprint(ans)', '\ndef input_array():\n\treturn list(map(int,input().split()))\n \nn=int(input())\nA=input_array()\nMAX=10**18\nans=1\nfor i in A:\n\tans*=i\n\tif ans >= MAX:\n\t\tans=-1\n\t\tbreak\nprint(ans)', '\ndef input_array():\n\treturn list(map(int,input().split()))\n \nn=int(input())\nA=input_array()\nMAX=10**18\nans=0\nfor i in A:\n\tans*=i\n\tif ans >= MAX:\n\t\tans=-1\n\t\tbreak\nprint(ans)', '\ndef input_array():\n\treturn list(map(int,input().split()))\n\nn=int(input())\nA=input_array()\nMAX=10**18\nans=1\nfor i in A:\n\tans*=i\nif ans >= MAX:\n\tprint(-1)\nelse:\n\tprint(ans)', '\ndef input_array():\n\treturn list(map(int,input().split()))\n\ndef swap(a,b):\n\ttmp=a\n\ta=b\n\tb=tmp\n\treturn a,b\n\nn=int(input())\nA=input_array()\nMAX=10**18\nA=sorted(A)\nans=A[0]\nfor i in range(1,len(A)):\n\tans*=A[i]\n\tif ans==0:\n\t\tbreak\n\telif ans>MAX:\n\t\tans=-1\n\t\tbreak\n\telse:\n\t\tpass\n\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s625621505', 's728889647', 's742287042', 's997775999', 's469906349']
[9088.0, 21508.0, 21584.0, 21508.0, 21704.0]
[25.0, 58.0, 62.0, 2206.0, 84.0]
[240, 212, 212, 210, 324]
p02658
u606374450
2,000
1,048,576
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 = 0\n\nfor i in range(N):\n ans *= A[i]\n\nif ans > 10 ** 18:\n ans = -1\n\nprint(ans)\n', "import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif '0' in str(A):\n print(0)\n sys.exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10 ** 18:\n ans = -1\n\nprint(ans)\n", 'import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif 0 in A:\n print(0)\n sys.exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10 ** 18:\n ans = -1\n break\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s475019459', 's994863035', 's897454173']
[21560.0, 21576.0, 21344.0]
[67.0, 68.0, 57.0]
[143, 209, 216]
p02658
u607074939
2,000
1,048,576
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\nsort(A)\nfor i in range (N):\n ans *= A[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\nA = sorted(A)\nfor i in range (N):\n ans *= A[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s285849839', 's990285903']
[21708.0, 21640.0]
[47.0, 96.0]
[167, 173]
p02658
u607437307
2,000
1,048,576
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\nif len(str(ans)) >= 18:\n print ("-1")\nelse:\n print (ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print (0)\nelse:\n for i in a:\n ans *= i\n if 1000000000000000000 < ans:\n ans = -1\n break\n print (ans)']
['Wrong Answer', 'Accepted']
['s725387502', 's697765568']
[21660.0, 21712.0]
[2206.0, 54.0]
[148, 217]
p02658
u607709109
2,000
1,048,576
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\nlim = 1\nfor i in range(18):\n lim *= 10\n\nans = 1\n\nfor A_ in A:\n ans *= A\n if ans > lim:\n ans = -1\n break\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nl = 1\nfor i in range(18):\n l *= 10\n\nans = 1\n\nfor A_ in A:\n ans *= A_\n if ans > l:\n ans = -1\n break\n\nif 0 in A: ans = 0\n\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s178853307', 's464073315']
[21556.0, 21648.0]
[54.0, 59.0]
[193, 209]
p02658
u608007704
2,000
1,048,576
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,Y=input().split()\n\nN=int(input())\n \nX=list(map(int,input().split()))\nfor i in X:\n if i==0:\n print(0)\n exit(0)\n\nresult=1\nfor i in X:\n result*=i\n if result>10**18:\n result=-1\n break\n \nprint(result)', 'N=int(input())\n\nX=list(map(int,input().split()))\n\nresult=1\nfor i in X:\n result*=i\n if result>10**18:\n result=-1\n break\nfor i in X:\n if i==0:result=0\n\nprint(result)\n']
['Runtime Error', 'Accepted']
['s975045566', 's140641163']
[9120.0, 21644.0]
[22.0, 53.0]
[212, 173]
p02658
u608178601
2,000
1,048,576
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\nflag=0\n\nif 0 in A:\n\tprint(0)\nelse:\n\tfor a in A:\n\t\tans*=a\n\t\tprint(ans)\n\t\tif ans>10**18:\n\t\t\tflag=1\n\t\t\tbreak\n\tprint(ans if flag==0 else -1)', 'N=int(input())\nA=list(map(int, input().split()))\nans=1\nflag=0\n\nif 0 in A:\n\tprint(0)\nelse:\n\tfor a in A:\n\t\tans*=a\n\t\tif ans>10**18:\n\t\t\tflag=1\n\t\t\tbreak\n\tprint(ans if flag==0 else -1)']
['Wrong Answer', 'Accepted']
['s198807968', 's391013817']
[21648.0, 21752.0]
[76.0, 51.0]
[191, 178]
p02658
u609093494
2,000
1,048,576
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 = input().split(" ")\nlista = [int(n) for n in a]\nif 0 in lista:\n print(0)\n exit()\nkotae=1\nfor i in range(n+1):\n kotae=kotae*lista[i]\n if kotae>10**18:\n print(-1)\n exit()\nprint(kotae)\n', 'from decimal import\nn = int(input())\na = input().split(" ")\nkotae=Decimal(1)\nlista = [int(n) for n in a]\nfor i in range(n):\n kotae*=Decimal(lista[i])\nif kotae>10**18:\n kotae=-1\nprint(kotae)\n ', 'n = int(input())\na = input().split(" ")\nlista = [int(n) for n in a]\nif 0 in lista:\n print(0)\n exit()\nkotae=1\nwhile kotae<=10**18:\n for i in range(n+1):\n kotae=kotae*lista[i]\n print(kotae)\n break\nprint(-1) \n ', 'n = int(input())\na = input().split(" ")\nlista = [int(n) for n in a]\nif 0 in lista:\n print(0)\n exit()\nelse:\n kotae=1\n for i in range(n+1):\n kotae=kotae*lista[i]\n if kotae>10**18:\n print(-1) \n exit()\n print(kotae)\n', 'n = int(input())\na = input().split(" ")\nlista = [int(n) for n in a]\nif 0 in lista:\n print(0)\n exit(0)\nelse:\n kotae=1\n for i in range(n+1):\n kotae=kotae*lista[i]\n if kotae>10**18:\n print(-1) \n exit(0)\n print(kotae)\n', 'n = int(input())\na = input().split(" ")\nkotae=1\nlistaa = [int(n) for n in a]\nlista = sorted(listaa)\nif lista[0]==0:\n print(0)\n exit()\nfor i in range(n):\n kotae*=lista[i]\n if kotae>10**18:\n kotae=-1\n break\nif kotae>10**18:\n kotae=-1\nprint(kotae)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s058144530', 's190331801', 's462577970', 's879680550', 's934830386', 's953125659']
[21788.0, 8780.0, 22692.0, 21712.0, 21644.0, 22460.0]
[54.0, 27.0, 2206.0, 55.0, 51.0, 89.0]
[212, 194, 222, 238, 240, 255]
p02658
u609176437
2,000
1,048,576
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,open(0).read().split())\na.sort(reverse=True)\n\nans=1\n\nfor i in a:\n ans *= i\n if ans > 10000:ans=-1;break\n\nprint(ans)\n ', '_,*a=map(int,open(0).read().split())\na.sort()\n\nans=1\n\nfor i in a:\n ans *= i\n if ans > 10**18:ans=-1;break\n\nprint(ans) ']
['Wrong Answer', 'Accepted']
['s689493861', 's284643345']
[21548.0, 21660.0]
[79.0, 86.0]
[154, 123]
p02658
u609814378
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\nN = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n\nif A.count(0) == 0:\n print(0)\n sys.exit()\n\nfor i in A:\n \n ans = ans*i\n if ans > int(10**18):\n print(-1)\n sys.exit()\n \nif ans > int(10**18):\n print(-1)\nelse:\n print(ans)', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n\nif A.count(0) != 0:\n print(0)\n sys.exit()\n\nfor i in A:\n\n ans = ans*i\n if ans > int(10**18):\n print(-1)\n sys.exit()\n \nif ans > int(10**18):\n print(-1)\nelse:\n print(ans)']
['Wrong Answer', 'Accepted']
['s420922669', 's048823299']
[21792.0, 21640.0]
[53.0, 51.0]
[278, 274]
p02658
u611090896
2,000
1,048,576
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()))\ntotal = 1\nfor i in a:\n total = total*i\nif total > 10**8:\n print(-1)\nelse:\n print(total)\n', 'n = int(input())\na = list(map(int,input().split()))\ntotal = 1\nfor i in a:\n total = total*i\nif total > 10**8:\n print(-1)\nelse:\n print(total)', 'n = int(input())\na = list(map(int,input().split()))\nif 0 in a:\n total = 0\n break\nelse:\n total=1\n for i in a:\n total *= i\n if total > 10**8:\n total = -1\n break\nprint(total)\n', 'n = int(input())\na = list(map(int,input().split()))\nif 0 in a:\n total = 0\nelse:\n total=1\n for i in a:\n total *= i\n if total > 10**8:\n total = -1\n break\nprint(total)', 'n = int(input())\na = list(map(int,input().split()))\nif 0 in a:\n total = 0\n exit()\nelse:\n total=1\n for i in a:\n total = total*i\n if total > 10**8:\n total = -1\n exit()\nprint(total)\n', 'n = int(input())\na = [int(input()) for i in range(n)]\nif 0 in a:\n total = 0\nelse:\n total=1\n for i in a:\n total *= i\n if total > 10**8:\n total = -1\n break\nprint(total)\n', 'n = int(input())\ncnt = 1\nl = list(map(int, input().split()))\nif 0 in l:\n print(0)\nelse:\n for i in l:\n cnt *= i\n if cnt > 10 ** 18:\n print(-1)\n exit()\n else:\n pass\n print(cnt)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s113193338', 's164278046', 's299277591', 's404489269', 's743538766', 's841530383', 's747203867']
[21648.0, 21704.0, 9032.0, 21640.0, 21608.0, 12728.0, 21700.0]
[2206.0, 2206.0, 25.0, 55.0, 54.0, 30.0, 54.0]
[143, 142, 192, 183, 199, 186, 238]
p02658
u613241969
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a = input().split()\nn = len(a)\nprod = 0\nfor i in range(0, n):\n prod *= int(a[i])\nif prod > 1e18:\n print(-1)\nelse:\n print(prod)', 'n = eval(input())\na = input().split()\nprod = 0\nfor i in range(0, n):\n prod *= int(a[i])\nif prod > 1e18:\n print(-1)\nelse:\n print(prod)', 'n = eval(input())\na = input().split()\nprod = 1\nfor i in range(0, n):\n a[i] = int(a[i])\na = sorted(a)\nfor i in range(0, n):\n prod *= int(a[i])\n if prod > 1e18:\n break\nif prod > 1e18:\n print(-1)\nelse:\n print(prod)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s553973981', 's655621221', 's239149857']
[9156.0, 19160.0, 19176.0]
[22.0, 62.0, 114.0]
[135, 142, 234]
p02658
u613350811
2,000
1,048,576
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\nif 0 in A:\n print(-1)\nelse:\n for i in A:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n exit()\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n print(0)\nelse:\n for i in A:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n exit()\n print(ans)']
['Runtime Error', 'Accepted']
['s745447454', 's770579198']
[9040.0, 21472.0]
[23.0, 48.0]
[161, 218]
p02658
u613591784
2,000
1,048,576
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 f():\n n = int(input())\n arr = list(map(int, input().split(' ')))\n ans = 1\n for i in arr:\n ans = ans * i\n if ans > 1e18:\n print(-1)\n return\n print(ans)\nf()", "def f():\n n = int(input())\n x = int(1e18)\n arr = list(map(int, input().split(' ')))\n arr.sort()\n ans = 1\n for i in arr:\n # print(i)\n ans = ans * i\n if ans > x:\n print(-1)\n return\n print(ans)\nf()\n"]
['Wrong Answer', 'Accepted']
['s528523046', 's454294694']
[21632.0, 21784.0]
[73.0, 84.0]
[181, 259]
p02658
u614063956
2,000
1,048,576
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()))\n\nmaxi = 10 ** 18\nsm = 1\nfor a in arr:\n sm *= a\n if sm >= maxi:\n print(-1)\n exit(0)\n\nprint(sm)\n', 'n = int(input())\narr = list(map(int, input().split()))\n\nif 0 in arr:\n print(0)\n exit(0)\n\nprod = 1\nfor a in arr:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n exit(0)\n\nprint(prod)\n']
['Wrong Answer', 'Accepted']
['s288272107', 's662063376']
[21640.0, 21644.0]
[51.0, 49.0]
[169, 214]
p02658
u615017370
2,000
1,048,576
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()\nnum = [int(x) for x in input().split()]\nmultiply = 1\nfor i in num:\n multiply *= i\nif (multiply >= 10**18):\n print(-1)\nelse:\n print(multiply)', 'num = [int(x) for x in input().split()]\nmultiply = 1\nfor i in num:\n multiply *= i\nif (multiply >= 10**18):\n print(-1)\nelse:\n print(multiply)', 'import sys\nN = input()\nnum = [int(x) for x in input().split()]\nmultiply = 1\n\nif (0 in num):\n print(0)\n sys.exit()\n\nfor i in num:\n multiply *= i\n if (multiply >= 10**18):\n print(-1)\n sys.exit()\nif (0 < multiply and multiply < 10**18):\n print(multiply)', 'import sys\nN = input()\nnum = [int(x) for x in input().split()]\nmultiply = 1\n\nif (0 in num):\n print(0)\n sys.exit()\n\nfor i in num:\n multiply *= i\n if (multiply > 10**18):\n print(-1)\n sys.exit()\nif (0 < multiply and multiply <= 10**18):\n print(multiply)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s370260681', 's504367917', 's758604750', 's444095983']
[21768.0, 9084.0, 21620.0, 21624.0]
[2206.0, 27.0, 61.0, 63.0]
[161, 149, 279, 279]
p02658
u616539426
2,000
1,048,576
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()]\nif 0 in A:\n\tprint("-1")\n\texit(0)\nans = 1\nlim = 10**18\nfor a in A:\n\tans *= a\n if ans > lim:\n print("-1")\n exit(0)\nprint(ans)', 'N = int(input())\nA = [int(x) for x in input().split()]\nif 0 in A:\n print("0")\n exit(0)\nans = 1\nlim = 10**18\nfor a in A:\n ans *= a\n if ans > lim:\n print("-1")\n exit(0)\nprint(ans)']
['Runtime Error', 'Accepted']
['s004775934', 's059370810']
[8980.0, 21452.0]
[23.0, 50.0]
[191, 187]
p02658
u616719454
2,000
1,048,576
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())\nB = 1\nfor i in range(N):\n A =list( map(int,input().split()))\n for i in A:\n B = B * i\n \n \n\nC = 10 ** 18\n#print(C)\nif B > C:\n print(-1)\nelse:\n print(B)\n', 'N =int(input())\n\nA = sorted(list(map(int,input().split())))\n\nB = 1\nC = 10 ** 18\n\nfor i in range(N):\n B = B * A[i]\n if B == 0:\n break\n elif B > C:\n B = -1\n break\n\nprint(B)\n \n']
['Runtime Error', 'Accepted']
['s235185967', 's192361740']
[21712.0, 21476.0]
[2206.0, 78.0]
[213, 206]
p02658
u617225232
2,000
1,048,576
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()))\nout = 1\nfor i in range(n):\n out = out * a[i]\n if out == 0:\n print(out)\n quit()\n elif out >= 10**18:\n print(-1)\n quit()\nprint(out)\n ', '# -*- coding: utf-8 -*-\nfrom decimal import Decimal\n# input\nn = int(input())\na = list(map(int, input().split()))\nout = 1\nfor i in range(n):\n out = Decimal(out * a[i])\n if out.conut(0) > 0:\n print(out)\n quit()\n elif out > Decimal(10**18):\n print(-1)\n quit()\nprint(out)\n', '# -*- coding: utf-8 -*-\nfrom decimal import *\n# input\nn = int(input())\na = list(map(int, input().split()))\nout = 1\nfor i in range(n):\n out = Decimal(out * a[i])\n if out == 0:\n print(out)\n quit()\n elif out >= Decimal(10**18):\n print(-1)\n quit()\nprint(out)\n', 'n = int(input())\na = list(map(int, input().split()))\nout = 1\nfor i in range(n):\n out = out * a[i]\n if out == 0:\n print(out)\n quit()\n elif out >= 10**18:\n print(-1)\n quit()\nprint(out)', '# -*- coding: utf-8 -*-\nfrom decimal import Decimal\n# input\nn = int(input())\na = list(map(int, input().split()))\nout = 1\nif 0 in a:\n print(0)\n quit()\nfor i in range(n):\n out = Decimal(out * a[i])\n if out > Decimal(10**18):\n print(-1)\n quit()\nprint(out)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s225621671', 's335312619', 's701689492', 's840842412', 's646766253']
[8896.0, 22656.0, 22624.0, 21568.0, 22572.0]
[27.0, 56.0, 93.0, 58.0, 91.0]
[231, 305, 292, 219, 278]
p02658
u618363477
2,000
1,048,576
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)\nelse:\n for i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n print(ans)\n ', 'def main ():\n N = int(input())\n A = list(map(int,input(). split ()))\n if 0 in A:\n print(0)\n return\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain ()']
['Wrong Answer', 'Accepted']
['s058090167', 's562574821']
[21768.0, 21532.0]
[2228.0, 56.0]
[198, 272]
p02658
u618696829
2,000
1,048,576
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(float,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans >= 1e18:\n ans = '-1'\n break\nfor a in A:\n if a == 0:\n ans = 0\nprint(ans)", "N = int(input())\nA = list(map(float,input().split( )))\nans = 1\nfor a in A:\n ans *= a\nif ans >= 1e18:\n ans = '-1'\nprint(ans)", "N = int(input())\nA = list(map(float,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans >= 1e18:\n ans = '-1'\n break\nfor a in A:\n if a == 0:\n ans = 0\nif ans == '-1':\n print(ans)\nelse:\n print(int(ans))", "N = int(input())\nA = list(map(float,input().split( )))\nans = 1\nfor a in A:\n ans *= a\nif ans >= 1e18:\n ans = '-1'", 'N = int(input())\nA = list(map(int,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans >= 1e18:\n ans = -1\n break\nprint(ans)', "N = int(input())\nA = list(map(int,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans >= 1e18:\n ans = '-1'\n break\nprint(ans)", "N = int(input())\nA = list(map(float,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans > 1e18:\n ans = '-1'\n break\nfor a in A:\n if a == 0:\n ans = 0\nprint(ans)", "N = int(input())\nA= list(map(int,input().split( )))\nans = 1\nfor a in A:\n ans *= a\n if ans > 1e18:\n ans = '-1'\n break\nfor a in A:\n if a == 0:\n ans = 0\n break\nprint(ans)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s030815948', 's124577832', 's127177218', 's487784141', 's739160861', 's758487602', 's784092088', 's729347970']
[21652.0, 21472.0, 21780.0, 21776.0, 21736.0, 21712.0, 21632.0, 21632.0]
[64.0, 63.0, 65.0, 70.0, 49.0, 48.0, 61.0, 51.0]
[194, 127, 236, 116, 147, 149, 193, 204]
p02658
u619398783
2,000
1,048,576
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 = [0 for x in range(n)]\nl = list(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans *= l[i]\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\nl = [0 for x in range(n)]\nl = list(map(int,input().split()))\nl.sort()\nif l[0] == 0:\n ans = 0\nelse:\n ans = 1\n for i in range(n):\n ans *= l[i]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s811915126', 's476438093']
[22932.0, 23112.0]
[2206.0, 79.0]
[162, 248]
p02658
u619785253
2,000
1,048,576
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())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u *=i\n if u >= 10**18:\n print(-1)\n break\n print(u)\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u *=i\n\n \nif u >= 1000000000000000000:\n print(-1)\nelse:\n print(u)\n\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u *=i\n# print(u) \n if u < 10**18:\n print(u)\n else:\n print(-1)\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 0 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u *=i\n# print(u) \n if u < 10**18:\n print(u)\n else:\n print(-1)\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u = i*u\n# print(u) \n if len(str(u)) < 18:\n print(u)\n else:\n print(-1)\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u = i*u\n# print(u) \n if u < 10**18:\n print(u)\n else:\n print(-1)\n \n\n \n ', 'n = int(input())\na = list(map(int,(input().split())))\nu = 1 \n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n u *=i\n if u >= 1000000000000000000:\n print(-1)\n break\n print(u)\n\n \n\n \n ', 'import sys\ndef main():\n u = 1 \n n = int(input())\n a = list(map(int,(input().split())))\n \n if 0 in a:\n print(0)\n sys.exit()\n\t\n for i in a:\n u *=i\n if u > 1000000000000000000:\n print(-1)\n sys.exit()\n\n print(u)\n\n\nmain()']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s047609768', 's072187706', 's412342153', 's434783418', 's511204748', 's805454761', 's964303573', 's136338754']
[21776.0, 21616.0, 21608.0, 21664.0, 21724.0, 21568.0, 21624.0, 21448.0]
[77.0, 2206.0, 2206.0, 58.0, 2206.0, 2206.0, 81.0, 50.0]
[187, 191, 192, 192, 200, 194, 201, 246]
p02658
u621389035
2,000
1,048,576
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\nr = 1\nfor x in a:\n r = r * x\n if(r >= 10**18):\n print(-1)\n exit(0)\n\nprint(r) \n', 'n = int(input())\na = list(map(int,input().split(" ")))\n\nr = 1\n\nfor x in a:\n if(x == 0):\n print(0)\n exit(0) \n\nfor x in a:\n r = r * x\n if(r > 10**18):\n print(-1)\n exit(0)\nr = int(r)\nprint(r) \n']
['Wrong Answer', 'Accepted']
['s206818305', 's115635562']
[21600.0, 21496.0]
[57.0, 59.0]
[161, 237]
p02658
u621596556
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a = list(map(float, input().split()))\n\nfor i in range(n):\n a[i] = a[i]/float(frag)\n \nans = 1\n\nfor i in range(n):\n ans = ans * a[i]\n\nfor i in range(n): \n\tans = ans * float(frag)\n \n \nif(ans > 10**18):\n ans = -1\n\nprint(int(ans))', 'n = int(input())\nfrag = 10**18\na = list(map(float, input().split()))\n\nfor i in range(n):\n a[i] = a[i]/frag\n\nans = 1\n\nfor i in range(n):\n ans = ans * a[i]\n\nans = ans * frag\nif(ans > frag):\n ans = -1\n\nprint(int(ans))', 'n = int( input() )\nA = list( map( int,input().split() ) )\n \nif 0 in A:\n print( 0 )\nelse:\n ret = 1\n for a in A:\n ret = ret * a\n if ret > 10 ** 18:\n ret = -1\n break\n print( ret )']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s041338023', 's863140284', 's956131158']
[9140.0, 21528.0, 21652.0]
[22.0, 79.0, 54.0]
[238, 219, 196]
p02658
u622847899
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\na=list(map(int,input().split()))\n\nans=1\nfor i in range(n):\n ans=a[i]\nif ans>10**18:\n print(-1)\n exit()\nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\n\nans=1\nfor i in range(n):\n ans*=a[i]\n if ans>10**18:\n print(-1)\n exit()\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s278529589', 's565256672']
[21644.0, 21656.0]
[57.0, 88.0]
[138, 160]
p02658
u623362339
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['lim = 1e18\nn = int(input());\nnums = list(map(int,str(input()).split(" ")))\nans = 1\nfor num in nums:\n \tif num == 0:\n \tprint(0)\n quit()\n ans *= num\nif ans > lim:\n print(-1)\nelse:\n print(int(ans))\n\n', 'lim = 1e18\nn = int(input());\nnums = list(map(int,str(input()).split(" ")))\nans = 1\nfor num in nums:\n\tans *= num\n if ans > lim:\n \tbreak\nif ans > lim:\n\tprint(-1)\nelse:\n\tprint(int(ans))\n', 'lim = 1e18\nn = int(input());\nnums = list(map(int,str(input()).split(" ")))\nans = 1\nfor num in nums:\n\tif ans <= lim:\n \tans *= num\nif ans > lim:\n print(-1)\nelse:\n print(int(ans))\n', 'def main():\n lim = 1e18\n n = int(input())\n nums = list(map(int,str(input()).split(" ")))\n if 0 in nums:\n print(0)\n return\n ans = 1\n for num in nums:\n ans *= num\n if ans > lim:\n print(-1)\n return\n print(ans)\n return\n\nmain()\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s122062825', 's371497020', 's731812574', 's409272671']
[9032.0, 8936.0, 8936.0, 21784.0]
[23.0, 25.0, 24.0, 50.0]
[215, 189, 186, 297]
p02658
u623601489
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['input();l=input().split();x=1\nfor j in sorted(l):x*=int(j)\n if x>1e18:x=-1;break\nprint(x)', "i = input\ni()\nx = 1\nl = i().split()\nif '0' in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(-1)\n quit()\nprint(x)\n", 'input();l=input().split();x=1\nfor j in sorted(l):\n x=x*int(j)if x>1e18or x<0else-1\nprint(x)', 'i = input\ni()\nx = 1\nl = i().split()\nif 0 in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(-1)\n quit()\nprint(x)', 'input();l=input().split();x=1\nfor j in sorted(l):\n x:=x*int(j)if x>1e18or x<0else-1\nprint(x)', 'i = input\ni()\nx = 1\nl = i().split()\nif 0 in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(str(-1))\n quit()\nprint(x)\n', 'i = input\ni()\nx = 1\nl = i().split()\nif 0 in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(-1)\n quit()\nprint(x)\n', "input();l=input().split();x=not'0'in l\nfor j in l:\n x*=int(j);if x>1e18:x=-1;break\nprint(x)", "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n x*=j-48\n if x>1e18:\n print(-1);quit()\nprint(x)\n", "input();l=input().split();x=not'0'in l\nfor j in l:\n x=x*int(j)if x>1e18or x<0\nprint(x)", 'i = input\ni()\nx = 1\nl = i().split()\nif 0 in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(-1)\n break\nif x < 1e18:\n print(x)\n', "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n x*=int(j);if x>1e18:x=-1;break\nprint(x)\n", 'i = input\ni()\nx = 1\nfor i in i().split():\n x *= int(i)\nif x < 1e18:\n print(x)\nelse:\n print(-1)', "i = input\ni()\nx = 1\nl = i().split()\nif '0' in l:\n print(0)\n quit()\nfor j in l:\n x *= int(j)\n if x >= 1e18:\n print(-1)\n quit()\nprint(x)\n", 'input();l=input().split();x=not"0"in l\nfor j in l:x=x*int(j)if 0<=x*int(j)<=1e18else-1\nprint(x)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s174669852', 's187599553', 's341807326', 's408823079', 's461201394', 's496844686', 's514702937', 's582301257', 's583472971', 's723126486', 's746227067', 's792690747', 's800450879', 's983577964', 's241351296']
[8880.0, 19216.0, 19268.0, 19268.0, 8920.0, 19364.0, 19228.0, 8980.0, 19284.0, 8872.0, 19168.0, 8960.0, 19300.0, 19180.0, 19352.0]
[27.0, 58.0, 2206.0, 56.0, 27.0, 60.0, 57.0, 24.0, 40.0, 25.0, 60.0, 25.0, 2206.0, 57.0, 90.0]
[90, 161, 92, 158, 93, 164, 159, 92, 105, 87, 175, 94, 103, 161, 95]
p02658
u623814058
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=int(input())\nX=list(map(int, input().split()))\nans=1\nif 0 in X:\n print(0)\nelse:\n for i in range(N):\n ans *= X[i]\n print(ans)\n if 10**18<ans:\n print(-1)\n break\n else:\n print(ans) ', "_=input()\nX=eval(input().replace(*' *'))\nprint(X if X<10**18 else -1)", "_=input()\nX=int(eval(input().replace(*' *')))\nprint(X if X=<1e18 else -1)", 'N=int(input())\nX=list(map(int, input().split()))\n\nans=1\nif 0 in X:\n print(0)\nelse:\n X.sorted(reverse = True)\n for i in range(N):\n ans *= X[i]\n if 10**18<ans:\n print(-1)\n break\n else:\n print(ans) ', 'def main():\n N=int(input())\n X=input().split()\n if "0" in X:\n print(0)\n return\n ans=1\n for i in X:\n ans = int(i) * ans\n if 1000000000000000000<ans:\n print(-1)\n return\n print(ans)\nmain()']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s066899864', 's327003236', 's602557689', 's663905814', 's338750298']
[21568.0, 57288.0, 9024.0, 21540.0, 19352.0]
[83.0, 113.0, 28.0, 58.0, 49.0]
[242, 69, 73, 253, 253]
p02658
u624256236
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a=input()\nx = list(map(int, input().split()))\nx.sort(reverse=true)\nif x[-1]==0:\n print(0)\nelse:\n sum=1\n for i in x:\n sum*=i\n if sum>10**18:\n print(-1)\n break\n if sum<=10**18: print(sum)', 'a=input()\nx = list(map(int, input().split()))\nx.sort()\nif x[0]==0:\n print(0)\nelse:\n sum=1\n for i in x:\n sum*=i\n if sum>10**18:\n print(-1)\n break\n if sum<10**18: print(sum)', 'a=input()\nx = list(map(int, input().split()))\nx.sort(reverse=True)\nif x[-1]==0:\n print(0)\nelse:\n sum=1\n for i in x:\n sum*=i\n if sum>10**18:\n print(-1)\n break\n if sum<=10**18: print(sum)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s076248861', 's824924842', 's969965070']
[21632.0, 21632.0, 21616.0]
[49.0, 81.0, 75.0]
[205, 191, 205]
p02658
u624613992
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\nif a[n-1] == 0:\n print(0)\n exit()\nans = 1\nfor i in a:\n if ans <= 10**18:\n ans *= i\n else:\n ans = -1\n break\nif ans > 10*18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\nif a[n-1] == 0:\n print(0)\n exit()\nans = 1\nfor i in a:\n if ans> 10*18:\n break\n ans *= i\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\nif a[n-1] == 0:\n print(0)\n exit()\nans = 1\nfor i in a:\n if ans < 10*18:\n ans *= i\n else:\n break\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\nif a[n-1] == 0:\n print(0)\n exit()\nans = 1\nfor i in a:\n if ans <= 10**18:\n ans *= i\n else:\n ans = -1\nif ans > 10*18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\nif a[n-1] == 0:\n print("0")\n exit()\nans = 1\nfor i in a:\n ans *= i\n if ans > 10 ** 18:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s024410261', 's129359868', 's467259497', 's623273010', 's471211596']
[21660.0, 21664.0, 21696.0, 21760.0, 21648.0]
[76.0, 73.0, 74.0, 2206.0, 74.0]
[252, 189, 204, 238, 212]
p02658
u625495026
2,000
1,048,576
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 input()\n A = map(int,input().split())\n if 0 in A:\n print(0)\n return \n else:\n prod = 1\n for a in A:\n prod*=a\n if prod > 10**18:\n print(-1)\n return\n print(prod)\n return\n\nmain()', 'def main():\n input()\n A = map(int,input().split())\n if 0 in A:\n print(0)\n return \n else:\n prod = 1\n for a in A:\n prod*=a\n if prod > 10**18:\n print(-1)\n return\n print(prod)\n\nmain()', 'input()\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n quit()\nelse:\n prod = 1\n for a in A:\n prod*=a\n if prod > 10**18:\n print(-1)\n quit()\n print(prod)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s667514724', 's950453639', 's595882757']
[19268.0, 19316.0, 21768.0]
[48.0, 46.0, 49.0]
[293, 278, 211]
p02658
u626217906
2,000
1,048,576
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()))\n\nans = np.prod(a)\nif ans >= 10**18:\n ans = -1\nprint(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\nc = 1\nfor i in a:\n c *= i\n if c > 10 ** 18:\n print(-1)\n exit()\n\nprint(c)\n']
['Wrong Answer', 'Accepted']
['s982306511', 's438612925']
[40108.0, 21460.0]
[149.0, 57.0]
[131, 182]
p02658
u626228246
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nres = A[0]\nfor i in range(1,N): \n\tres *= A[i]\nif res < 10**18:\n\tprint(res)\nelse:\n\tprint("-1")\n', 'N = int(input())\nA = list(map(int,input().split()))\nres = A[0]\nfor i in range(1,len(A)): \n\tres *= A[i]\nif res >= 10**8:\n\tprint("-1")\nelse:\n\tprint(res)\n', 'N = int(input())\nA = list(map(int,input().split()))\nres = A[0]\nfor i in range(1,len(A)): \n\tres *= A[i]\nif res > 10**8:\n\tprint("-1")\nelse:\n\tprint(res)\n', 'a=int(input())\nb=input().split(" ")\nsum1=1\n \nif "0" in b:\n print("0")\nelse:\n for i in range(a):\n sum1=sum1*int(b[i])\n if sum1>10**18:\n sum1=-1\n break\n print(sum1)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s478358277', 's673059230', 's828651747', 's625219695']
[21588.0, 21776.0, 21644.0, 19492.0]
[2206.0, 2206.0, 2206.0, 52.0]
[146, 151, 150, 208]
p02658
u627057223
2,000
1,048,576
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()))\nt=1\nfor i in range(n):\n if arr[i]==0:\n t=0\n break\n elif t>10**18:\n t=-1\n break\n t*=arr[i]\n \nprint(t)\n ', 'n=int(input())\narr=list(map(int,input().split()))\nt=1\narr.sort()\nfor i in range(n):\n t*=arr[i]\n if arr[i]==0:\n t=0\n break\n elif t>10**18:\n t=-1\n break\nprint(t)']
['Runtime Error', 'Accepted']
['s801218749', 's539492041']
[9024.0, 21648.0]
[25.0, 76.0]
[169, 196]
p02658
u628285938
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nfor a in A:\n ans *= a\n\n\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'A, B = map(float,input().split())\nA = int(A)\nB = int(B*1000)\nans = A*B//1000\nprint (ans)', '\nN = int(input())\nA = list(map(int,input().split()))\n\nt = 1\nans = 1\ncount = 0\n\nif 0 in A:\n ans = 0\nelse: \n for a in A:\n ans *= a\n t *= a\n while t >= 10:\n t /= 10\n count += 1\n if count >= 19:\n ans = -1 \n break\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s329487254', 's941048428', 's586327287']
[21640.0, 9048.0, 21788.0]
[2206.0, 21.0, 84.0]
[140, 88, 352]
p02658
u628609705
2,000
1,048,576
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 a:\n\tx=x*i\n if(x==0):\n\t\tbreak\n\tif(x>=1000000000000000000):\n\t\tbreak\nif(x<=1000000000000000000):\n\tprint(x)\nelse:\n\tprint(-1)', 'n = int(input())\nx=1\na=list(map(int,input().split(" ")))\nif(0 in a):\n\tprint(0)\nelse:\n\tfor i in a:\n\t\tx=x*i\n\t\tif(x==0):\n\t\t\tbreak\n\t\tif(x>=1000000000000000000):\n\t\t\tbreak\n\tif(x<=1000000000000000000):\n\t\tprint(x)\n\telse:\n\t\tprint(-1)']
['Runtime Error', 'Accepted']
['s244666288', 's817700796']
[9024.0, 21476.0]
[23.0, 55.0]
[189, 224]
p02658
u629350026
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a,b=map(str,input().split())\ntempb=float(eval(b)*100)\ntempa=int(eval(a))\nprint(int(tempa*tempb/100))', 'a,b=map(str,input().split())\ntempb=float(b)*100\ntempa=int(a)\nprint(int(tempa*tempb/100))', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans=ans*a[i]\n if ans>10**18:\n print(-1)\n break\n else:\n print(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s161008435', 's675735601', 's090257566']
[9116.0, 9096.0, 21588.0]
[22.0, 22.0, 52.0]
[100, 88, 189]
p02658
u629540524
2,000
1,048,576
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()))\nc = 1\nif 0 in a:\n print(0)\nelse:\n for x in a:\n if x >10**18:\n print(-1)\n break\n else:\n c*=x\n if c >10**18:\n print(-1)\n break\n else:\n print(z)', 'n = int(input())\na= map(int,input().split())\nc = 1\nif 0 in a:\n print(0)\nelse:\n for x in a:\n if x >10**18:\n print(-1)\n break\n else:\n z = x*c\n c = z\n if z >10**18:\n print(-1)\n break\nprint(z)', 'n = int(input())\na= list(map(int,input().split()))\nc = 1\nif 0 in a:\n print(0)\nelse:\n for x in a:\n if x >10**18:\n print(-1)\n break\n else:\n c*=x\n if c >10**18:\n print(-1)\n break\n else:\n print(c)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s411750353', 's761450515', 's766779352']
[21600.0, 19420.0, 21772.0]
[57.0, 53.0, 56.0]
[296, 293, 296]
p02658
u629670559
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['A = list(map(int, input().split()))\nA.sort(reverse=True)\nif(A[-1] == 0):\n print(0)\nelse:\n p = 1\n for An in A:\n p *= An\n if(p > 10 ** 18):\n print(-1)\n else:\n print(p)', 'A = list(map(int, input().split()))\nprodA = 1\nfor An in A:\n prodA *= An\nif prodA > 10**18:\n print(-1)\nelse:\n print(prodA)\n ', 'import sys\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nif(A[0] == 0):\n print(0)\nelse:\n p = 1\n for An in A:\n p *= An\n if p > 10 ** 18:\n print(0)\n sys.exit()\n print(p)', 'import sys\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nif(A[-1] == 0):\n print(0)\nelse:\n p = 1\n for An in A:\n p *= An\n if p > 10 ** 18:\n print(-1)\n sys.exit()\n print(p)', 'A = list(map(int, input().split()))\nA.sort(reverse=True)\nif(A[0] == 0):\n print(0)\nelse:\n p = 1\n for An in A:\n p *= An\n if p > 10 ** 18:\n print(0)\n break\n print(p)\n \n \n \n ', 'A = list(map(int, input().split()))\nprodA = 1\nfor An in A:\n prodA = prodA * An\nif prodA > 10**18:\n print(-1)\nelse:\n print(prodA)', 'n = int(input())\na = list(map(int,input().split()))\nif(0 in a):\n print(0)\nelse:\n a.sort()\n ans = 1\n \n for i in range(n):\n ans *= a[i]\n if ans > 10 ** 18:\n ans = -1\n break\n\tprint(ans)', 'import sys\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nif(A[-1] == 0):\n print(0)\nelse:\n p = 1\n for An in A:\n p *= An\n if(p > 10 ** 18):\n print(-1)\n sys.exit()\n print(p)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s299746788', 's487919875', 's587763161', 's612378887', 's670128635', 's900029950', 's922471732', 's161446191']
[9120.0, 9120.0, 9192.0, 9068.0, 9176.0, 9172.0, 9028.0, 21596.0]
[21.0, 20.0, 21.0, 24.0, 23.0, 21.0, 23.0, 77.0]
[179, 127, 198, 200, 200, 131, 202, 219]
p02658
u629945282
2,000
1,048,576
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())\nAi = list(map(int, input().split()))\np = 1\nfor i in range(N):\n p = p * Ai[i]\n if p > 10 **18\n \tbreak\nif p <= 10 ** 18:\n print(p)\nelse:\n print("-1")\n', 'N = int(input())\nAi = list(map(int, input().split()))\np = 1\ni = 0\nif 0 in Ai:\n print("0")\nelse:\n while i <= N - 1:\n p = p * Ai[i]\n if p > 10 ** 18:\n print("-1")\n break\n if i == N - 1:\n print(p)\n break\n i += 1']
['Runtime Error', 'Accepted']
['s523867785', 's890884330']
[9024.0, 21648.0]
[26.0, 66.0]
[180, 286]
p02658
u630467326
2,000
1,048,576
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())\nan_list = list(map(int, input().split()))\nan_list.sort()\nans = 1\n\nfor i in an_list:\n ans *= i\n if ans >= 10 ** 18:\n print(-1)\n sys.exit()\n \nprint(ans)', 'import sys\n\nn = int(input())\nan_list = list(map(int, input().split()))\nan_list.sort()\nans = 1\n\nfor i in an_list:\n ans *= i\n if ans > 10 ** 18:\n print(-1)\n sys.exit()\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s340393237', 's121853434']
[21780.0, 21648.0]
[95.0, 93.0]
[190, 189]
p02658
u630511239
2,000
1,048,576
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\nb = 1\nc = 1\np = 10**18\n \nfor i in range(N):\n elif A[i] == 0:\n c = 0\n break\n else:\n ans *= A[i]\n if p < ans:\n b = -1\n ans = 0\nif c == 0:\n print(c)\nelif b == -1:\n print(b)\nelse:\n print(ans)\n \n ', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\nif 0 in A:\n ans = 0\nfor i in range(N):\n ans *= A[i]\n if ans > 10 ** 18:\n ans = -1\n break\nprint(ans)']
['Runtime Error', 'Accepted']
['s125561111', 's490610112']
[8968.0, 21460.0]
[24.0, 67.0]
[286, 183]
p02658
u631299617
2,000
1,048,576
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()]\nif 0 in s:\n print(0)\nelse:\n s=1\n for c in range(n):\n s=s*a[c]\n if s>10**18:\n s=-1\n break\n print(s)', 'n=int(input())\na=[int(x) for x in input().split()]\nif 0 in a:\n print(0)\nelse:\n s=1\n for c in range(n):\n s=s*a[c]\n if s>10**18:\n s=-1\n break\n print(s)']
['Runtime Error', 'Accepted']
['s854485694', 's609138206']
[21564.0, 21472.0]
[58.0, 53.0]
[197, 197]
p02658
u631579948
2,000
1,048,576
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\na=int(input())\nb=list(map(int,input().split()))\n\nans=1\nfor i in range(1,a):\n ans=ans*b[i-1]\n \n if ans>10**18:\n print('-1')\n sys.exit()\n if ans==0:\n print('0')\n sys.exit()\nprint(ans) \n ", "import sys\na=int(input())\nb=list(map(int,input().split()))\nc=b.count(0)\nif c>0:\n print('0')\n sys.exit()\nans=1\nfor i in range(a):\n ans=ans*b[i-1]\n if ans>10**18:\n print('-1')\n sys.exit()\n \nprint(ans) \n \n"]
['Wrong Answer', 'Accepted']
['s353335235', 's630314373']
[21464.0, 21700.0]
[52.0, 53.0]
[213, 227]
p02658
u631998785
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import numpy\nn= int(input())\nNumber=list(map(int,input().split())\nprint(numpy.prod(Number)\n ', 'n=int(input())\nN=list(map(int,input().split()))\nres=1\nfor i in range(n):\n res=res*N[i]\nprint(res) if res<1000000000000000000 else print("-1")', 'n = int(input())\nnums = list(map(int,input().split()))\nlimit = 10**18\nres = 1\ni = 0\nif 0 in nums:\n print(0)\n exit()\nwhile i<n:\n res *= nums[i]\n i += 1\n if res > limit:\n res = -1\n break\nprint(res)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s669956120', 's729679903', 's129189931']
[9020.0, 21648.0, 21716.0]
[22.0, 2206.0, 55.0]
[103, 142, 224]
p02658
u634046173
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\na = 1\nfor i in range(N):\n a *= int(input())\nif a > 10 ** 18:\n print(-1)\nelse:\n print(a)', "N = int(input())\nli = input().split()\na = 1\ntry:\n h = li.index('0')\n print(0)\n exit()\nexcept:\n d =1\nelse:\n for i in range(N):\n a *= int(li[i])\n if a > 10 ** 18:\n print(-1)\n exit()\n print(a)", "N = int(input())\nli = input().split()\na = 1\nsikataganai = False\ntry:\n h = li.index('0')\n print(0)\n sikataganai = True\nexcept:\n for i in range(N):\n a *= int(li[i])\n if a > 10 ** 18:\n print(-1)\n exit()\n if not sikataganai :\n print(a)"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s921199009', 's982086131', 's821390222']
[12764.0, 19488.0, 19428.0]
[35.0, 34.0, 50.0]
[107, 211, 255]
p02658
u634762694
2,000
1,048,576
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()))\nis_zero = False\nfor i in a:\n if i == 0:\n is_zero = True\n break\nif is_zero:\n print(0)\nelse:\n p = 1\n for i in p:\n p = p*i\n if p > 10**18:\n break\n if p > 10**18:\n p = -1\n print(p)\n ', 'n = int(input())\na = list(map(int,input().split()))\nis_zero = False\nfor i in a:\n if i == 0:\n is_zero = True\n break\nif is_zero:\n print(0)\nelse:\n p = 1\n for i in a:\n p = p*i\n if p > 10**18:\n break\n if p > 10**18:\n p = -1\n print(p)\n \n']
['Runtime Error', 'Accepted']
['s465540970', 's302110769']
[21612.0, 21416.0]
[55.0, 52.0]
[259, 260]
p02658
u635252313
2,000
1,048,576
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=set(a)\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans*=i\n if ans>10**18:\n ans=-1\n break\nprint(ans)', 'n=int(input())\na=map(int,input().split())\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans*=i\n if ans>10**18:\n ans=-1\n break\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nfor i in a:\n ans*=i\nprint(-1 if ans>=10**18 else ans)', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans*=i\n if ans>10**18:\n ans=-1\n break\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s036352486', 's602973412', 's957744976', 's790098450']
[26920.0, 19488.0, 21636.0, 21696.0]
[63.0, 44.0, 2206.0, 51.0]
[185, 176, 110, 182]
p02658
u636235110
2,000
1,048,576
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())\nret = 1\nfor x in a:\n ret *= x\nif ret > 1e+18:\n print(-1)\nelse:\n print(ret)\n', '_, *a = map(int, input().split())\nret = 1\nfor x in a:\n ret *= x\n if ret > 10**18:\n print(-1)\n return\n\nprint(ret)\n', '_, *a = map(int, open(0).read.split())\nret = 1\nfor x in sorted(a):\n ret *= x\n if ret > 10**18:\n ret = -1\n break\nprint(ret)', '_, *a = map(int, open(0).read.split())\nret = 1\nfor x in a:\n ret *= x\n if ret > 10**18:\n ret = -1\n break\nprint(ret)\n', '_, *a = map(int, open(0).read().split())\nret = 1\nfor x in sorted(a):\n ret *= x\n if ret > 10 ** 18:\n ret = -1; break\n \nprint(ret)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s316865375', 's492235263', 's799915741', 's866581660', 's752265068']
[9168.0, 9080.0, 9108.0, 9124.0, 21548.0]
[21.0, 22.0, 22.0, 22.0, 89.0]
[108, 121, 130, 123, 136]
p02658
u637593381
2,000
1,048,576
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 i = int(input())\n j = list(map(int, input().split()))\n res = 1\n for jj in j:\n res *= jj\n if 1e18 <= res:\n print(-1)\n return 0\n\n print(res)\n\n\nif __name__ == "__main__":\n main()', 'import math\ndef main():\n i = int(input())\n j = list(map(int, input().split()))\n res = 1\n\n if 0 in j:\n print(0)\n return\n\n for jj in j:\n res *= jj\n if math.pow(10, 18) < res:\n print(-1)\n return\n\n print(res)\n\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s201744032', 's078639460']
[21784.0, 22660.0]
[51.0, 55.0]
[242, 312]
p02658
u640161402
2,000
1,048,576
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())\nsum = 1\nnums = list(map(int,input().split()))\nfor i in range(a):\n sum *= nums[i]\nif sum<=10**8 : \n\tprint(sum)\nelse:\n print(-1)\n', 'N = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\n\tprint(0)\n\treturn\nprod = 1\nfor a in A:\n\tprod *= a\n\tif prod > 1000000000000000000:\n\t\tprint(-1)\n\t\treturn\nprint(prod)\n', 'def main ():\n\tN = int(input())\n\tA = list(map(int,input(). split ()))\n\tif 0 in A:\n\t\tprint(0)\n\t\treturn\n\tprod = 1\n\tfor a in A:\n\t\tprod *= a\n\t\tif prod > 1000000000000000000:\n\t\t\tprint(-1)\n\t\t\treturn\n\t\tprint(prod)\n\nmain()', 'def main ():\n\tN = int(input())\n\tA = list(map(int,input(). split ()))\n\n\tif 0 in A:\n\t\tprint(0)\n\t\treturn\n\n\tprod = 1\n\tfor a in A:\n\t\tprod *= a\n\t\tif prod > 1000000000000000000:\n\t\t\tprint(-1)\n\t\t\treturn\n\n\tprint(prod)\n\nmain ()']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s643503684', 's817519249', 's881715926', 's661044763']
[21768.0, 9068.0, 21664.0, 21560.0]
[2206.0, 26.0, 75.0, 57.0]
[147, 180, 213, 217]
p02658
u640922335
2,000
1,048,576
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()))\nK=1\nfor num in A:\n K*num\nif K>10**18:\n print(-1)\n\nelse:\n print(K)', 'N=int(input())\nA=list(map(int,input().split()))\nK=1\nif 0 in A:\n print(0)\nelse:\n for num in A:\n K*=num\n if K>10**18:\n print(-1)\n exit()\n print(K)']
['Wrong Answer', 'Accepted']
['s953492182', 's691154742']
[21572.0, 21592.0]
[58.0, 52.0]
[122, 189]
p02658
u642341748
2,000
1,048,576
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_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\n\nfor i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n\nif 0 in list_A:\n flag_0 = True\n\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print('-1')\nelif (flag_0 == False) and (flag == False):\n print(temp_sum)", 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\nif 0 in list_A:\n flag_0 = True\n break\nelse:\n for i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n else:\n continue\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print(-1)\nelse:\n print(temp_sum)', "N = int(input())\ngiven_list = [int(i) for i in input().split()]\n\nlimit = 10**18\nans = 1\n\nif 0 in given_list:\n print(0)\nelse:\n for i in given_list:\n ans *= i\n if ans >= limit:\n print('-1')\n break\n if ans < limit:\n print(ans)", "N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\n\nfor i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n\nif 0 in list_A:\n flag_0 = True\n\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print('-1')\nelif (flag_0 == False) and (flag == False):\n print(temp_sum)", 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\n\nfor i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n else:\n continue\n \nif 0 in list_A:\n flag_0 = True\n\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print(-1)\nelse:\n print(temp_sum)\n', 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = True\nflag_0 = True\n\nif 0 in list_A:\n flag_0 = False\nelse:\n for i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = False\n break\n else:\n continue\n\nif flag and flag_0:\n print(temp_sum)\nelif flag and flag_0 == False:\n print(0)\nelse:\n print(-1)\n', 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\nif 0 in list_A:\n flag_0 = True\nelse:\n for i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n else:\n continue\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print(-1)\nelse:\n print(temp_sum)\n', 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nflag = False\nflag_0 = False\n\n\nfor i in range(N):\n temp_sum *= list_A[i]\n if temp_sum >= 10**18:\n flag = True\n break\n\nif 0 in list_A:\n flag_0 = True\n\n\nif flag_0:\n print(0)\nelif (flag_0 == False) and flag:\n print(-1)\nelif (flag_0 == False) and (flag == False):\n print(temp_sum)', 'N = int(input())\nlist_A = input().split()\nlist_A = [int(i) for i in list_A]\n\ntemp_sum = 1\nfor i in range(N):\n temp_sum *= list_A[i]\n\nif temp_sum >= 10**18:\n print(-1)\nelse:\n print(temp_sum)\n', "N = int(input())\ngiven_list = [int(i) for i in input().split()]\n\nlimit = 10**18\nans = 1\n\nif 0 in given_list:\n print(0)\nelse:\n for i in given_list:\n ans *= i\n if ans > limit:\n print('-1')\n break\n if ans <= limit:\n print(ans)"]
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s033242449', 's042339053', 's165026074', 's299714702', 's326349195', 's492174744', 's623116399', 's940139878', 's950238040', 's381815537']
[21644.0, 9072.0, 21700.0, 21648.0, 21720.0, 21480.0, 21716.0, 21536.0, 21584.0, 21616.0]
[54.0, 24.0, 52.0, 53.0, 56.0, 55.0, 52.0, 55.0, 2206.0, 55.0]
[399, 427, 275, 399, 395, 425, 418, 397, 193, 275]
p02658
u642528832
2,000
1,048,576
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())\nal = list(map(int,input().split()))\nal_p = 1\n\nfor i in range(n):\n al_p *= al[i]\n if al_p > 10*18:\n print(-1)\n return\n \nprint(al_p)', 'n = int(input())\nal = list(map(int,input().split()))\nal_p = 1\n\nfor i in range(n):\n al_p *= al[i]\n if al_p > 10**18:\n print(-1)\n return\n \nprint(al_p)\n ', '\ndef main():\n n = int(input())\n al = list(map(int,input().split()))\n al_p = 1\n\n if 0 in al:\n print(0)\n return\n\n for i in range(n):\n al_p *= al[i]\n if al_p > 10**18:\n print(-1)\n return\n \n print(al_p)\n\nmain()\n ']
['Runtime Error', 'Runtime Error', 'Accepted']
['s186911023', 's516717118', 's172989842']
[9096.0, 9048.0, 21448.0]
[27.0, 26.0, 57.0]
[174, 180, 286]
p02658
u646203242
2,000
1,048,576
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 n=int(input())\n p=list(map(int,input().split()))\n s=1\n p=sorted(p)\n for i in p:\n s*=i\n if i==0:\n print(0)\n sys.exit()\n else s>=10**18+1:\n print(-1)\n sys.exit()\n print(s)\n\nif __name__ == '__main__':\n main()\n", "import sys\ndef main():\n\n n=int(input())\n p=list(map(int,input().split()))\n s=1\n p=sorted(p)\n for i in p:\n s*=i\n if i==0:\n print(0)\n sys.exit()\n elif s>=10**18+1:\n print(-1)\n sys.exit()\n print(s)\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s330295385', 's200507646']
[9032.0, 21652.0]
[21.0, 75.0]
[317, 316]
p02658
u646892595
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n ans = -1\n return\nprint(ans)', 'ans = 1\nfor a in A:\n if 0 in A:\n ans = 0\n break\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\nfor a in A:\n if 0 in A:\n ans = 0\n break\n ans *= a\n if ans >= 10**18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nA = list(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)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s510360766', 's677518516', 's681837927', 's631020135']
[9108.0, 9096.0, 21712.0, 21628.0]
[23.0, 23.0, 2205.0, 52.0]
[199, 140, 193, 197]
p02658
u648244457
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['input()\nN = int(input())\nA = list(map(int, input().split())\n\nS = A[0]\nfor i in range(1, N):\n\tS = S * A[i]\n\tif S > 10**18:\n print(-"1")\nprint(S)', '\nN = int(input())\nA = list(map(int,input(). split ()))\n\nS = 1\nfor i in range(1, N):\n\tS *= A[i]\n\tif S > 1000000000000000000:\n print(-"1")\n\t\nprint(S)', 'N = int(input())\nA = list(map(int, input().split())\n\nS = A[0]\nfor i in range(1, N):\n\tS = S * A[i]\n\tif S > 10**18:\n print(-"1")\nprint(S)', 'def main ():\n\tN = int(input())\n\tA = list(map(int,input(). split ()))\n\tif 0 in A:\n\t\tprint(0)\n\t\treturn\n\tprod = 1\n\tfor a in A:\n\t\tprod *= a\n\t\tif prod > 1000000000000000000:\n\t\t\tprint(-1)\n\t\t\treturn\n\tprint(prod)\nmain ()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s369666841', 's432441223', 's639621120', 's494101232']
[9040.0, 21780.0, 8976.0, 21588.0]
[24.0, 55.0, 21.0, 50.0]
[151, 155, 143, 212]
p02658
u649635413
2,000
1,048,576
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())\nres = 1\nfor i in range(n):\n a = int(input())\n res = res * a\n if res > 1000000000000000000:\n print(-1)\n exit()\nprint(res)', "n = int(input())\nres = 1\nls = input().split(' ')\nlist.sort(ls)\nif int(ls[0]) == 0:\n print(0)\n exit()\nfor a in ls:\n res = res * int(a)\n if res > 1000000000000000000:\n print(-1)\n exit()\nprint(res)\n"]
['Runtime Error', 'Accepted']
['s421889976', 's251445104']
[12808.0, 19212.0]
[32.0, 60.0]
[160, 221]
p02658
u651432096
2,000
1,048,576
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()]\nprod=1\nfor i in range(0,N):\n prod=prod*A[i]\n if(prod>1000000000000000000):\n prod=-1\n break\nprint(prod)', 'n=int(input())\nA=[int(i) for i in input().split()]\nA.sort()\nprod=1\nfor i in range(0,n):\n prod=prod*A[i]\n #print(prod)\n if(prod==0):\n break\n if(prod>1000000000000000000):\n prod=-1\n break\nprint(prod)\n']
['Runtime Error', 'Accepted']
['s308655874', 's140620003']
[21784.0, 21788.0]
[51.0, 89.0]
[161, 213]
p02658
u652656291
2,000
1,048,576
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())\nmaxi = 10**18\nA = list(map(int,input().split()))\nans = 1\n\nfor i in range(n):\n ans *= A[i]\n if ans >= maxi:\n print(-1)\n exit()\n if ans == 0:\n print(0)\n exit()\n \nprint(ans)\n\n', 'n = int(input())\nmaxi = 10**18\nA = sorted(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans *= A[i]\n if ans == 0:\n print(0)\n exit()\n if ans >= maxi:\n print(-1)\n exit() \nprint(ans)\n\n', 'n = int(input())\nmaxi = 10**18\nA = list(map(int,input().split()))\nans = 1\nb = max(A)\nc = min(A)\nif c == 0:\n print(0)\n exit()\nelse:\n if b >= maxi:\n print(-1)\n exit()\n\nfor i in range(n):\n ans *= A[i]\n if ans >= maxi:\n print(-1)\n exit()\n \nprint(ans)', 'n = int(input())\nA = sorted(map(int,input().split()))\nans = 1\nif A[0] == 0:\n print(0)\n exit()\nfor i in range(1,n+1):\n ans *= A[-i]\n if ans >= 10**18:\n print(-1)\n exit()\nprint(ans)\n\n', 'n = int(input())\nmaxi = 10**18\nA = list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor i in range(n):\n ans *= A[i]\n if ans >= maxi:\n print(-1)\n exit() \nprint(ans)\n\n', 'n = int(input())\nA = sorted(map(int,input().split()))\nans = 1\nif A[0] == 0:\n print(0)\n exit()\nfor i in range(1,n+1):\n ans *= A[-i]\n if ans >= 10**18:\n print(-1)\n exit()\nprint(ans)\n\n', 'n = int(input())\nmaxi = 10**18\nA = list(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans *= A[i]\n\nif ans >= maxi:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\nA = sorted(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n exit()\nelse:\n for i in range(1,n+1):\n ans *= A[-i]\n if ans >= 10**18:\n print(-1)\n exit()\n print(ans)\n\n', 'n = int(input())\nA = list(map(int,input().split()))\nans = 1\nif A[0] == 0:\n print(0)\n exit()\nfor i in range(n):\n ans *= A[-i]\n if ans >= 10**18:\n print(-1)\n exit()\nprint(ans)\n\n', 'n = int(input())\nA = sorted(map(int,input().split()))\nans = 1\nif A[0] == 0:\n print(0)\n exit()\nfor i in range(1,n+1):\n ans *= A[-i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s054359534', 's078204686', 's221932629', 's378142555', 's490346800', 's510769432', 's591388868', 's661403154', 's999861271', 's135583356']
[21764.0, 21564.0, 21708.0, 21592.0, 21624.0, 21576.0, 21472.0, 21572.0, 21588.0, 21652.0]
[52.0, 79.0, 53.0, 76.0, 52.0, 78.0, 2206.0, 88.0, 50.0, 79.0]
[205, 204, 264, 191, 194, 191, 154, 208, 185, 188]
p02658
u654240084
2,000
1,048,576
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 = 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)', 'n = input()\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\n exit()\n \nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s237192341', 's981671402']
[19244.0, 21628.0]
[46.0, 60.0]
[158, 168]
p02658
u655048024
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\na = list(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\n if(ans>10**18):\n ans = -1\n break\nprint(ans)', 'N = int(input())\na = list(map(int,input().split()))\nans = 1\nif(0 in a):\n ans = 0\nelse:\n for i in range(N):\n ans*=a[i]\n if(ans>10**18):\n ans = -1\n break\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s941490543', 's325351977']
[21564.0, 21748.0]
[50.0, 49.0]
[144, 181]
p02658
u655723240
2,000
1,048,576
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()\nif not N:\n\tbreak\na=list(map(int, input().split(" ")))\nans=1\nfor v in a:\n\tans*=v\nif 1000000000000000000 < ans:\n\tans = -1\nprint(ans)\n', 'while True:\n\ttry:\n\t\tN=input()\n\texcept:\n\t\tbreak\n\ta=list(map(int, input().split(" ")))\n\t#print(a)\n\tans=1\n\tfor v in a:\n\t\tans*=v\n\t\tif 1000000000000000000 < ans:\n\t\t\tans = -1\n\t\t\tbreak\n\tif any([v==0 for v in a]):\n\t\tans=0\n\tprint(ans)\n']
['Runtime Error', 'Accepted']
['s647102256', 's735937509']
[9028.0, 21472.0]
[22.0, 51.0]
[141, 226]
p02658
u656801456
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\n \ninput = sys.stdin.readline\n \nn = int(input())\na = list(map(int, input().strip().split()))\nif(0 in a):\n print(0)\n return\nelse:\n ans = 1\n for ai in a:\n ans *= ai\n if(ans > 10**18):\n print(-1)\n return\n\n print(ans)', 'import sys\n \ninput = sys.stdin.readline\n\ndef main():\n n = int(input())\n a = list(map(int, input().strip().split()))\n \n if 0 in a:\n print(0)\n return\n ans = 1\n for ai in a:\n ans *= ai\n if(ans > 10**18):\n print(-1)\n return\n print(ans)\n \nif __name__ == "__main__":\n main()']
['Runtime Error', 'Accepted']
['s052880952', 's146404255']
[9004.0, 21640.0]
[24.0, 62.0]
[229, 345]
p02658
u656803083
2,000
1,048,576
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 = map(int,input().split())\nnum = 10**18\ncount = 1\nfor i in range(n):\n\tcount *= nums[i]\n\nif count < num:\n\tprint(-1)\nelse:\n\tprint(count)', 'N = int(input())\na = list(map(int, input().split()))\ncount = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(N):\n count *= a[i]\n if ans > 10 ** 18:\n print(-1)\n break\n else:\n print(count)', 'n = int(input())\nnums = [int(x) for x in input().split()]\nnum = 10**18\ncount = 0\nfor i in range(n):\n\tcount *= nums[i]\n\nif count < num:\n\tprint(-1)\nelse:\n\tprint(count)', 'n = int(input())\nnums = list(map(int,input().split()))\nnum = 10**18\ncount = 1\nif 0 in nums:\n print(0)\nelse:\n for i in range(n):\n count *= nums[i]\n if count < num:\n print(-1)\n break\n else:\n print(count)\n', 'n = int(input())\nnums = list(map(int,input().split()))\nnum = 10**18\ncount = 1\nif 0 in nums:\n\tprint(0)\nelse:\n\tfor i in range(n):\n\t\tcount *= nums[i]\n\t\tif count < num:\n\t\t\tprint(-1)\n break\n\t\telse:\n\t\t\tprint(count)', 'N = int(input())\na = list(map(int, input().split()))\ncount = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(N):\n count *= a[i]\n if count > 10 ** 18:\n print(-1)\n break\n else:\n print(count)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s003962278', 's092126938', 's093854512', 's212131856', 's553657983', 's477514219']
[19428.0, 21736.0, 21780.0, 21792.0, 9000.0, 21612.0]
[39.0, 55.0, 66.0, 58.0, 23.0, 59.0]
[156, 205, 165, 228, 219, 207]
p02658
u657183715
2,000
1,048,576
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)\nelse:\n result=1\n for i in A:\n result*=i\n print(result)\n\n if result>10**18:\n print(-1)\n break', 'N = int(input())\nA = input().split()\n\na=int(A[0])\nfor i in range(N-1):\n a=a*int(A[i+1])\n \nif a>10^18:\n print(-1)\nelse:\n print(a)', 'N = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n a=1\n for i in range(N):\n a*=int(A[i])\n\n if a>10**18:\n print(-1)\n break', 'N = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n result=1\n for i in A:\n result*=i\n if result>10**18:\n result=-1\n break\n print(result)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s075918542', 's202120114', 's329892570', 's250813712']
[21644.0, 19204.0, 21600.0, 21652.0]
[77.0, 2206.0, 52.0, 51.0]
[188, 132, 170, 185]
p02658
u659920336
2,000
1,048,576
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().strip().split()))[:n] \nrs= 1\nfor i in range(n):\n rs=l[i]*rs\n if (rs>=10**18) or (rs<0):\n rs = -1\n break\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nl.sort()\nif l[0]==0 : \n print(0)\nelse:\n for i in range(n):\n rs=l[i]*rs\n if(10**18 / rs < l[i]):\n rs = -1\n break\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nl.sort()\nif l[0]==0 :\n rs=0\nelse:\n for i in range(n):\n rs=l[i]*rs\n if(10**18 // rs < l[i]):\n rs = -1\n break\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nfor i in range(n):\n rs=l[i]*rs\n if rs>10**8:\n rs = -1\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nfor i in range(n):\n rs=l[i]*rs\n if rs>=10**18:\n rs = -1\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nl.sort()\nif l[0]==0 : \n print(0)\nelse:\n for i in range(n):\n rs=l[i]*rs\n if(10**18 // rs < l[i]):\n rs = -1\n break\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nfor i in range(n):\n rs=l[i]*rs\n if (rs>=10**18) or (rs<0):\n rs = -1\n break\nprint(rs)', 'n=int(input())\nl = list(map(int,input().strip().split()))[:n] \nrs= 1\nl.sort()\nif l[0]==0 :\n rs=0\nelse:\n for i in range(n):\n if(10**18 // rs < l[i]):\n rs = -1\n break\n rs=l[i]*rs\nprint(rs)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s200877204', 's237733803', 's388821067', 's552468437', 's556173815', 's931846005', 's997238692', 's170094616']
[21584.0, 21480.0, 21604.0, 21468.0, 21584.0, 21704.0, 21792.0, 21784.0]
[48.0, 79.0, 83.0, 2206.0, 2206.0, 74.0, 49.0, 76.0]
[173, 232, 228, 145, 147, 233, 173, 228]
p02658
u661439250
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["def main():\n n = int(input())\n a = [int(_) for _ in input().split()]\n ans = 1\n for i in a:\n if i == 0:\n ans = 0\n return ans\n ans *= i\n if ans > 10**18:\n ans = -1\n return ans\n\n return ans\n\nif __name__ == '__main__':\n print(main())", 'n = int(input())\na = [int(_) for _ in input().split()]\na.sort()\nans = 1\nfor i in a:\n if i == 0:\n ans = 0\n break\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s369911142', 's070560724']
[21696.0, 21636.0]
[51.0, 81.0]
[316, 206]
p02658
u662071161
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\na = list(map(int, input().split()))\na.sort()\nINF = 10 ** 18\ns = 1\n\nprint(a)\nfor i in a:\n s *= i\n if s > INF:\n s = -1\n break\n\nprint(s)\n', 'N = int(input())\na = list(map(int, input().split()))\na.sort()\nINF = 10 ** 18\ns = 1\n\nfor i in a:\n s *= i\n if s > INF:\n s = -1\n break\n\nprint(s)\n']
['Wrong Answer', 'Accepted']
['s834246833', 's704459424']
[21596.0, 21636.0]
[106.0, 89.0]
[171, 162]
p02658
u662396511
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n if ans = 0:\n print(0)\n exit()\n elif ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s731073909', 's666951931']
[8964.0, 21780.0]
[24.0, 52.0]
[213, 199]
p02658
u663767599
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['from math import log10\n\nN = int(input())\nA = list(map(int, input().split()))\ns = 1\nfor a in A:\n if a == 0:\n print(0)\n break\n s *= a\n if log10(s) >= 18:\n print(-1)\n break\nelse:\n print(s)\n\n\n', 'from math import log10\n\nN = int(input())\nA = list(map(int, input().split()))\ns = 1\nthreshold = 10**18\nif 0 in A:\n print(0)\nelse:\n for a in A:\n s *= a\n if s > threshold:\n print(-1)\n break\n print(a)\n else:\n print(s)\n\n\n', 'from math import log10\n\nN = int(input())\nA = list(map(int, input().split()))\ns = 1\nthreshold = 10**18\nif 0 in A:\n print(0)\nelse:\n for a in A:\n s *= a\n if s > threshold:\n print(-1)\n break\n else:\n print(s)\n\n\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s645434070', 's715496522', 's103775591']
[22092.0, 22320.0, 22336.0]
[54.0, 72.0, 56.0]
[228, 275, 258]
p02658
u664373116
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\nfrom collections import Counter \nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import reduce\nimport math\nimport itertools\nimport heapq\nimport numpy as np\nimport bisect\nimport sys\nsys.setrecursionlimit(10**6)\n\n\ndef bfs(s,n,node):\n \n check=[False for _ in range(n)]\n check[s]=True\n \n queue=deque([s])\n visited_num=1\n\n \n #color_check=[[True for _ in range(l)] for _ in range(n)]\n color=[-1 for _ in range(n)]\n color[s]=0\n \n while visited_num<n:\n \n if len(queue)==0:\n \n \n return color\n\n now_vertex=queue.popleft()\n \n for next_vertex in node[now_vertex]:\n\n\n if check[next_vertex]==True:\n continue\n\n queue.append(next_vertex)\n check[next_vertex]=True\n\n \n color[next_vertex]=color[now_vertex]+1\n visited_num+=1\n\n return color\n\n#n=int(input())z\n#n,m=list(map(int,input().split()))\n#a=list(map(int,input().split()))\nceil=lambda x,y: (x+y-1)//y\ninput_list = lambda : list(map(int,input().split()))\n\n\n\n#n=int(input())\n#n,m=input_list()\na=input_list()\nans=1\nfor i in a:\n ans*=i\n\nif ans>10**18:\n print(-1)\n\nelse:\n print(ans)', 'from collections import Counter \nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import reduce\nimport math\nimport itertools\nimport heapq\nimport numpy as np\nimport bisect\nimport sys\nsys.setrecursionlimit(10**6)\n\n\ndef bfs(s,n,node):\n \n check=[False for _ in range(n)]\n check[s]=True\n \n queue=deque([s])\n visited_num=1\n\n \n #color_check=[[True for _ in range(l)] for _ in range(n)]\n color=[-1 for _ in range(n)]\n color[s]=0\n \n while visited_num<n:\n \n if len(queue)==0:\n \n \n return color\n\n now_vertex=queue.popleft()\n \n for next_vertex in node[now_vertex]:\n\n\n if check[next_vertex]==True:\n continue\n\n queue.append(next_vertex)\n check[next_vertex]=True\n\n \n color[next_vertex]=color[now_vertex]+1\n visited_num+=1\n\n return color\n\n#n=int(input())z\n#n,m=list(map(int,input().split()))\n#a=list(map(int,input().split()))\nceil=lambda x,y: (x+y-1)//y\ninput_list = lambda : list(map(int,input().split()))\n\n\n\nn=int(input())\n#n,m=input_list()\na=input_list()\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()\n\n\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s992742540', 's060859299']
[27148.0, 40104.0]
[109.0, 135.0]
[1543, 1591]
p02658
u664652017
2,000
1,048,576
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()\nnums = [int(e) for e in input().split()]\n\nif 0 in nums:\n print('0')\n sys.exit()\n\nans = 1\ns = 10**18\n\nfor i in nums:\n ans = ans * i\n if(ans >= s):\n print('-1')\n break\n\n\nif(ans <= s):\n print(ans)", "import sys\nn = input()\nnums = [int(e) for e in input().split()]\n\nif 0 in nums:\n print('0')\n sys.exit()\n\nans = 1\ns = 10**18\n\nfor i in nums:\n ans = ans * i\n if(ans > s):\n print('-1')\n break\n\n\nif(ans <= s):\n print(ans)"]
['Wrong Answer', 'Accepted']
['s109912298', 's545976166']
[21780.0, 21620.0]
[53.0, 53.0]
[227, 226]
p02658
u664907598
2,000
1,048,576
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 = I()\na = LI()\nans = 1\na.sort()\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18+1:\n print(-1)\n exit()\n elif ans == 0:\n print(0)\n exit()\nprint(int(ans))', 'import bisect, collections, copy, heapq, itertools, math, numpy, string\nimport sys\nfrom bisect import bisect_left, bisect_right, insort\nfrom collections import deque\ndef S(): return sys.stdin.readline().rstrip()\ndef I(): return int(sys.stdin.readline().rstrip())\ndef MI(): return map(int, sys.stdin.readline().rstrip().split())\ndef MS(): return map(str, sys.stdin.readline().rstrip().split())\ndef LI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef LS(): return list(sys.stdin.readline().rstrip().split())\n# N = I()\n# A = [LI() for _ in range(N)]\n\n\nn = I()\na = LI()\nans = 1\na.sort()\nfor i in range(n):\n ans *= a[i]\n if ans >= 10**18+1:\n print(-1)\n sys.exit()\n elif ans == 0:\n print(0)\n sys.exit()\nprint(int(ans))']
['Runtime Error', 'Accepted']
['s719970903', 's239687619']
[9116.0, 40084.0]
[24.0, 162.0]
[191, 768]
p02658
u665852386
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\n\nmulti = 1\nfor i in range(n):\n multi = multi * a[i]\n if multi > 100000000000000000:\n print(-1)\n break\nif multi <= 100000000000000000:\n print(multi)', 'n = int(input())\na = list(map(int, input().split()))\n\nmulti = 1\nif min(a) == 0:\n print(0)\nelse:\n for i in range(n):\n multi = multi * a[i]\n if multi > 1000000000000000000:\n print(-1)\n break\n if multi <= 1000000000000000000:\n print(multi)']
['Wrong Answer', 'Accepted']
['s942951454', 's985993177']
[21780.0, 21576.0]
[48.0, 52.0]
[223, 288]
p02658
u665871498
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >= 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor i in range(N):\n if A[i] == 0:\n print(0)\n exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > pow(10, 18):\n print(-1)\n exit()\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s675177123', 's258886537']
[21784.0, 21480.0]
[46.0, 90.0]
[177, 238]
p02658
u668785999
2,000
1,048,576
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())\nvec=list(map(int,input().split()))\nvec.sort()\nprint(vec)\n\nif(0 in vec):\n print(0)\nelse:\n res = 1\n for v in vec:\n res *= v\n if(res > 10**18):\n res = -1\n break\n\n print(res)', 'N=int(input())\nvec=list(map(int,input().split()))\nvec.sort()\n\n\nif(0 in vec):\n print(0)\nelse:\n res = 1\n for v in vec:\n res *= v\n if(res > 10**18):\n res = -1\n break\n\n print(res)']
['Wrong Answer', 'Accepted']
['s518435389', 's168859266']
[21776.0, 21592.0]
[97.0, 78.0]
[233, 234]
p02658
u669742612
2,000
1,048,576
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=[input().split()]\nx=1\nfor i in range(n):\n x*=int(a[i])\nif x>10**18:\n print("-1")\nelse:\n print(x)', 'N=int(input())\nA=list(map(int,input().split()))\n \nmul=1\nif 0 in A:print("0")\nelse:\n for i in range(N):\n mul*=A[i]\n if mul>pow(10,18):\n print("-1")\n break\n elif i==N-1:print(mul)']
['Runtime Error', 'Accepted']
['s535018408', 's342271590']
[19372.0, 21588.0]
[41.0, 83.0]
[122, 223]
p02658
u670567845
2,000
1,048,576
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 = 10**18\nans = 1\nfor i in range(N):\n ans = ans * A[i]\n if ans >= X:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nX = 10**18\nans = 1\nif 0 in A:\n ans = 0\nelse:\n for i in range(N):\n ans = ans * A[i]\n if ans > X:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s864514330', 's231862403']
[21600.0, 21536.0]
[57.0, 59.0]
[159, 195]
p02658
u670819023
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["n = int(input())\na = list(map(int, input().split()))\ns = 1\n\nif '0' in a:\n s = 0\nelse:\n for i in range(n):\n s = s * a[i]\n if s > 10 ** 18:\n s = -1\n break\nprint(s)", 'n = int(input())\na = list(map(int, input().split()))\ns = 1\n\nif 0 in a:\n s = 0\nelse:\n for i in range(n):\n s = s * a[i]\n if s > 10 ** 18:\n s = -1\n break\nprint(s)']
['Runtime Error', 'Accepted']
['s770451253', 's037309146']
[9048.0, 21712.0]
[20.0, 48.0]
[191, 201]
p02658
u671166082
2,000
1,048,576
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, Y = map(int, input().split())\n\nresult = "No"\nfor i in range(X + 1):\n if 2 * i + (X - i) * 4 == Y:\n result = "Yes"\n\nprint(result)', 'N = int(input())\nA = list(map(int, input().split()))\n\nresult = 1\nif 0 in A:\n print("0")\nelse:\n for a in A:\n result *= a\n if result > 10**18:\n result = -1\n break\n print(result)']
['Runtime Error', 'Accepted']
['s767248457', 's767291695']
[9092.0, 21644.0]
[21.0, 53.0]
[141, 220]
p02658
u671252250
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['# coding: utf-8\n# Your code here!\n\nfrom collections import deque\n\nN = int(input())\nA = deque(list(map(int, input().split())))\nans = A.popleft()\n\nfor i in range(N - 1):\n ans *= A.popleft()\nif ans >= pow(10, 18):\n print(-1)\nelse:\n print(ans)', '# coding: utf-8\n# Your code here!\n\nfrom collections import deque\n\nN = int(input())\nA = deque(list(map(int, input().split())))\nans = A.popleft()\n\nfor i in range(N - 1):\n ans *= A.popleft()\nif ans >= pow(10, 18):\n print(-1)\nelse:\n print(ans)', '# coding: utf-8\n# Your code here!\n\nfrom collections import deque\n\nN = int(input())\nA = deque(list(map(int, input().split())))\nans = A.popleft()\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(N - 1):\n ans *= A.popleft()\n if ans > pow(10, 18):\n print(-1)\n exit()\nelse:\n print(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s511040686', 's869671867', 's327890863']
[22460.0, 22668.0, 22496.0]
[2206.0, 2206.0, 76.0]
[248, 248, 306]
p02658
u671889550
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import math\n\nN=int(input())\nA=list(map(int,input().split()))\nl=[]\n\nfor i in A:\n l.append(math.log10(A[i]))\n \nif sum(l)<18:\n print(int(10**sum(l)))\nelse:\n print(-1)', 'import math\n\nN=int(input())\nA=list(map(int,input().split()))\nl=[]\n\nif 0 not in A:\n for i in A:\n l.append(math.log10(A[i]))\n if sum(l)<18: \n print(int(10**sum(l)))\n else:\n print(‘-1’)\nelse:\n print(‘0’)', 'import.math\n\nN=int(input())\nA=list(map(int,input().split()))\nl=[]\n\nfor _ in A:\n l.append(math.log10(A))\n \nif sum(l)<18:\n print(math.exp(sum(l)))\nelse:\n print(-1)', 'import math\n\nN=int(input())\nA=list(map(int,input().split()))\nl=[]\n\nif 0 not in A:\n for i in A:\n l.append(math.log10(A[i]))\n if sum(l)<18: \n print(int(10**sum(l)))\n else:\n print(str(-1))\nelse:\n print(str(0))\n', 'import numpy as np\n\nN=int(input())\nA=list(map(int,input().split()))\nT=np.prod(A)\n \nif T<10**18: \n print(T)\nelse:\n print(str(-1))', 'N=int(input())\n\nfor i in range(N):\n ans*=int(input())\n if ans>10**18:\n break\n print(-1)\n\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n\nelse:\n ans = 1\n for i in range(n):\n ans *= a[i]\n if ans > 10 ** 18:\n print(-1)\n exit()\n print(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s103883956', 's126011226', 's324029461', 's540112632', 's607684164', 's929433098', 's191942482']
[22500.0, 8984.0, 8912.0, 22668.0, 40052.0, 8852.0, 21628.0]
[63.0, 25.0, 24.0, 61.0, 154.0, 27.0, 57.0]
[167, 219, 165, 220, 134, 108, 194]
p02658
u672370694
2,000
1,048,576
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())\nk = list(map(int, input().split()))\nimport collections\nc = collections.Counter(k)\nre = 1\nif c[0] == 0:\n for i in range(n):\n re = re * k[i]\n if re >= 10**18:\n print(-1)\n exit()\n print(re)\nelse:\n print(0)', 'n = int(input())\nk = list(map(int, input().split()))\nimport collections\nc = collections.Counter(k)\nre = 1\nif c[0] == 0:\n for i in range(n):\n re = re * k[i]\n if re > 10**18:\n print(-1)\n exit()\n print(re)\nelse:\n print(0)']
['Wrong Answer', 'Accepted']
['s605281540', 's012790450']
[23900.0, 23784.0]
[69.0, 67.0]
[238, 237]
p02658
u673173160
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import numpy as np\nn = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in A:\n ans *= i\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', '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)', '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)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s380947621', 's696248251', 's463047921']
[39872.0, 21660.0, 21648.0]
[2206.0, 52.0, 54.0]
[157, 186, 185]
p02658
u676447154
2,000
1,048,576
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().strip().split()))\np = 1\nj = 10**18\nfor i in range(n):\n\tp = p * a[i]\n if p > j:\n print(-1)\n break\n elif i = n-1:\n ptint(p)\n', 'n = int(input())\na = list(map(int,input().strip().split()))\np = 1\nj = 10^18\nfor i in range(n):\n\tp = p * a[i]\n if p > j:\n print(-1)\n break\n elif i = n-1:\n ptint(p)\n', 'n = int(input())\na = list(map(int,input().split()))\ni = 0\np = 1\n\nif 0 in a:\n print("0")\nelse:\n while i < n:\n p *= a[i]\n if p > 10**18:\n break\n i += 1\n if p <= 10**18:\n print(p)\n else:\n print("-1")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s436224711', 's889857358', 's442554536']
[8928.0, 8936.0, 21644.0]
[24.0, 22.0, 50.0]
[185, 184, 254]
p02658
u676933207
2,000
1,048,576
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\nMAX = 10**18\n\nN = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print("0")\nelse:\n res = 1\n for a in reversed(sorted(A)):\n if res == 1:\n break\n res *= a\n if res > MAX:\n print("-1")\n sys.exit()\n print(res)\n', 'import sys\n\nMAX = 10**18\n\nN = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print("0")\nelse:\n res = 1\n for a in reversed(sorted(A)):\n if a == 1:\n break\n res *= a\n if res > MAX:\n print("-1")\n sys.exit()\n print(res)\n']
['Wrong Answer', 'Accepted']
['s527746949', 's913021029']
[21748.0, 21660.0]
[66.0, 68.0]
[297, 295]
p02658
u677253688
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nlimit = 10**18\nfor i in a:\n ans*=i\n if ans > limit:\n print(-1)\n exit()\nprint(ans)', 'a = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nlimit = 10**18\nfor i in a:\n ans*=i\n if ans > lim:\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()\nlimit = 10**18\nfor i in a:\n ans*=i\n if ans > limit:\n print(-1)\n exit()\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s087115137', 's232576900', 's329738210']
[9188.0, 9128.0, 21772.0]
[23.0, 24.0, 53.0]
[180, 178, 197]
p02658
u678167152
2,000
1,048,576
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\n ans = 1\n \n for i in a:\n ans *= i\n \tif ans > int(1e18): return -1\n \n \n return ans\n \n\nprint(solve())\n', 'def solve():\n n = int(input())\n a = list(map(int, input().split()))\n\n ans = 1\n if 0 in a: return 0\n for i in a:\n ans *= i\n if ans > int(1e18): return -1\n \n \n return ans\n \n\nprint(solve())\n']
['Runtime Error', 'Accepted']
['s585192617', 's447646494']
[8968.0, 21744.0]
[21.0, 48.0]
[205, 228]
p02658
u679089074
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['A,B = map(float,input().split())\nB = B*100\nprint(int(A*B/100))', 'import sys\nN = int(input())\nAn = []\nmul = 1\n\nAn = list(map(int,input().split()))\nif An.count(0) > 0:\n print("0")\n sys.exit()\n\nfor i in An:\n mul *= i\n if mul > 10**18:\n print("-1")\n sys.exit()\n\nif mul <= 10**18:\n print(mul)\n ']
['Runtime Error', 'Accepted']
['s170610658', 's001229658']
[9112.0, 21596.0]
[24.0, 50.0]
[62, 256]
p02658
u679362232
2,000
1,048,576
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\n a = map(int, input().split())\n\n if 0 in a:\n print(0)\n return\n\n ans = 1\n for tmp in a:\n ans *= tmp\n if (ans > 1e18) :\n print(-1)\n return\n\n print(ans)\n\nmain()\n', 'def main():\n n = int(input())\n\n a = list(map(int, input().split()))\n\n if 0 in a:\n print(0)\n return\n\n ans = 1\n for tmp in a:\n ans *= tmp\n if (ans > 1e18) :\n print(-1)\n return\n\n print(ans)\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s345028432', 's413028994']
[19508.0, 21596.0]
[46.0, 52.0]
[257, 263]
p02658
u679682246
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\ndef solve():\n n=int(input())\n a=list(map(int,input().split()))\n if 0 in a:\n print(0)\n f=1 \n for i in a:\n f*=i\n if f>100000000000000000:\n print(-1)\n return \n print(f)\nsolve() \n ', 'n=int(input())\na=list(map(int, input().split()))\nf=1\nfor i in range(n):\n f*=a[i]\nc=0\nwhile f>0:\n c+=1\n f/=10;\nif c>19:\n print(-1)\nelse:\n print(f)', 'def solve():\n n=int(input())\n a=list(map(int,input().split()))\n f=1\n if 0 in a:\n f=0\n for i in a:\n f*=i\n if f>1000000000000000000:\n print(-1)\n return \n print(f)\nsolve() ']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s034417396', 's775384205', 's638063973']
[21604.0, 21576.0, 21712.0]
[49.0, 2206.0, 50.0]
[207, 150, 233]
p02658
u681409497
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['MAX = pow(10,18)\nn = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n digit = 0\n flg = True\n for a in A:\n digit += len(str(a))\n ans *= a\n if digit > 18:\n print(-1)\n break\n flg = False\n if flg:\n if ans > MAX:\n print(-1)\n else:\n print(ans)\n', 'MAX = pow(10,18)\nn = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n digit = 0\n flg = True\n for a in A:\n digit += len(str(a))\n ans *= a\n if digit > 18:\n print(-1)\n flg = False\n break\n if flg:\n if ans > MAX:\n print(-1)\n else:\n print(ans)\n', 'MAX = pow(10,18)\ndef main():\n N = int(input())\n A = list(map(int,input().split()))\n\n if 0 in A:\n print(0)\n return\n\n ans = 1\n for a in A:\n ans *= a\n if ans > MAX:\n print(-1)\n return\n\n print(ans)\n\nmain()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s485185802', 's684922386', 's630017538']
[21600.0, 21592.0, 21744.0]
[58.0, 54.0, 52.0]
[379, 383, 270]
p02658
u681869152
2,000
1,048,576
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()]\nans = 1\nif 0 in a:\n\tprint(0)\n\texit()\nfor i in range(n):\n\tans += a[i]\n\tif ans > 10 ** 18:\n\t\tprint(-1)\n\t\texit()\nprint(ans)n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nif 0 in a:\n\tprint(0)\n\texit()\nfor i in range(n):\n\tans += a[i]\n\tif ans > 10 ** 18:\n\t\tprint(-1)\n\t\texit()\nprint(ans)', 'n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nif 0 in a:\n\tprint(0)\n\texit()\nfor i in range(n):\n\tans *= a[i]\n\tif ans > 10 ** 18:\n\t\tprint(-1)\n\t\texit()\nprint(ans)']
['Runtime Error', 'Accepted']
['s040486800', 's220667624']
[9048.0, 21648.0]
[22.0, 51.0]
[350, 175]
p02658
u682271925
2,000
1,048,576
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 li = list(map(int,input().split()))\n li.sort()\n ans = 1\n for i in range(n):\n ans *= li[i]\n if ans > (10 ** 18):\n print(-1)\n exit()\n print(ans)\n\n\nif __name__ == '__main__':\n main()", "import math\n\ndef main():\n a, b = input().split()\n a = int(a)\n b = float(b)\n c = int(b)\n d = (b - c) * 100\n ans_a = a * c\n ans_b = (a * d) // 100\n ans = math.floor(ans_b) + ans_a\n print(ans)\n \n \nif __name__ == '__main__':\n main()", "def main():\n n = int(input())\n ans = 0\n for i in range(n):\n ans *= int(input())\n if ans >= 10 ** 18:\n print(-1)\n else:\n print(ans)\n\n\nif __name__ == '__main__':\n main()", "def main():\n n = int(input())\n li = list(map(int,input().split()))\n ans = 1\n for i in range(n):\n ans *= li[i]\n if ans >= 10 ** 18:\n print(-1)\n else:\n print(ans)\n\n\nif __name__ == '__main__':\n main()", "def main():\n n = int(input())\n li = list(map(int,input().split()))\n ans = 1\n for i in range(n):\n ans *= li[i]\n if ans >= 10 ** 18:\n print(-1)\n else:\n print(ans)\n print(li)\n\nif __name__ == '__main__':\n main()", "def main():\n n = int(input())\n li = list(map(int,input().split()))\n li.sort()\n ans = 1\n for i in range(n):\n ans *= li[i]\n if ans > (10 ** 18):\n print(-1)\n exit()\n print(ans)\n\n\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s016081764', 's047223922', 's848658498', 's908045842', 's917665748', 's766340505']
[21648.0, 9132.0, 12752.0, 21712.0, 21772.0, 21660.0]
[110.0, 24.0, 34.0, 2206.0, 2206.0, 90.0]
[235, 238, 182, 213, 224, 233]
p02658
u683908134
2,000
1,048,576
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()))\nans = 1\nfor i in range(N):\n if a.index(0):\n ans = 0\n break\n ans = ans * a[i]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\n\na = list(map(int, input().split()))\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)']
['Runtime Error', 'Accepted']
['s966210842', 's436080197']
[21472.0, 21556.0]
[55.0, 60.0]
[213, 214]
p02658
u686230543
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['res = 1\nfor a in map(int, input().split()):\n res *= a\n if res > 10 ** 18:\n print(-1)\n break\nelse:\n print(res)', 'res = 1\nn = int(input())\na_list = list(map(int, input().split()))\nif 0 in a_list:\n print(0)\nelse:\n for a in a_list:\n res *= a\n if res > 10 ** 18:\n print(-1)\n break\n else:\n print(res)']
['Wrong Answer', 'Accepted']
['s821211416', 's370791598']
[9176.0, 21652.0]
[22.0, 52.0]
[118, 204]
p02658
u687574784
2,000
1,048,576
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\ncumprod=1\nfor i in range(n):\n cumprod *= a[i]\n print(int(cumprod))\n if cumprod > 10**18:\n print(-1)\n exit()\nprint(int(cumprod))', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\ncumprod=1\nfor i in range(n):\n cumprod *= a[i]\n if cumprod > 10**18:\n print(-1)\n exit()\nprint(cumprod)\n']
['Wrong Answer', 'Accepted']
['s736192087', 's293758061']
[21788.0, 21584.0]
[82.0, 54.0]
[204, 212]