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 | u098157848 | 2,000 | 1,048,576 | 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())\nD=False\nans=1\nList=list(map(int,input()split()))\nif 0 in List:\n print(0)\nelse:\n for i in ragne(N):\n ans=ans*List[i]\n if ans>10**18:\n print(-1)\n D=True\n break\n if D==False:\n print(ans)', 'N=int(input())\nD=False\nans=1\nList=list(map(int,input().split()))\nif 0 in List:\n print(0)\nelse:\n for i in range(N):\n ans=ans*List[i]\n if ans>10**18:\n print(-1)\n D=True\n break\n if D==False:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s719684529', 's736026878'] | [9024.0, 21616.0] | [25.0, 60.0] | [225, 226] |
p02658 | u098436028 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nn=int(input())\na = np.array(list(map(int,input().split())))\n\nans = np.prod(a)\n\nif(ans >= 10**18):\n ans = -1\n\nprint(ans)', 'n=int(input())\na = list(map(int,input().split()))\nans=1\n\n\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\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s519323418', 's396340224'] | [40004.0, 21472.0] | [143.0, 50.0] | [140, 174] |
p02658 | u099187672 | 2,000 | 1,048,576 | 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 prod\nn = int(input())\n\na = list(map(int,input().split()))\nnew = math.prod(a)\nval = pow(10,18)\nif new > val:\n\tprint(-1)\nelse:\n\tprint(new)\t \n', 'from math import prod\nn = int(input())\n\na = list(map(int,input().split()))\nnew = math.prod(a,start=0)\nval = pow(10,18)\nif new > val:\n\tprint(-1)\nelse:\n\tprint(new)\t \n', 'n = int(input())\na = list(map(int,input().split()))\n\nnew = 1\nif 0 in a:\n\tprint(0)\n\texit()\n\t\nfor i in a:\n\t\n\tnew *= a\n\tif new > (10**18):\n\t\tnew = -1\n\t\tbreak\nprint(new)\t\t\n\t\n', 'from math import trunc\na,b = input().split()\na = int(a)\nb = float(b)\n\nprint("{}".format(int(a*b)))\n', 'n = int(input())\na = list(map(int,input().split()))\n\nnew = 1\nfor i in a:\n\t\n\tnew *= a\n\tif new > (10**18):\n\t\tnew = -1\n\t\tbreak\nprint(new)\t\t\n\t\n', 'n = int(input())\na = list(map(int,input().split()))\nnew = 1\nif 0 in a:\n\tprint(0)\n\texit()\nfor i in a:\n\tnew *= i\n\tif new > (10**18):\n\t\tnew = -1\n\t\tbreak\nprint(new)\t\t\n\t\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s011333172', 's109472865', 's174733730', 's583284689', 's618599006', 's208994326'] | [22332.0, 22504.0, 21776.0, 9108.0, 21644.0, 21792.0] | [48.0, 47.0, 45.0, 25.0, 59.0, 46.0] | [156, 164, 170, 99, 139, 165] |
p02658 | u099891281 | 2,000 | 1,048,576 | 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()\nflag=0\na=list(map(int,input().split()))\nsum=1\nfor i in a :\n sum*=i\n if(sum>=1e18) :\n flag=1\n break\nif(flag==0):\n print(sum)\nelse : print(-1)', 'n=input()\nflag=0\nflag1=0\na=list(map(int,input().split()))\nsum=1\na.sort()\nfor i in a :\n sum*=i\n if(i==0):\n flag1=1\n if(sum>=1e18) :\n flag=1\n break\nif(flag==0 or flag1==1):\n print(sum)\nelse : print(-1)', 'n=input()\nflag=0\nflag1=0\na=list(map(int,input().split()))\nsum=1\na.sort()\nfor i in a :\n sum*=i\n if(i==0):\n flag1=1\n if(sum>1e18) :\n flag=1\n break\nif(flag==0 or flag1==1):\n print(sum)\nelse : print(-1)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s258244018', 's744869201', 's464050435'] | [21628.0, 21784.0, 21772.0] | [50.0, 89.0, 92.0] | [173, 232, 231] |
p02658 | u103519843 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from operator import mul\nfrom functools import reduce\nN = int(input())\nAj = [int() for i in input().split()]\n\nans = reduce(mul, Aj)\n\nif ans > 10**18:\n\tans = -1\nprint(ans)\n', 'N = int(input())\nAj = [int() for i in input().split()]\n\nans = 1\nfor A in Aj:\n\tans *= A\nif ans > 10**18:\n\tans = -1\nprint(ans)\n', 'N = int(input())\nAj = list(map(int, input()split()))\n\nans = 1\nng = false\nmax = 10**18\nfor A in Aj:\n\tif A == 0:\n\t\tans = 0\n\t\tbreak\n\tif ans*A > max:\n\t\tans *= A\nprint(ans)', 'N = int(input())\nAj = list(map(int, input().split()))\n\nans = 1\nng = False\nmax = 10**18\nfor A in Aj:\n\tif A == 0:\n\t\tans = 0\n\t\tbreak\n\tif ng or ans*A > max:\n\t\tans = -1\n\t\tng = True\n\telse:\n\t\tans *= A\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s214398954', 's289902837', 's948245359', 's874828209'] | [20364.0, 19344.0, 8980.0, 21444.0] | [48.0, 48.0, 26.0, 59.0] | [171, 125, 167, 205] |
p02658 | u103902792 | 2,000 | 1,048,576 | 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\nif 0 in A:\n print(0)\n exit()\n \nfor a in A:\n ans *= a\n if ans >= 10**18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\n\nA = list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n exit()\n \nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s103154816', 's640766052'] | [21432.0, 21704.0] | [51.0, 52.0] | [173, 174] |
p02658 | u105209986 | 2,000 | 1,048,576 | 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())\nS=list(map(int,input().split()))\nD=sorted(S)\nA=1\n\nfor i in range(0,N):\n A=A*D[i]\n if A>=10**18:\n A=-1\n break\nprint(A)', 'N=int(input())\nS=list(map(int,input().split()))\nA=S[0]\nfor i in range(N):\n A=A*S[i]\nif A <10**18:\n print(A)\nelse:\n print(-1)', 'N=int(input())\nS=list(map(int,input().split()))\nA=S[0]\nprint(S)\nfor i in range(N):\n A=A*S[i]\nprint(A)', 'N=int(input())\nS=list(map(int,input().split()))\nD=sorted(S)\nA=1\n\nfor i in range(1,N):\n A=A*D[i-1]\n if A>=10**18:\n A=-1\n break\nprint(A)', 'N=int(input())\nS=list(map(int,input().split()))\nD=sorted(S)\nA=1\n\nfor i in range(N):\n A=A*D[i]\n if A>10**(18):\n A=-1\n break\nprint(A)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s275738668', 's344178515', 's755963540', 's848778522', 's798232757'] | [21468.0, 21648.0, 21644.0, 21652.0, 21480.0] | [90.0, 2206.0, 2206.0, 94.0, 96.0] | [152, 133, 104, 154, 151] |
p02658 | u105608888 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["length = 1\nlimit = 10 ** 18\nfor i in range(N):\n length = length * A[i]\n if length > limit:\n print('-1')\n break\n if i == N-1:\n print(length)\n", "def main():\n N = int(input())\n A = list(map(int, input().split()))\n length = 1\n limit = 10 ** 18\n if 0 in A:\n print(0)\n return\n for i in range(N):\n length = length * A[i]\n if length > limit:\n print('-1')\n return\n print(length)\n return\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s657566177', 's977069750'] | [8892.0, 21548.0] | [23.0, 57.0] | [171, 347] |
p02658 | u107494228 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nl=list(map(int,input().split()))\ns=1\nd=1\nfor i in l:\n s=s*i\n if(s>=10**18):\n print(-1)\n d=0\n break\nif(d==1):\n print(s)', 'n=int(input())\nl=sorted(list(map(int,input().split())))\ns=1\nd=1\nfor i in l:\n s=s*i\n if(s>10**18):\n print(-1)\n d=0\n break\nif(d==1):\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s917045814', 's767422639'] | [21684.0, 21648.0] | [60.0, 99.0] | [163, 170] |
p02658 | u107915058 | 2,000 | 1,048,576 | 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\nprint("-1" if ans>=10**18 else ans)', 'n = int(input())\na = sorted(list(map(int, input().split())))\nans = 1\nfor i in a:\n ans *= i\n if ans >= 10**18:\n print("-1")\n break\nelse:\n print(ans)', 'n = int(input())\na = sorted(list(map(int, input().split())))\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print("-1")\n break\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s549729996', 's979423316', 's317154191'] | [21672.0, 21772.0, 21652.0] | [2206.0, 91.0, 89.0] | [121, 170, 169] |
p02658 | u107953313 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\nelse:\n for i in range(int(N)):\n result *= i\n if(len(str(result)) >= 18):\n print(-1)\n else:\n print(result)', 'import math\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\nelse:\n for x in i:\n result *= x\n if(len(str(result)) >= 19):\n print(-1)\n else:\n print(result)', 'import math\nimport sys\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\n sys.exit()\nfor x in i:\n result *= x\n# if(len(str(result)) >= 19):\n if(result >= 1000000000000000000):\n print(-1)\n sys.exit()\nprint(result)\n', 'import math\nimport sys\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\n sys.exit()\nfor x in i:\n result *= x\n# if(len(str(result)) >= 19):\n if(result >= 10**18):\n print(-1)\n sys.exit()\nprint(result)\n', 'import math\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\n return\nfor x in i:\n result *= x\n if(len(str(result)) >= 19):\n print(-1)\n return\nprint(result)', 'import math\nimport sys\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\n sys.exit()\nfor x in i:\n result *= x\n if(len(str(result)) >= 19):\n print(-1)\n sys.exit()\nprint(result)', 'import math\nimport sys\nN = input()\ni = list(map(int, input().split()))\nresult = 1\nif 0 in i:\n print(0)\n sys.exit()\nfor x in i:\n result *= x\n# if(len(str(result)) >= 19):\n if(result > 10**18):\n print(-1)\n sys.exit()\nprint(result)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s002874335', 's250532455', 's521786220', 's670448041', 's733150802', 's802403599', 's809056350'] | [22256.0, 22136.0, 22300.0, 22156.0, 9092.0, 22132.0, 22248.0] | [56.0, 2206.0, 49.0, 54.0, 25.0, 64.0, 49.0] | [210, 198, 254, 241, 196, 215, 240] |
p02658 | u108440141 | 2,000 | 1,048,576 | 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=1\nli=list(map(input("").split(" ")))\nif "0" in li:\n print("0")\nelse:\n for i in li:\n k*=int(i)\n if k>1000000000000000000:\n print("-1")\n else:\n print(k)\n', 'n=int(input(""))\nk=1\nli=list(map(int,input("").split(" ")))\nif 0 in li:\n print("0")\nelse:\n for i in li:\n k*=int(i)\n if k>1000000000000000000:\n print("-1")\n break\n else:\n print(k)\n', 'n=int(input(""))\nk=1\n# li=list(map(int,input("").split(" ")))\nli=input().split(" ")\nif \'0\' in li:\n print("0")\nelse:\n for i in li:\n k*=int(i)\n if k>1000000000000000000:\n print("-1")\n break\n else:\n print(k)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s250410904', 's910805602', 's028515459'] | [19432.0, 9112.0, 19416.0] | [35.0, 26.0, 50.0] | [203, 219, 257] |
p02658 | u109133010 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\narr=list(map(int,input().split()))\nans=1\nfor i in arr:\n if ans*i<=10**18:\n ans*=i\n else:\n print(-1)\n return(0)\nprint(ans)', 'n=int(input())\narr=list(map(int,input().split()))\nans=1\narr=sorted(arr)\ndef solve(arr,ans):\n for i in arr:\n ans*=i\n if(ans>10**18):\n return(-1)\n if(ans==0):\n return(0)\n if(ans>10**18):\n return(-1)\n return(ans)\nprint(solve(arr,ans))'] | ['Runtime Error', 'Accepted'] | ['s772778476', 's711669976'] | [9108.0, 21652.0] | [24.0, 85.0] | [163, 290] |
p02658 | u109181392 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['count = input()\nlist = input().split(" ")\n\ni = 0\nnum = int(list[i])\ni += 1\nwhile i>= count:\n num = num * int(list[i])\n\t\n if num > 10**18:\n print(-1)\n break\n \n i += 1', 'count = int(input())\nlist = input().split(" ")\nstate = False\ni = 0\nnum = int(list[i])\ni += 1\nlimit = 10 ** 18\nif "0" in list:\n num = 0\n count = 0\n\nwhile i < count:\n num = num * int(list[i])\n\n if num > limit:\n print(-1)\n state = True\n break\n \n i += 1\n\nif not state:\n print(num)'] | ['Runtime Error', 'Accepted'] | ['s230610507', 's948621802'] | [19384.0, 19372.0] | [36.0, 56.0] | [177, 294] |
p02658 | u110311725 | 2,000 | 1,048,576 | 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()\nm = 1\nk = a.index(“B”)\nif k == 0:\n print("0")\nelse:\n for i in range(n):\n m = m * int(a[i])\n if m > 10**18:\n break\n if m > 10**18:\n print("-1")\n else:\n print(m)', 'n = int(input())\na = input().split()\nm = 1\nfor i in range(n):\n m = m * a[i]\n if m = 0:\n break\n \n\nif m > 10**18:\n print("-1")\nelse:\n print(m)', 'n = int(input())\na = list(map(int, input().split()))\nm = 1\nfor i in range(n):\n if a[i] == 0:\n m = 0\n print("0")\n\nif m == 1:\n for j in range(n):\n m = m * a[j]\n if m > 10**18:\n break\n if m > 10**18:\n print("-1")\n else:\n print(m)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s084208916', 's245033101', 's726377254'] | [8956.0, 9024.0, 21748.0] | [25.0, 23.0, 56.0] | [247, 162, 291] |
p02658 | u110336920 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nl = list(map(int, input().split()))\ncur = 1\nif 0 in l:\n print(0)\n exit()\nfor i in l:\n cur *= i\n if cur >= 1000000000000000000:\n print(-1)\n exit()\nprint(cur)', 'n = int(input())\nl = list(map(int, input().split()))\ncur = 1\nfor i in l:\n cur *= i\nif cur >= 1000000000000000000:\n print(-1)\nelse:\n print(cur)', 'n = int(input())\nl = list(map(int, input().split()))\ncur = 1\nif 0 in l:\n print(0)\n exit()\nfor i in l:\n cur *= i\n if cur > 1000000000000000000:\n print(-1)\n exit()\nprint(cur)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s970185969', 's997626006', 's135749280'] | [21780.0, 21660.0, 21576.0] | [50.0, 2206.0, 51.0] | [199, 151, 198] |
p02658 | u111263303 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | [' import numpy as np\n from operator import mul\n from functools import reduce\n N = int(input().strip())\n A = list(map(int,input().split()))\n x = reduce(mul, A)\n if x > 1000000000000000000:\n print("-1")\n else:\n print(x)', ' import numpy as np\n from operator import mul\n from functools import reduce\n N = int(input().strip())\n A = list(map(int,input().split()))\n x = reduce(mul, A)\n if x > 1000000000000000000:\n print("-1")\n else:\n print(x)', 'n = int(input())\nlis = list(map(int,input().split()))\nans = 1\nif 0 in lis:\n print(0)\n exit()\nfor num in lis:\n ans *= num\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s188802636', 's363065138', 's742395418'] | [8800.0, 9008.0, 21756.0] | [22.0, 23.0, 50.0] | [254, 254, 180] |
p02658 | u111473084 | 2,000 | 1,048,576 | 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 import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n N = int(input())\n A = list(map(int, input().split()))\n\n limit = 10**18\n ans = 1\n for i in A:\n if A == 0:\n print(0)\n return\n if ans > limit:\n print(-1)\n return\n ans *= A[i]\n print(ans)\n\nmain()', 'def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n limit = 10**18\n ans = 1\n for i in A:\n ans *= i\n if ans > limit:\n print(-1)\n return\n\n print(ans)\n\nmain()'] | ['Runtime Error', 'Accepted'] | ['s305826359', 's860344557'] | [21916.0, 21604.0] | [50.0, 51.0] | [367, 354] |
p02658 | u112065131 | 2,000 | 1,048,576 | 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\ndef main():\n\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = 1\n\n for i in A:\n if A == 0:\n ans = 0\n break\n ans *= i\n if ans > 10 ** 18:\n ans = -1\n\n print(ans)\n\n\nif __name__ == "__main__":\n main()', '# -*- coding: utf-8 -*-\n\ndef main():\n\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = 1\n\n if 0 not in A:\n for i in A:\n ans *= i\n if ans > 10 ** 18:\n ans = -1\n break\n\n else:\n ans = 0\n\n print(ans)\n\n\nif __name__ == "__main__":\n main()'] | ['Runtime Error', 'Accepted'] | ['s890740096', 's260759742'] | [8936.0, 21628.0] | [25.0, 56.0] | [310, 333] |
p02658 | u112318601 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = map(int, input().split())\n\nover = False\nmul = 1\nif 0 in a:\n mul = 0\nfor a_ in a:\n mul *= a_\n if mul > 10**18:\n mul = -1\n break\nprint(mul)', 'n = int(input())\na = list(map(int, input().split()))\n\nover = False\nmul = 1\nif 0 in a:\n mul = 0\nfor a_ in a:\n mul *= a_\n if mul > 10**18:\n mul = -1\n break\nprint(mul)'] | ['Wrong Answer', 'Accepted'] | ['s943754984', 's959956547'] | [19312.0, 21584.0] | [55.0, 58.0] | [181, 187] |
p02658 | u113444719 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#!/usr/local/bin/python3\n# coding: utf-8\nn = input()\nhairu = input()\nkita = hairu.split(" ")\nseki = 1\n\ntry:\n for c in int(n):\n seki = seki * int(kita[n])\n if seki > 10**18:\n print("-1")\n else:\n print(seki)\nexcept:\n print("-1")', '#!/usr/local/bin/python3\n# coding: utf-8\nn = input()\nhairu = input()\nkita = hairu.split(" ")\nseki = 1\n\ntry:\n for c in kita:\n if seki < 10**18:\n print("-1")\n break\n else:\n seki = seki * int(c)\n if seki > 10**18:\n print("-1")\n else:\n print(seki)\nexcept:\n print("-1")', '#!/usr/local/bin/python3\n# coding: utf-8\nn = input()\nhairu = input()\nkita = hairu.split(" ")\na = []\nint seki = 1\nfor c in kita:\n a.append(c)\ntry:\n for c in a:\n c = c * int(c)\n if c > 10**18:\n print("-1")\n else:\n print(c)\nexcept:\n print("-1")', '#!/usr/local/bin/python3\n# coding: utf-8\nn = input()\nhairu = input()\nkita = hairu.split(" ")\nseki = 1\n\n\nfor c in kita:\n seki = seki * int(c)\n if seki > 10**18:\n break\n if seki > 10**18:\n print("-1")\n else:\n print(seki)', '#!/usr/local/bin/python3\n# coding: utf-8\nn = input()\nhairu = input()\nkita = hairu.split(" ")\nseki = 1\n\nfor c in kita:\n if c == "0":\n kita[0] = "0"\n\nfor c in kita:\n seki = seki * int(c)\n if seki > 10**18:\n break\n\nif seki > 10**18:\n print("-1")\nelse:\n print(seki)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s464519583', 's629201153', 's866556317', 's955738891', 's294817062'] | [19188.0, 19212.0, 9020.0, 19176.0, 19060.0] | [35.0, 33.0, 23.0, 80.0, 63.0] | [259, 369, 277, 251, 290] |
p02658 | u113631524 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N =int(input())\nA_n =list(map(int,input().split()))\nans =1\ni = 0\n\nwhile ans <= 10**18 and i < N:\n ans *= A_n[i]\n i +=1\nif ans > 10**18:\n elif 0 in A_n is False:\n print(-1)\n else:\n print(0)\nelse:\n print(ans)', 'N =int(input())\nA_n =list(map(int,input().split()))\nans =1\ni = 0\n\nwhile ans <= 10**18 and i < N:\n ans *= A_n[i]\n i +=1\nif ans > 10**18:\n elif "0" in A_n is False:\n print(-1)\n else:\n print(0)\nelse:\n print(ans)', 'N =int(input())\nA_n =list(map(int,input().split()))\nans =1\ni = 0\n\nwhile ans <= 10**18 and i < N:\n ans *= A_n[i]\n i +=1\nif ans > 10**18:\n if 0 in A_n:\n print(0)\n else:\n print(-1)\nelse:\n print(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s280056565', 's506745539', 's962677916'] | [8972.0, 9032.0, 21648.0] | [24.0, 23.0, 53.0] | [217, 219, 206] |
p02658 | u115450288 | 2,000 | 1,048,576 | 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()\na = map(int, input().split())\nans = 1\nfrom functools import reduce\nfrom operator import mul\n\nfor b in a:\n ans = reduce(mul, a)\nif(ans > 10 ** 18):\n ans = -1\nprint(ans)', 'input()\na = map(int, input().split())\na = list(a)\nans = 1\nc = 10 ** 18\nif 0 in a:\n print(0)\n exit(0)\nfor b in a:\n ans *= b\n if(ans > c ):\n print(-1)\n exit(0)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s753613096', 's251233487'] | [19352.0, 21632.0] | [2206.0, 51.0] | [181, 194] |
p02658 | u116038906 | 2,000 | 1,048,576 | 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()))\nA =np.array(A,dtype=np.int64)\n\n#\nans =0\nif 0 in A:\n ans =0:\nelse:\n ans =np.prod(A)\n if ans >10**18:\n ans =-1\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\n#\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)'] | ['Runtime Error', 'Accepted'] | ['s766756913', 's476005206'] | [8964.0, 21604.0] | [22.0, 82.0] | [208, 215] |
p02658 | u116722061 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nli = list(map(int,input().split()))\nA = 1\nfor i in range (N):\n \n A = A * li[i]\n if A >= 1000000000000000000:\n print(-1)\n break\n else:\n i += 1\nprint(A)', 'N = int(input())\nli = list(map(int,input().split()))\nA = 1\ni = 0\nB = 0\nif 0 in li:\n print(0)\nelse:\n for i in range (N):\n A = A * li[i]\n if (A > 10**18):\n break\n else: \n B += 1\n i += 1\n if B == N:\n print (A)\n else:\n print (-1)'] | ['Wrong Answer', 'Accepted'] | ['s315053702', 's871151537'] | [21592.0, 21704.0] | [53.0, 58.0] | [180, 281] |
p02658 | u118642796 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nN = int(input())\nA = [int(a) for a in input().split()]\n\nfor a in A:\n if(a==0):\n print(0)\n sys.exit()\n\nans = 1\nfor a in A:\n ans *= a\n if(ans >= 1000000000000000000) :\n print(-1)\n sys.exit()\nprint(ans)', 'import sys\nN = int(input())\nA = [int(a) for a in input().split()]\n\nfor a in A:\n if(a==0):\n print(0)\n sys.exit()\n\nans = 1\nfor a in A:\n ans *= a\n if(ans > 1000000000000000000) :\n print(-1)\n sys.exit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s094896401', 's403079420'] | [21636.0, 21636.0] | [52.0, 54.0] | [247, 246] |
p02658 | u122495382 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nli = list(map(int,input().split()))\nli.sort()\nans = 1\n\nfor i in range(n):\n ans = ans*li[i]\n \n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nli = list(map(int,input().split()))\nans = 1\n\nfor i in range(n):\n ans = ans*li[i]\n \n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nli = list(map(int,input().split()))\nans = 1\n\nfor i in range(n):\n ans = ans*li[i]\n \nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\nli = list(map(int,input().split()))\nli.sort()\nans = 1\n \nfor i in range(n):\n ans = ans*li[i]\n \n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s324596421', 's344642478', 's930582337', 's118626523'] | [21576.0, 21644.0, 21788.0, 21652.0] | [95.0, 55.0, 2206.0, 92.0] | [166, 156, 150, 167] |
p02658 | u123849536 | 2,000 | 1,048,576 | 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())\ntotal = 1\n\nif 0 in a:\n total = 0\nelse:\n for i in a:\n total *= i\n if total > 10 ** 18:\n total = -1\n break\nprint(total)', 'n = int(input())\na = map(int, input().split())\ntotal = 1\n\nif 0 in a:\n total = 0\nelse:\n for i in a:\n total *= i\n print(i, total)\n if total > 10 ** 18:\n total = -1\n break\nprint(total)', 'n = int(input())\na = list(map(int, input().split()))\ntotal = 1\n\nif 0 in a:\n total = 0\nelse:\n for i in a:\n total *= i\n if total > 10 ** 18:\n total = -1\n break\nprint(total)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s397084034', 's844796667', 's774783782'] | [19356.0, 19380.0, 21792.0] | [45.0, 46.0, 49.0] | [182, 202, 188] |
p02658 | u125269142 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nN = int(input())\nv = np.arrray(list(map(int, input().split())))\n\nanswer = v.prod()\n\nanswer = answer if answer <= 10 ** 18 else -1\nprint(answer)', 'import functools\nimport operator\nN = 2\nv = [1, 0, 2]\nlimit = 10 ** 18\nif 0 not in v:\n answer = functools.reduce(operator.mul, v)\nelse:\n answer = 0\nanswer = answer if answer <= limit else -1\nprint(answer)', 'import functools\nimport operator\n\nN = int(input())\nv = ((map(int, input().split())))\nanswer = functools.reduce(operator.mul.v)\nanswer = answer if answer <= 10 ** 18 else -1\nprint(answer)', 'N = int(input())\nv = list(map(int, input().split()))\nanswer = reduce(lambda x,y: x*y, v)\nanswer = answer if answer <= 1000000000000000000 else -1\nprint(answer)', 'import functools\nimport operator\n\nN = int(input())\nv = ((map(int, input().split())))\nanswer = functools.reduce(mul.v)\nanswer = answer if answer <= 10 ** 18 else -1\nprint(answer)', 'import functools\nimport operator\n\nN = int(input())\nv = ((map(int, input().split())))\nanswer = functools.reduce(mul.v)\nanswer = answer if answer <= 1000000000000000000 else -1\nprint(answer)', 'N = int(input())\nv = list(map(int, input().split()))\nlimit = 10 ** 18\n\nanswer = 1\nif 0 in v:\n answer = 0\nelse:\n for i in v:\n answer = answer * i\n if answer <= limit:\n continue\n else:\n answer = -1\n break\nprint(answer)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s020668366', 's257770894', 's435538597', 's536931194', 's697863295', 's937240879', 's504139212'] | [27152.0, 9492.0, 20464.0, 21644.0, 20360.0, 20636.0, 21780.0] | [109.0, 25.0, 34.0, 43.0, 38.0, 40.0, 55.0] | [163, 209, 186, 159, 177, 188, 242] |
p02658 | u125991831 | 2,000 | 1,048,576 | 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()))\nre = 1\nfor i in range(N):\n re *= A[i]\n if re >= 10**18:\n print(-1)\nelse:\n print(re)', 'N = int(input())\nA = list(map (int, input().split()))\nif 0 in A:\n print(0)\n return\n \nre = 1\nfor i in range(N):\n re *= A[i]\n if re >= pow(10,18):\n print(-1)\n return\nelse:\n print(re)\n return', 'N = int(input())\nA = list(map (int, input().split()))\nre = 1\nfor i in range(N):\n re *= A[i]\n if re >= pow(10,18):\n print(-1)\n \tbreak\nelse:\n print(re)', '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\n\nprint(prod)', 'a = int(input())\nar = list(map(int,input().split()))\nif 0 in ar:\n print(0)\n return\nb = 1\nfor r in ar:\n b *= r\n if b > 10 ** 18:\n print(-1)\n exit()\nprint(b)\n', 'a = int(input())\nar = list(map(int,input().split(" ")))\nif 0 in ar:\n print(0)\n return\n\nb = 1\nfor r in ar:\n b *= r\n if b > 10 ** 18:\n print(-1)\n return\nprint(b)\n', 'a = int(input())\nar = list(map(int,input().split()))\nif 0 in ar:\n print(0)\n exit()\nb = 1\nfor r in ar:\n b *= r\n if b > 10 ** 18:\n print(-1)\n return\nprint(b)\n', 'a = int(input())\nar = list(map(int,input().split()))\nif 0 in ar:\n print(0)\n exit()\nb = 1\nfor r in ar:\n b *= r\n if b > 10 ** 18:\n print(-1)\n exit()\nprint(b)\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s106381396', 's537390605', 's544566958', 's673434463', 's721963673', 's971395504', 's983538737', 's279493452'] | [21680.0, 9060.0, 21432.0, 9088.0, 9040.0, 9080.0, 9092.0, 21620.0] | [2206.0, 24.0, 72.0, 22.0, 25.0, 26.0, 22.0, 54.0] | [153, 216, 171, 180, 182, 186, 182, 182] |
p02658 | u126236540 | 2,000 | 1,048,576 | 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 arr = list(map(int, input().split()))\n a = 1\n for i in arr:\n a*=i\n if a>10**18:\n print("-1")\n return\n \n print(a)\n', 'def main():\n n = int(input())\n arr = list(map(int, input().split()))\n if 0 in arr:\n print(0)\n return\n a = 1\n for i in arr:\n a*=i\n if a>10**18:\n print("-1")\n return\n \n print(a)\nmain()\n'] | ['Wrong Answer', 'Accepted'] | ['s384860887', 's799657428'] | [8964.0, 21684.0] | [24.0, 53.0] | [198, 254] |
p02658 | u127285813 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n if ans >= 10**(18)/a:\n ans = -1\n break\n else:\n ans *= a\n\nif 0 in A:\n print(0)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n if ans >= 10**(18)//a:\n ans = -1\n break\n else:\n ans *= a\n\nif 0 in A:\n print(0)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in ans:\n if ans >= 10**(18)/a:\n\tans = -1\n break\n else:\n ans *= a\n\nif 0 in A:\n print(0)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n if ans > 10**(18)//a:\n ans = -1\n break\n else:\n ans *= a\n\nif 0 in A:\n print(0)\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s268967494', 's281625485', 's825372661', 's281166416'] | [21780.0, 21460.0, 9020.0, 21764.0] | [54.0, 48.0, 24.0, 51.0] | [183, 184, 182, 183] |
p02658 | u127288756 | 2,000 | 1,048,576 | 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())\nlis=list(map(int,input().split()))\nlis2=np.array(lis)\nans=np.prod(lis2)\nif ans >=10**18:\n ans=-1\nprint(ans)', 'n = int(input())\nA = [*map(int,input().split())]\nA.sort()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s785244584', 's455029103'] | [39988.0, 21584.0] | [145.0, 84.0] | [144, 153] |
p02658 | u127643144 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["#include<bits/stdc++.h>\n\n \nusing namespace std;\n \nint main(){\n ll n;\n cin>>n;\n ll arr[n];\n ll m =1;\n for(int i=0;i<n;i++){\n cin>> arr[i];\n }\n for(int i=0;i<n;i++){\n m = m* arr[i];\n }\n if(m <=1000000000000000000)\n cout<<m<<endl;\n else\n cout<<'-1'<<endl;\n return 0;\n}", 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n ans = 1\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n return\n\n print(ans)\n\nmain()'] | ['Runtime Error', 'Accepted'] | ['s972319057', 's919515648'] | [9008.0, 21492.0] | [25.0, 61.0] | [312, 269] |
p02658 | u127873832 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\nelse:\n print(list(A))\n bound = 10 ** 18\n ans = 1\n for a in A:\n ans = ans * a\n if ans > bound:\n ans = -1\n break\n print(ans)', 'n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\nelse:\n bound = 10 ** 18\n ans = 1\n for a in A:\n ans = ans * a\n if ans > bound:\n ans = -1\n break\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s169607883', 's197093551'] | [21776.0, 21792.0] | [64.0, 48.0] | [250, 231] |
p02658 | u127981515 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["N=int(input())\nA=list(map(int,input().split(' ')))\nans=A[0]\nfor a in A:\n ans*=a\n if (ans > 10**18):\n print(-1)\n exit()\nprint(ans)\n\n", "N=int(input())\nA=list(map(int,input().split(' ')))\nans=A[0]\nfor a in A:\n ans*=a\n \nif (ans > 10**18):\n print(-1)\nelse:\n print(ans)", "N=int(input())\nA=list(map(int,input().split(' ')))\nans=1\ncalcneeded=1\n\nfor a in A:\n if (a == 0):\n print(0)\n exit()\n \n if (calcneeded == 1):\n ans*=a\n \n if (ans > 10**18):\n calcneeded=0\n\nif (ans > 10**18):\n print(-1)\nelse:\n print(ans)\n\n\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s191217739', 's377623661', 's441773931'] | [21780.0, 21472.0, 21648.0] | [48.0, 2206.0, 59.0] | [151, 141, 284] |
p02658 | u129749062 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import functools\nimport operator\nimport numpy as np\nprod = functools.partial(functools.reduce, operator.mul)\nN = int(input())\nA = list(map(float, input().split()))\n#print(A)\noutput = prod(A)\n#print(output)\nprint(output if abs(output) <= 10**18 else -1)', 'import numpy as np\nN = int(input())\nA = list(map(int,input().split()))\n#output = np.prod(A)\nAA=1\nfor i in range(N+1):\n #print(A[i])\n AA = AA * A[i]\na = pow(10,18)\nprint(AA if abs(AA) <= a else -1)', 'N = int(input())\nA = list(map(int,input().split()))\nmul = 1\nfor i in range(N):\n mul *= A[i]\nprint(mul if mul < 10**18 else -1)', 'import sys\nN = int(input())\nA = list(map(int,input().split()))\nA.sort()\nmul = A[0]\nfor i in range(1,N):\n mul *= A[i]\n if mul > 10**18:\n print(-1)\n sys.exit()\nprint(mul)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s010008201', 's680494685', 's923096920', 's622019317'] | [40176.0, 40140.0, 21556.0, 21528.0] | [148.0, 2206.0, 2206.0, 93.0] | [252, 198, 127, 176] |
p02658 | u131406572 | 2,000 | 1,048,576 | 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())\nl = list(map(int,input().split()))\nimport numpy as np\nsum_log =0\nfor i in l:\n sum_log+=np.log10(i)\n if sum_log>18:\n print(-1)\n break\n#print(sum_log)\nprint(10**sum_log)\n#print(10**18.0)', 'a =int(input())\nl = list(map(int,input().split()))\nimport numpy as np\nsum_log =0\nfor i in l:\n sum_log+=np.log(i)\n if sum_log>18:\n print(-1)\n break\nprint(10**sum_log)', 'a =int(input())\nl = list(map(int,input().split()))\nl.sort()\nimport numpy as np\ntimes = 1\nfor i in l:\n times*=i\n if times>10**18:\n times = -1\n break\nprint(times)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s454211502', 's733388551', 's899001010'] | [30564.0, 30552.0, 30656.0] | [249.0, 251.0, 295.0] | [208, 173, 168] |
p02658 | u132894387 | 2,000 | 1,048,576 | 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;\niszero = False\n\nfor i in range(N):\n if(A[i]==0):\n iszero = True\n\nfor i in range(N):\n if(iszero):\n ans = 0\n break\n \n ans *= A[i]\n \n if(ans>=10**18):\n ans = -1\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans =1;\n\nfor i in range(N):\n ans *= A[i]\nif(ans>=10**18):\n ans = -1\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans =1;\niszero = False\n\nif 0 in A:\n iszero = True\nfor i in range(N):\n if(iszero):\n ans = 0\n break\n ans *= A[i] \n if ans>10**18:\n ans = -1\n break\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s181588603', 's643867950', 's700843977'] | [21764.0, 21600.0, 21432.0] | [2206.0, 2206.0, 57.0] | [250, 134, 225] |
p02658 | u135197221 | 2,000 | 1,048,576 | 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 = int(input())\n\nlist1 = list(map(int, input().split(" ")))\n\ndef calc():\n result = 1\n if 0 in result:\n print("-1")\n exit()\n for i in list1:\n result *= i\n if result > 1000000000000000000:\n print("-1")\n exit()\n print(result)\n\ncalc()', 'x = int(input())\n\nlist1 = list(map(int, input().split(" ")))\n\nresult = list1[0]\nfor i in list1[1:]:\n result *= i\n\nprint(result if result < 10**18 else "-1")', 'x = int(input())\n\nlist1 = list(map(int, input().split(" ")))\n\ndef calc():\n result = 1\n for i in list1:\n result *= i\n if result > 1000000000000000000:\n print("-1")\n exit()\n print(result)', 'x = int(input())\n\nlist1 = list(map(int, input().split(" ")))\n\ndef calc():\n result = list1[0]\n for i in list1[1:]:\n result *= i\n if result > 1000000000000000000:\n print("-1")\n exit()\n print(result)', 'def main():\n x = int(input())\n list1 = list(map(int, input().split(" ")))\n result = 1\n\n if 0 in list1:\n print(0)\n return\n\n for i in list1:\n result *= i\n if result > 10*18:\n print("-1")\n exit()\n print(result)\n\nmain()', 'def main():\n x = int(input())\n list1 = list(map(int, input().split(" ")))\n result = 1\n\n if 0 in list1:\n print(0)\n return\n\n for i in list1:\n result *= i\n if result > 1000000000000000000:\n print("-1")\n exit()\n print(result)\n\nmain()'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s159367290', 's347894279', 's604762707', 's707470169', 's731386166', 's620185238'] | [21724.0, 21644.0, 21648.0, 21432.0, 21704.0, 21608.0] | [58.0, 2206.0, 56.0, 57.0, 59.0, 57.0] | [293, 159, 230, 241, 283, 297] |
p02658 | u135389999 | 2,000 | 1,048,576 | 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\nfor i in a:\n ans *= i\n if ans >= 10 ** 18:\n flag = 1\n break\n\nif flag == 1:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\nflag = 0\nans = 1\n\nfor i in a:\n if i == 0:\n flag = -1\n break\n if ans * i > 10 ** 18:\n flag = 1\n else:\n ans *= i\n\nif flag == 1:\n print(-1)\nelif flag == -1:\n print(0)\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s099227819', 's375262294'] | [21400.0, 21592.0] | [58.0, 69.0] | [183, 280] |
p02658 | u135572611 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\nn=int(input())\na = list(map(int,input().split()))\nans = 1\na.sort()\nfor i in range(a):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n sys.exit()\nprint(ans)', 'import sys\nn=int(input())\na = list(map(int,input().split()))\nans = 1\na.sort()\nfor i in range(len(a)):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n sys.exit()\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s923722570', 's412479611'] | [21796.0, 21636.0] | [81.0, 87.0] | [182, 188] |
p02658 | u135847648 | 2,000 | 1,048,576 | 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\ndef main():\n n = int(input())\n A = np.array(list(map(int, input().split())))\n limit = 10 ** 18\n\n if np.any(A=0):\n print(0)\n else:\n ans = 1\n for i in range(n):\n ans *= A[i]\n if ans > limit:\n print(-1)\n exit()\n\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', 'import numpy as np\n\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n a.sort(reverse=True)\n A = np.array(list(map(int, input().split())))\n limit = 10 ** 18\n\n if np.any(A == 0):\n print(0)\n elif np.any(A > limit):\n print(-1)\n else:\n ans = 1\n\n for i in range(n):\n ans *= A[i]\n if ans > limit:\n print(-1)\n exit()\n\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', 'def main():\n n = int(input())\n A = list(map(int, input().split()))\n A.sort(reverse=True)\n limit = 10 ** 18\n #print(A)\n\n if A[-1] == 0:\n print(0)\n elif A[0] > limit:\n print(-1)\n else:\n ans = A[0]\n for i in range(1, n):\n ans *= A[i]\n if ans > limit:\n print(-1)\n exit()\n\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s703830027', 's717995178', 's663908524'] | [40148.0, 40172.0, 21692.0] | [156.0, 164.0, 73.0] | [375, 492, 431] |
p02658 | u136284779 | 2,000 | 1,048,576 | 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())\nm=list(map(int,input().split()))\nx=1\nif 0 in m:\n print(0)\nelse:\n for y in m:\n x*=y\n if len(str(x))>18:\n print(-1)\n print(x)\n\n', 'n=int(input())\nm=list(map(int,input().split()))\nx=1\nif 0 in m:\n print(0)\nelse:\n for y in m:\n x*=y\n if x>10**18:\n print(-1)\n break\n else:\n print(x)', 'n=int(input())\nm=list(map(int,input().split()))\nx=1\nif 0 in m:\n print(0)\nelse:\n for y in m:\n x*=y\n if len(str(x))>18:\n print(-1)\n else:\n print(x)\n\n', 'x=1\nn=int(input())\na=map(int,input().split())\nm=list(a)\nfor x in m:\n if x==0:\n print(0)\n else:\n x*=x\nif x<=10**18 and x!=0:\n print(x)\nelif x==0:\n break\nelse:\n print(-1)\n\n', 'n=int(input())\nm=list(map(int,input().split()))\nx=1\nif 0 in m:\n print(0)\nelse:\n for y in m:\n x*=y\n if x>10**18:\n print(-1)\n break\n\telse:\n print(x)', 'n=int(input())\nA=list(map(int,input().split()))\na=0\nans=1\nif 0 in A:\n ans=0\nelse:\n for a in range(n):\n ans*=A[a]\n a+=1\n if ans<=10**18:\n continue\n else:\n ans=-1\n break\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s086917714', 's173079268', 's424227643', 's650218961', 's966108503', 's366051432'] | [21508.0, 21592.0, 21620.0, 8912.0, 9036.0, 21784.0] | [2206.0, 77.0, 2206.0, 25.0, 23.0, 62.0] | [154, 172, 160, 181, 169, 246] |
p02658 | u137316733 | 2,000 | 1,048,576 | 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,list(input()))) for i in range(N)]\n\ns=1\nfor i in range(N):\n s = s*A[i]\n if s > 10**18:\n s = -1\n print('-1')\n break\nif s != -1:\n print(s)", "N=int(input())\nA=list(map(int, input().split()))\n\ns=1\nif min(A) == 0:\n s = 0\n print(s)\nelif max(A) > 10**18:\n s = -1\n print(s)\nelse:\n for i in range(N):\n s = s*A[i]\n if s > 10**18:\n s = -1\n print('-1')\n break\n if s != -1:\n print(s)"] | ['Runtime Error', 'Accepted'] | ['s566190051', 's788966434'] | [25676.0, 21712.0] | [42.0, 52.0] | [197, 303] |
p02658 | u137646745 | 2,000 | 1,048,576 | 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(int,input().split())\nans=a*b\np=math.log10(ans)\nif p>=18:\n print(-1)\nelse:\n print(ans)', "import math\nimport numpy as np\nn=input()\nlist=list(map(int,input().split()))\nlist=np.array(list,'int64')\nans=np.prod(list)\np=math.log10(ans)\nif p>=18:\n print(-1)\nelse:\n print(np.prod(list))", 'import math\nimport numpy as np\nn=input()\nlist=list(map(int,input().split()))\nlist=np.array(list,int)\n\np=math.log10(list)\np=p.sum()\nif p>=18:\n print(-1)\nelse:\n print(np.prod(list))', 'import math\nimport numpy as np\nn=input()\nlist=list(map(int,input().split()))\nlist=np.array(list,int)\nans=np.prod(list)\np=math.log10(ans)\nif p>=18:\n print(-1)\nelse:\n print(np.prod(list))\n', 'n=input()\nlist=list(map(int,input().split()))\n\nflg=True\nif 0 in list:\n print(0)\n flg=False\nelse:\n prod=1\n for a in list:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n flg=False\n break\nif flg:\n print(prod)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s237435559', 's429100488', 's463433197', 's663389918', 's987446507'] | [8932.0, 39772.0, 39988.0, 40288.0, 21580.0] | [25.0, 143.0, 143.0, 153.0, 56.0] | [95, 191, 181, 188, 240] |
p02658 | u138781768 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from operator import mul\nfrom functools import reduce\nn = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1 * reduce(mul, alis)\n \nif ans < 10**18:\n print(ans)\nelse:\n print(-1)\n', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nfor a in alis:\n ans *= a\n \nif ans > 10**18:\n print(ans)\nelse:\n print(-1)', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nfor a in alis:\n ans *= a\n \nif ans < 10**18:\n print(ans)\nelse:\n print(-1)\n', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nfor a in alis:\n ans *= a\n if ans > 10**18:\n \tans = -1\n break\n\nprint(-1)\n', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nfor a in alis:\n ans *= a\n if ans > 10**18:\n\tans = -1\n\tbreak\n\nprint(ans)\n', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nfor a in alis:\n \tans *= a\n\tif ans > 10**18:\n\t\tans = -1\n\t\tbreak\n\nprint(ans)\n', 'n = int(input())\n\nalis = list(map(int, input().split()))\n\nans = 1\n\nif 0 in alis:\n print(0)\n exit()\n\nfor a in alis:\n\tans *= a\n\tif ans > 10**18:\n\t\tans = -1\n\t\tbreak\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s099584657', 's103408614', 's118070654', 's164087295', 's603891163', 's783416167', 's224650034'] | [22932.0, 21584.0, 21580.0, 8972.0, 9016.0, 9032.0, 21712.0] | [2206.0, 2206.0, 2206.0, 21.0, 23.0, 20.0, 49.0] | [190, 142, 143, 145, 141, 143, 176] |
p02658 | u141410514 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nA = list(map(int,input().split()))\nans = A[0]\nMOD = 10**6\ncnt = 0\nfor i in range(1,n):\n ans = ans * A[i]\n tmp = ans // MOD\n if tmp != 0:\n ans = ans % MOD\n cnt += tmp\n if cnt >= 3:\n ans = -1\nprint(ans)', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\nans = A[0]\nINF = 1000000000000000000\nfor i in range(1,n):\n l,r = len(str(ans)),len(str(A[i]))\n if l+r > 18:\n ans = -1\n break\n else:\n ans = ans * A[i]\nprint(ans)\n', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\nans = A[0]\nINF = 1000000000000000000\nfor i in range(1,n):\n l,r = len(str(ans)),len(str(A[i]))\n if l+r > 21:\n ans = -1\n break\n else:\n ans = ans * A[i]\n if ans > INF:\n ans = -1\n break\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s514670953', 's899060024', 's897483867'] | [21644.0, 21644.0, 21656.0] | [99.0, 95.0, 152.0] | [250, 252, 313] |
p02658 | u141642872 | 2,000 | 1,048,576 | 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())\nif 0 in A:\n print(0)\n exit(0)\nmul = 1\nfor a in A:\n if mul * a > 10 ** 18:\n print(-1)\n exit(0)\n mul *= a\nprint(mul)\n', 'N = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit(0)\nmul = 1\nfor a in A:\n if mul * a > 10 ** 18:\n print(-1)\n exit(0)\n mul *= a\nprint(mul)\n'] | ['Wrong Answer', 'Accepted'] | ['s625756611', 's400701279'] | [19492.0, 21776.0] | [45.0, 53.0] | [188, 194] |
p02658 | u143223369 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from sys import stdin\nMAX = 10^18\n\ndef main():\n line_count = 0\n\n for line in stdin:\n line_count += 1\n factors_str = line.split()\n if line_count == 2:\n break\n\n factors = [int(factor) for factor in factors_str]\n \n if 0 in factors:\n print(0)\n return\n\n product = 1\n for factor in factors:\n product *= factor\n if product > MAX:\n print(-1)\n return\n\n print(product)\n\nmain()', 'from sys import stdin\nMAX = 10**18\n\ndef main():\n line_count = 0\n\n for line in stdin:\n line_count += 1\n factors_str = line.split()\n if line_count == 2:\n break\n\n factors = [int(factor) for factor in factors_str]\n \n if 0 in factors:\n print(0)\n return\n\n product = 1\n for factor in factors:\n product *= factor\n if product > MAX:\n print(-1)\n return\n\n print(product)\n\nmain()'] | ['Wrong Answer', 'Accepted'] | ['s358957254', 's665067440'] | [23428.0, 23556.0] | [50.0, 52.0] | [472, 473] |
p02658 | u143510472 | 2,000 | 1,048,576 | 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 A = list(map(int, input("").split()))\n \n limit = 1000000000000000000\n \n result = 1\n for i in A:\n if result >= limit:\n result = -1\n break\n result = result * i\n \n print(result)', 'limit = 1E18\n\nN = int(input(""))\nA = list(map(int, input("").split()))\n\nresult = 1\nfor n in A:\n result *= n\n\nif result >= limit:\n print("-1")\nelse:\n print(result)', 'N = int(input(""))\nA = list(map(int, input("").split()))\n\nlimit = 1000000000000000000\n\nresult = 1\nfor i in A:\n if result >= limit:\n result = -1\n \tbreak\n result = result * i\n\nprint(result)', 'N = int(input(""))\nA = list(map(int, input("").split()))\n\nlimit = 1000000000000000000\n\nresult = 1\nif 0 not in A:\n for i in A:\n result = result * i\n if result > limit:\n result = -1\n break\nelse:\n result = 0\n\nprint(result)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s403137461', 's661002658', 's953816408', 's576708751'] | [8992.0, 21692.0, 9032.0, 21588.0] | [22.0, 2206.0, 22.0, 47.0] | [249, 165, 193, 237] |
p02658 | u143596442 | 2,000 | 1,048,576 | 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"""\nCreated on Sat Jun 13 18:45:47 2020\n\n@author: kawati\n"""\n\nN = int(input())\n\nMAX = 10**18\nans = 1\na = list(map(int, input().split())) \n\nfor x in a:\n ans *= x\n if ans > MAX:\n print(-1)', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Jun 13 18:45:47 2020\n\n@author: kawati\n"""\n\nN = int(input())\n\nMAX = 10**18\nans = 1\na = list(map(int, input().split())) \n\nfor x in a:\n if x == 0:\n print(0)\n exit(0)\n\n\nfor x in a:\n ans *= x\n if ans > MAX:\n print(-1)\n exit(0)\n \n #exit(0)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s514725481', 's139932822'] | [21592.0, 21784.0] | [2206.0, 53.0] | [223, 374] |
p02658 | u145145077 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n=int(input())\nA = list(map(int, input().split()))\nresult=1\nlimit=10**18\nflg0=0\nfor i in range(n):\n if A[i] == 0:\n flg0=1\n print('0')\nfor i in range(n):\n if flg0 == 1:\n break\n result *= A[i]\n if result > limit:\n print('-1')\n flg=1\n break\nif flg != 1 and flg0 != 1:\n print(result)", "n=int(input())\nA = list(map(int, input().split()))\nresult=1\nlimit=10**18\nflg0=0\nflg=0\nfor i in range(n):\n if A[i] == 0:\n flg0=1\n print('0')\nfor i in range(n):\n if flg0 == 1:\n break\n result *= A[i]\n if result > limit:\n print('-1')\n flg=1\n break\nif flg != 1 and flg0 != 1:\n print(result)"] | ['Runtime Error', 'Accepted'] | ['s199781828', 's990628388'] | [21712.0, 21580.0] | [57.0, 62.0] | [302, 308] |
p02658 | u146066372 | 2,000 | 1,048,576 | 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()))\nD=int(1)\n \nA.sort()\nif A[0]==0:\n print(0)\nelse:\n A.sort(reverse=True)\n for i in range(N):\n D*=A[i]\n if D>10**18:\n print(-1)\n else:\n print(D)', 'N=int(input())\nA=list(map(int,input().split()))\nD=int(1)\n \nA.sort()\nif A[0]==0:\n print(0)\nelse:\n A.sort(reverse=True)\n for i in range(N):\n D*=A[i]\n if D>10**18:\n print(-1)\n break\n else:\n print(D)', 'N=int(input())\nA=list(map(int,input().split()))\nD=int(1)\n \nA.sort()\nif A[0]==0:\n print(0)\nelse:\n A.sort(reverse=True)\n for i in range(N):\n D*=A[i]\n if D>10**18:\n print(-1)\n break\n else:\n print(D)\n break', 'N=int(input())\nA=list(map(int,input().split()))\nD=int(1)\nans=int(0)\nA.sort()\nif A[0]==0:\n ans==0\nelse:\n A.sort(reverse=True)\n for i in range(N):\n D*=A[i]\n if D>10**18:\n ans=-1\n break\n\n else:\n ans=D\n \n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s257957081', 's372062981', 's894505645', 's645108788'] | [21660.0, 21556.0, 21600.0, 21536.0] | [2206.0, 91.0, 83.0, 83.0] | [241, 259, 277, 282] |
p02658 | u146102471 | 2,000 | 1,048,576 | 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(int(i) for i in input().split(" "))\n\nprod = 1\n\nfor i in a:\n prod *= i\n if prod > (10 ** 18):\n \tprod = -1\n break\n\n\nprint(prod)\n', 'n = int(input())\n\na = list(int(i) for i in input().split(" "))\n\nprod = 1\n\nif 0 in a:\n prod = 0\nelse:\n for i in a:\n prod *= i\n if prod > (10 ** 18):\n prod = -1\n break\n\n\nprint(prod)\n'] | ['Runtime Error', 'Accepted'] | ['s292842396', 's439589516'] | [8956.0, 21632.0] | [21.0, 52.0] | [159, 198] |
p02658 | u148665975 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['inp = input()\ninp = input()\n \ndef mp(nums):\n n = 1\n limit= 10 ** 10\n for num in nums:\n n *=num\n if num > limit:\n print(-1)\n return\n print(num)\n return\n \nmp([int(x) for x in inp.split(" ")])', 'inp=input()\nnums = [int(x) for x in inp.split(" ")]\n\ndef mp(nums):\n n = 1\n for num in nums:\n n *=num\n return n\n\nlimit= mp([10]*18)\nnum = mp(nums)\n\nif n>limit:\n print(-1)\nelse:\n print(num)', 'inp = input()\ninp = input()\n \ndef mp(nums):\n n = 1\n for num in nums:\n n *=num\n \tif num > limit:\n \t\tprint(-1)\n \t\treturn\n print(num)\n return\n \nlimit= 10 ** 10\nnum = mp([int(x) for x in inp.split(" ")])\n \n', 'inp = input()\ninp = input()\n \ndef mp(nums):\n n = 1\n limit= 10 ** 10\n for num in nums:\n n *=num\n \tif num > limit:\n \t\tprint(-1)\n \t\treturn\n print(num)\n return\n \nmp([int(x) for x in inp.split(" ")])\n ', 'inp = input()\ninp = input()\n\nlimit= 10 ** 18\n\ndef mp(nums):\n n = 1\n for num in nums:\n n *=num\n if num > limit:\n print(-1)\n return\n print(num)\n return\n \nmp([int(x) for x in inp.split(" ")])', 'inp = input()\ninp = input()\n \ndef mp(nums):\n n = 1\n limit= 10 ** 10\n for num in nums:\n n *=num\n \tif num > limit:\n \t print(-1)\n \t return\n print(num)\n return\n \nmp([int(x) for x in inp.split(" ")])', 'inp = input()\ninp = input()\n \ndef mp(nums):\n if 0 in nums:\n print(0)\n return\n n = 1\n limit = 10**18\n for num in nums:\n n *=num\n if n > limit:\n print(-1)\n return\n print(n)\n \nmp([int(x) for x in inp.split(" ")])'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s013986050', 's070521712', 's152588530', 's391482790', 's394925457', 's944427452', 's685983877'] | [23728.0, 9188.0, 8912.0, 9020.0, 23588.0, 8788.0, 23556.0] | [48.0, 19.0, 22.0, 23.0, 2206.0, 23.0, 51.0] | [210, 195, 212, 207, 208, 207, 236] |
p02658 | u149551680 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n \nA.sort()\nrslt = a[0]\n\nfor a in A[1:]:\n result *= a\n if rslt > 10**18:\n print(-1)\n exit()\nprint(rslt)', 'N = int(input())\nA = list(map(int, input().split()))\n \nA.sort()\nrslt = A[0]\n \nfor a in A[1:]:\n result *= a\n if rslt > 10**18:\n print(-1)\n exit()\nprint(rslt)', 'N = int(input())\nA = list(map(int, input().split()))\n \nA.sort()\nrslt = A[0]\n \nfor a in A[1:]:\n rslt *= a\n if rslt > 10**18:\n print(-1)\n exit()\nprint(rslt)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s448236722', 's693013835', 's849512253'] | [21556.0, 21568.0, 21580.0] | [79.0, 83.0, 95.0] | [163, 164, 162] |
p02658 | u150788544 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\nN = int(input())\narr = np.array(list(map(int,input().split())))\ns = arr.prod()\nif s > 10**8:\n print(-1)\nelse:\n print(s)', 'N = int(input())\nlst = list(map(int,input().split()))\nif 0 in lst:\n s = 0\nelse:\n s = 1\n for x in lst:\n s = s*x\n if s > 10**18:\n s = -1\n break\nprint(s) \n '] | ['Wrong Answer', 'Accepted'] | ['s576869570', 's435671637'] | [40124.0, 21568.0] | [153.0, 51.0] | [140, 180] |
p02658 | u152614052 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nli = list(map(int,input().split()))\nMAX = 10 ** 18\nli.sort()\nans = 1\nfor i in li:\n ans *= i\n if ans >= MAX or ans == 0:\n ans = -1\n break\nprint(ans)', 'n = int(input())\nli = list(map(int,input().split()))\nMAX = 10 ** 18\nli.sort()\nans = 1\nif li[0] == 0:\n ans = 0\nelse:\n for i in li:\n ans *= i\n if ans >= MAX:\n ans = -1\n break\nprint(ans)', 'n = int(input())\nli = list(map(int,input().split()))\nMAX = 10 ** 18\nli.sort()\nans = 1\nif li[0] == 0:\n ans = 0\nelse:\n for i in li:\n ans *= i\n if ans > MAX:\n ans = -1\n break\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s013950340', 's380390272', 's102729272'] | [21632.0, 21552.0, 21684.0] | [76.0, 76.0, 75.0] | [184, 225, 224] |
p02658 | u153556810 | 2,000 | 1,048,576 | 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 = map(int, input());\nans = 1\nfor i in range(n):\n ans *= list[i]\n if ans>10**18 :\n ans = -1\n break\nprint(ans)\n', 'n = int(input());\nans = 1;\nzero = false\nfor i in map(int, input().split()):\n ans *= i\n if i==0:\n zero = true\nprint(ans if ans>=0 else -1);\n', 'n = int(input());\nlist = list(map(int,input().split()))\nzero = False\nfor i in list:\n if i==0:\n zero = True\n break\nif zero:\n print(0)\nelse:\n ans = 1\n for i in list:\n ans *= i\n if ans>10**18:\n ans = -1\n break\n print(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s271853044', 's893355181', 's554645554'] | [12784.0, 9084.0, 21516.0] | [23.0, 21.0, 56.0] | [152, 152, 284] |
p02658 | u153686508 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nans=1\nl=sorted(list(map(int,input().split())))\nif l[0]==0:\n print(0)\nelse:\n for i in range(n):\n ans*=l[i]\n if ans>100000000000000000:\n ans=-1\n break\n print(ans)', 'n=int(input())\nans=1\nl=sorted(list(map(int,input().split())))\nif l[0]==0:\n print(0)\nelse:\n for i in range(n):\n ans*=l[i]\n if ans>1000000000000000000:\n ans=-1\n break\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s738307215', 's948886156'] | [21648.0, 21548.0] | [84.0, 85.0] | [220, 221] |
p02658 | u154997495 | 2,000 | 1,048,576 | 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\nif __name__ == '__main__':\n N = int(input())\n li_A = list(map(int, input().split()))\n\n ans = li_A[0]\n\n for i in range(1,N):\n if (ans * li_A[i]) < 1000000000000000000:\n ans = ans * li_A[i]\n\n else:\n ans = -1\n\n print(ans)", "# coding=utf-8\nimport sys\n\nif __name__ == '__main__':\n N = int(input())\n li_A = list(map(int, input().split()))\n\n ans = li_A[0]\n\n if 0 in li_A:\n print('0')\n sys.exit()\n\n for i in range(1, N):\n if ans * li_A[i] > 1000000000000000000:\n print('-1')\n sys.exit()\n else:\n ans *= li_A[i]\n\n print(ans)\n\n"] | ['Wrong Answer', 'Accepted'] | ['s013288424', 's309495969'] | [21768.0, 21640.0] | [2206.0, 62.0] | [285, 374] |
p02658 | u157020659 | 2,000 | 1,048,576 | 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\nx_min = min(a)\nif x_min == 0:\n print(0)\nelse:\n for x in a:\n ans *= x\n if ans >= 10 ** 18:\n print(-1)\n break\n else:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nx_min = min(a)\nif x_min == 0:\n print(0)\nelse:\n for x in a:\n ans *= x\n if ans > 10 ** 18:\n print(-1)\n break\n else:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s298044007', 's632135209'] | [21764.0, 21624.0] | [50.0, 57.0] | [239, 238] |
p02658 | u157376160 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["N = input()\nA_list = map(int, input().split())\n\nLIMIT = pow(10, 18)\ntotal = 1\n\nif 0 in A_list:\n print('0')\n exit()\n\nfor a in A_list:\n total = total * a\n if total > LIMIT:\n print('-1')\n exit()\nprint(total)", "N = input()\nA_list = [int(e) for e in input().split()]\n\nLIMIT = pow(10, 18)\ntotal = 1\n\nif 0 in A_list:\n print('0')\n exit()\n\nfor a in A_list:\n total = total * a\n if total > LIMIT:\n print('-1')\n exit()\nprint(total)"] | ['Wrong Answer', 'Accepted'] | ['s455270457', 's645261161'] | [19192.0, 21644.0] | [47.0, 52.0] | [230, 238] |
p02658 | u159335277 | 2,000 | 1,048,576 | 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()))\n\ns = 1\nfor x in a:\n s *= x\nif s > 1000000000000000000:\n print(-1)\nelse:\n print(s)', 'import sys\n\nn = input()\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n sys.exit(0)\n\ns = 1\nfor x in a:\n s *= x\n if s > 1000000000000000000:\n break\nif s > 1000000000000000000:\n print(-1)\nelse:\n print(s)\n'] | ['Wrong Answer', 'Accepted'] | ['s955215341', 's067667997'] | [9068.0, 21620.0] | [29.0, 59.0] | [120, 222] |
p02658 | u159369286 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = map(int,input().split())\nans = 1\nfor i in n:\n ans *= i\nif ans > 10**18 :\n ans = -1\nprint(ans)', 'n = int(input())\na = map(int,input().split())\nif 0 in a:\n print(0)\n quit()\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n break\nif ans > 10**18 :\n ans = -1\nprint(ans)', 'n = int(input())\na = [int(i) for i in input().split()]\nif 0 in a:\n print(0)\n quit()\nans = 1\nfor i in a:\n ans *= i\n #print(i)\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s432307107', 's814717955', 's770645723'] | [19232.0, 19360.0, 21640.0] | [35.0, 48.0, 52.0] | [120, 190, 199] |
p02658 | u162911959 | 2,000 | 1,048,576 | 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 \ninf = 10**18\nn = int(input())\nA = list(map(int,input().split()))\nS = np.prod(A)\nif 0 in A:\n\tprint(0)\n break\nif S > inf:\n\tprint("-1")\n\tbreak\nprint(S)', 'import numpy as np \ninf = 10**18\nn = int(input())\nA = list(map(int,input().split()))\nS = np.prod(A)\nif A > inf;\n\tprint("-1")\n else:\n print(S)', 'N = int(input())\n*A, = map(int,input().split())\nmax = 10**18\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor i in range(N):\n ans *= A[i]\n if ans > max:\n print(-1)\n exit()\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s315182200', 's373770522', 's320042213'] | [8956.0, 9028.0, 21768.0] | [20.0, 20.0, 51.0] | [171, 145, 200] |
p02658 | u163353866 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n= int(input())\na= list(map(int,input().split()))\n\nans = 1\n\nfor i in a:\n ans = i * ans\n\n \nif ans > 10**18:\n \tprint (-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(0)\n\nfor i in a:\n ans = i * ans\n if ans > 10**18:\n\tprint(-1)\n exit(0)\n\nprint(ans)', 'n= int(input())\na= list(map(int,input().split()))\n \nans = 1\nover = -1\n \nif 0 in a:\n print(0)\n exit(0)\n\nfor i in a:\n ans = i * ans\n if ans > 10**18:\n\tprint(over)\n exit(0)\n\nprint(ans)', 'n= int(input())\na= list(map(int,input().split()))\n\nans = 1\n\nfor i in a:\n ans = i * ans\n\n \nif ans < 10**18:\n\tprint(ans)\nelse:\n \tprint(-1)', 'n= int(input())\na= list(map(int,input().split()))\n \nans = 1\nover = -1\n \nif 0 in a:\n print(0)\n exit(0)\n\nfor i in a:\n ans = i * ans\n if ans > 10**18:\n print(-1)\n exit(0)\n\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s632440669', 's725528007', 's983738838', 's984746216', 's662960079'] | [9028.0, 9036.0, 9036.0, 21528.0, 21640.0] | [23.0, 23.0, 25.0, 2206.0, 51.0] | [148, 180, 192, 139, 197] |
p02658 | u163971674 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nline=map(int,input().split(" "))\nf=0\nfor i in line:\n if i==0:\n print("0")\n f=1\ng=1\nif f==0:\n for i in line:\n g=g*i\n if g>10**18:\n print("-1")\n f=1\nif f==0:\n print(g)', 'n=int(input())\nline=input().split(" ")\nf=0\nprint(line)\nfor i in line:\n if int(i)==0:\n print("0")\n f=1\n\ng=1\nif f==0:\n for i in line:\n g=g*int(i)\n if g>10**18:\n print("-1")\n f=1\n break\n if f==0:\n print(g)', 'n=int(input())\nline=map(int,input().split(" "))\nfor i in line:\n if i==0:\n print("0")\n return\ng=1\nfor i in line:\n g=g*i\n if g>10**18:\n print("-1")\n return\nprint(g)', 'n=int(input())\nline=input().split(" ")\nf=0\n\nfor i in line:\n if int(i)==0:\n print("0")\n f=1\n\ng=1\nif f==0:\n for i in line:\n g=g*int(i)\n if g>10**18:\n print("-1")\n f=1\n break\n if f==0:\n print(g)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s040063263', 's434893916', 's637365841', 's616477033'] | [19388.0, 23752.0, 9100.0, 19204.0] | [51.0, 71.0, 21.0, 60.0] | [205, 235, 177, 224] |
p02658 | u165318982 | 2,000 | 1,048,576 | 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()\nans = 1\nmax_limit = 10 ** 18\nfor i in range(N):\n ans *= A[i]\n if ans > max_limit:\n ans = -1\n break\n\nif ans > max_limit:\n print(str(-1))\nelse:\n print(str(ans))', 'N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n ans = 0\nelse:\n ans = 1\n max_limit = 10 ** 18\n for i in range(N):\n if ans * A[i] > max_limit:\n ans = -1\n break\n else:\n ans *= A[i]\n\nprint(str(ans))'] | ['Runtime Error', 'Accepted'] | ['s929742718', 's434405461'] | [21672.0, 21628.0] | [52.0, 61.0] | [230, 237] |
p02658 | u166201488 | 2,000 | 1,048,576 | 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()))\nprod = 1\nif 0 in A:\n print(0)\nelse:\n for i in A:\n prod *=i\n if prod > int(1e18):\n print(-1)\n break\n print(prod)', 'import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\nprod = 1\nif 0 in A:\n print(0)\nelse:\n for i in A:\n prod *=i\n if prod > int(1e18):\n print(-1)\n break\n if prod <= int(1e18):\n print(prod)'] | ['Wrong Answer', 'Accepted'] | ['s469106508', 's020594516'] | [40032.0, 39860.0] | [176.0, 144.0] | [232, 258] |
p02658 | u167681994 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\nanswer = 1\nif 0 in A:\n print(0)\n exit()\nfor i in A:\n answer *= i\n if answer > 10**18:\n print(-1)\n break\n else:\n print(answer)\n', 'N = input()\nA = list(map(int, input().split()))\n\nanswer = 1\nif 0 in A:\n print(0)\n break\nelse:\n for i in A:\n answer *= i\n if answer > 10**18:\n print(-1)\n else:\n print(answer)\n', 'N = input()\nA = list(map(int, input().split()))\n\nanswer = 1\nif 0 in A:\n print(0)\nelse:\n for i in A:\n answer *= i\n if answer > 10**18:\n print(-1)\n exit()\n\tprint(answer)', 'N = input()\nA = list(map(int, input().split()))\n\nanswer = 1\nif 0 in A:\n print(0)\nelse:\n for i in A:\n answer *= i\n if answer > 10**18:\n answer = -1\n break\n print(answer)\n \n'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s800949562', 's908167480', 's970201962', 's857365113'] | [21712.0, 9040.0, 8976.0, 21584.0] | [78.0, 31.0, 25.0, 55.0] | [216, 188, 185, 191] |
p02658 | u167874423 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor i in range(num):\n if nums[i] == 0:\n ans = 0\nif ans != 0:\n for i in range(num):\n ans *= nums[i]\n if len(str(ans)) > 18:\n ans = -1\n break\nprint(ans)\n', "num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor j in nums:\n ans = ans * j\nif(len(str(ans))>18):\n print('-1')\nelse:\n print(ans)\n", "num = int(input())\nnums = input()\nans = 1\nerror = -1\nfor i in range(len(nums)):\n if nums[i] != ' ':\n ans = ans * int(nums[i])\nif(len(str(ans))>18):\n print(error)\nelse:\n print(ans)", 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor i in range(num):\n if nums[i] == 0:\n ans = 0\nif ans != 0:\n for j in nums:\n ans *= nums[j]\n if len(str(ans)) > 18:\n ans = -1\n break\nprint(ans)\n', "num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor j in nums:\n ans = ans * j\nif(ans >= pow(10,18)):\n print('-1')\nelse:\n print(ans)\n", 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor i in range(num):\n if nums[i] == 0:\n ans = 0\nif ans != 0:\n for i in range(num):\n ans *= nums[i]\n if len(str(ans)) > 18:\n ans = -1\nprint(ans)\n', 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nerror = -1\nfor j in nums:\n ans = ans * j\nif(len(str(ans))>18):\n print(error)\nelse:\n print(ans)', 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor j in nums:\n ans = ans * j\nif(len(str(ans))>=18):\n print(-1)\nelse:\n print(ans)\n', 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nerror = -1\nfor j in nums:\n ans = ans * j\nif(len(str(ans)) > 18):\n print(error)\nelse:\n print(ans)\n', 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nerror = -1\nfor j in nums:\n ans = ans * j\nif(ans >= pow(10,18)):\n print(error)\nelse:\n print(ans)\n', "num = int(input())\nnums = input()\nans = 1\nfor i in range(len(nums)):\n if nums[i] != ' ':\n ans = ans * int(nums[i])\nif(len(str(ans))>18):\n print('-1')\nelse:\n print(ans)", 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor i in range(num):\n if nums[i] == 0:\n ans = 0\nif ans != 0:\n for j in range(num):\n ans *= nums[j]\n if len(str(ans)) > 18:\n ans = -1\n break\nprint(ans)\n', 'num = int(input())\nnums = list(map(int,input().split()))\nans = 1\nfor i in range(num):\n if nums[i] == 0:\n ans = 0\nif ans != 0:\n for j in nums:\n ans += nums[j]\n if len(str(ans)) > 18:\n ans = -1\n break\nprint(ans)\n', 'num = int(input())\nnums = list(map(int,input().split()))\nnums.sort()\nans = 1\nfor i in nums:\n if i == 0:\n ans = 0\n break\n ans *= i\n if ans > 10 **18:\n ans = -1\n break\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s004376918', 's027704374', 's090884589', 's094430181', 's115903876', 's331902202', 's514767440', 's729839668', 's752882453', 's786007337', 's821110020', 's886804284', 's961420826', 's926993016'] | [21784.0, 21656.0, 12900.0, 21656.0, 21728.0, 21716.0, 21652.0, 21564.0, 21712.0, 21652.0, 12712.0, 21648.0, 21464.0, 21472.0] | [76.0, 2206.0, 507.0, 70.0, 2206.0, 2206.0, 2206.0, 2206.0, 2206.0, 2206.0, 476.0, 73.0, 73.0, 69.0] | [265, 157, 195, 259, 158, 239, 168, 156, 171, 170, 183, 265, 259, 214] |
p02658 | u168391081 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["import math\na,b = input().split()\nn = b.find('.')\nif n > 0:\n bi = int(b[:n])\n bf = int(b[n+1:])\nelse:\n bi,bf = int(b),0\n \nans = str(math.floor(int(a)*(bi*100+bf)))\nN = ans.find('.')\nif N > 0:\n ai = int(ans[:n-2])\nelse:\n ai = int(ans/100)\nprint(ai)", "import math\na,b = input().split()\nn = b.find('.')\nif n > 0:\n bi = int(b[:n])\n bf = int(b[n+1:])\nelse:\n bi,bf = int(b),0\n \nans = str(math.floor(int(a)*(bi*100+bf)))\nN = ans.find('.')\nif N > 0:\n ai = int(ans[:n-2])\nelse:\n ai = int(int(ans)/100)\nprint(ai)", 'import numpy as np\nN = int(input())\nans = np.prod(np.array(range(4,N)))\nif ans > 10**18 or ans == 0:\n ans = -1\nprint(ans)', 'import numpy as np\nN = int(input())\nlist = list(map(int,input().split()))\nans = np.prod(list)\nif ans > 10**18 or ans == 0:\n ans = -1\nif 0 in list:\n ans = 0\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s416807119', 's823646156', 's833153552', 's081013474'] | [9080.0, 9168.0, 31468.0, 40300.0] | [23.0, 22.0, 124.0, 149.0] | [253, 258, 122, 168] |
p02658 | u169200126 | 2,000 | 1,048,576 | 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\nAn = list(map(int, input().split()))\n\nj = 100000000000000000\n\nans = 1\n\nfor i in range(n):\n ans *= An[i]\n\nif ans <= s:\n print(ans)\nelse :\n print('-1')\n", "n = int(input())\n\nAn = list(map(int, input().split()))\n\nj = 100000000000000000\n\nans = 1\n\nfor i in range(n):\n ans *= An[i]\n\nif ans <= j:\n print(ans)\nelse :\n print('-1')\n", '\nn = int(input())\nAn = [int(x) for x in input().split()]\n\nfor i in range(n):\n if An[i] == 0:\n print(0)\n quit()\n\nj = 10 ** 18\nans = 1\nfor i in range(n):\n if ans > j:\n print(-1)\n quit()\n ans *= An[i]\n\nif ans > j :\n print(-1)\n \nelse :\n print(ans)\n\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s507846029', 's819033107', 's098192277'] | [21628.0, 21704.0, 21588.0] | [2206.0, 2206.0, 61.0] | [177, 177, 291] |
p02658 | u171328579 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\nX = 1\nfor i in A:\n X *= i\n\nif X < 10**18:\n print(X)\nelse:\n print(-1)', 'N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\n\nX = 1\nfor i in range(N):\n X *= A[i]\n if X > 10**18:\n print(-1)\n break\nelse:\n print(X)'] | ['Wrong Answer', 'Accepted'] | ['s855994888', 's292628619'] | [21480.0, 21480.0] | [2206.0, 94.0] | [131, 172] |
p02658 | u173494138 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n\n for a in A:\n if a == 0:\n ans = 0\n break:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\n \n print(ans)\n\n\nif __name__ == '__main__':\n main()", "\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n\n for a in A:\n if a == 0:\n ans = 0\n break\n elif ans < 10**18:\n ans *= a\n \n if ans > 10**18:\n print(-1)\n else:\n print(ans)\n\n\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s149920280', 's142262179'] | [9024.0, 21608.0] | [25.0, 51.0] | [349, 324] |
p02658 | u177182853 | 2,000 | 1,048,576 | 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\nfrom collections import deque, defaultdict, Counter\nfrom itertools import accumulate, product, permutations, combinations\nfrom operator import itemgetter\nfrom bisect import bisect_left, bisect_right\nfrom heapq import heappop, heappush\nfrom math import ceil, floor, sqrt, gcd, inf\nfrom copy import deepcopy\nimport numpy as np\nimport scipy as sp\n\nINF = inf\nMOD = 1000000007\n\nn = int(input())\nA = [int(i) for i in input().split()]\n\ntmp = 0\nres = 1\n\nA = sorted(A)\nfor i in range(n):\n res *= A[i]\n if res >= 10 ** 18:\n res = -1\n break\n if res == 0:\n break\n\nprint(res)\n', 'import sys\nfrom collections import deque, defaultdict, Counter\nfrom itertools import accumulate, product, permutations, combinations\nfrom operator import itemgetter\nfrom bisect import bisect_left, bisect_right\nfrom heapq import heappop, heappush\nfrom math import ceil, floor, sqrt, gcd, inf\nfrom copy import deepcopy\nimport numpy as np\nimport scipy as sp\n\nINF = inf\nMOD = 1000000007\n\nn = int(input())\nA = [int(i) for i in input().split()]\n\ntmp = 0\nres = 1\n\nA = sorted(A)\nfor i in range(n):\n res *= A[i]\n if res > 10 ** 18:\n res = -1\n break\n if res == 0:\n break\n\nprint(res)\n'] | ['Wrong Answer', 'Accepted'] | ['s007776807', 's573494052'] | [43656.0, 43700.0] | [185.0, 186.0] | [604, 603] |
p02658 | u177402465 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nans = 1;\ntem = 0\nok = 1\ns = input().split()\nfor i in s:\n if(int(i) == 0):\n tem = 1\n break\n ans *= int(i) \n if(ans > 10**18):\n ok = 0\nif(tem):\n print(0)\nelif(ok)\n print(ans)\nelse:\n print("-1")\n', 'n = int(input())\nans = 1;\ntem = 0\nok = 1\ns = input().split()\nfor i in s:\n if(int(i) == 0):\n tem = 1\n break\n if(ok == 1):\n ans *= int(i) \n if(ans > 10**18):\n ok = 0\nif(tem):\n print(0)\nelif(ok):\n print(ans)\nelse:\n print("-1")\n'] | ['Runtime Error', 'Accepted'] | ['s013533817', 's414949749'] | [9040.0, 19532.0] | [29.0, 73.0] | [248, 278] |
p02658 | u178007715 | 2,000 | 1,048,576 | 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=[]\narr=list(map(int,input().split()))\nmul=1\nfor i in range(n):\n mul*=arr[i]\n if(mul>1000000000000000000):\n print("-1")\n return\nprint(mul)\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nans=1\nfor i in a:\n ans*=i\n if ans>10**18:\n ans=-1\n break\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s730238914', 's830464346'] | [9108.0, 21620.0] | [24.0, 88.0] | [165, 145] |
p02658 | u178079174 | 2,000 | 1,048,576 | 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 print(-1)\n exit()\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s218890248', 's213737740'] | [21584.0, 21708.0] | [51.0, 50.0] | [160, 194] |
p02658 | u179304833 | 2,000 | 1,048,576 | 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()))\nprint(np.prod(A) if np.prod(A)<10**18 else -1)', 'n=int(input())\nA=list(map(int,input().split()))\nans=1\nfor i in range(n):\n if A[i]==0:\n print(0)\n exit()\nfor i in range(n):\n #if len(str(A[i]))>19:\n # print(-1)\n # exit()\n ans*=A[i]\n if ans>10**18:\n print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s990288980', 's323465124'] | [39840.0, 21800.0] | [153.0, 54.0] | [113, 246] |
p02658 | u180172332 | 2,000 | 1,048,576 | 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\ninput_num = input()\ninput_list = input()\n \ntotal_pow = 1\nfor num in input_list.split(" "):\n total_pow *= int(num)\n if total_pow > 10**18:\n \tif "0" in input_list.split(" "):\n print("0")\n else:\n print("-1")\n \tsys.exit()\nprint(total_pow)', 'import sys\ninput_num = input()\ninput_list = input()\n \ntotal_pow = 1\nfor num in input_list.split(" "):\n total_pow *= int(num)\n if total_pow > 10**18:\n \tif "0" in input_list.split(" "):\n print("0")\n else:\n print("-1")\n \tsys.exit()\n\nprint(total_pow)\n', 'input_num = input()\ninput_list = input()\n\ntotal_pow = 1\n[total_pow*=int(num) for num in input_list.split(" ")]\n\nif total_pow > 10**18:\n print("-1")\nelse:\n print(total_pow)', 'import sys\ninput_num = input()\ninput_list = input()\n \ntotal_pow = 1\nfor num in input_list.split(" "):\n total_pow *= int(num)\n if total_pow > 10**18:\n if "0" in input_list.split(" "):\n print("0")\n else:\n print("-1")\n sys.exit()\n\nprint(total_pow)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s080789951', 's185112355', 's618536903', 's076489631'] | [8964.0, 8984.0, 9008.0, 28708.0] | [23.0, 23.0, 23.0, 44.0] | [262, 264, 173, 294] |
p02658 | u180824420 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nN=int(input())\nA=np.ones(N)\na=np.ones(N)\n\nA=map(int,input().rstrip().split())\n\n\na=sorted(A,reverse=True)\n\na_product=1\nflag_1e18=False\nflag_0=False\n\nif a[N-1]==0:\n flag_0=True\n\nfor i in range(0,N,1):\n a_product=a_product*a[i]\n if a_product>1e18:\n flag_1e18=True\n break\n else:\n continue\n \nif flag_1e18==True and flag_0==False:\n print(-1)\nelif flag_0==True:\n print(0)\nelse:\n print(A_product)\n \n', 'import numpy as np\n\nN=int(input())\nA=np.ones(N)\na=np.ones(N)\n\nA=map(int,input().rstrip().split())\n\n\na=sorted(A,reverse=True)\n\na_product=1\nflag_1e18=False\nflag_0=False\n\nif a[N-1]==0:\n flag_0=True\n\nfor i in range(0,N,1):\n a_product=a_product*a[i]\n if a_product>1e18:\n flag_1e18=True\n else:\n continue\n \nif flag_1e18==True and flag_0==False:\n print(-1)\nelif flag_0==True:\n print(0)\nelse:\n print(A_product)\n \n', 'import numpy as np\n\nN=int(input())\nA=np.ones(N)\na=np.ones(N)\n\nA=map(int,input().rstrip().split())\n\n\na=sorted(A,reverse=True)\n\na_product=1\nflag_1e18=False\nflag_0=False\n\nif a[N-1]==0:\n flag_0=True\n\nfor i in range(0,N,1):\n a_product=a_product*a[i]\n if a_product>1e18:\n flag_1e18=True\n break\n else:\n continue\n \nif flag_1e18==True and flag_0==False:\n print(-1)\nelif flag_0==True:\n print(0)\nelse:\n print(a_product)\n \n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s043205858', 's740397153', 's724316437'] | [40788.0, 41148.0, 40932.0] | [163.0, 2207.0, 160.0] | [431, 421, 431] |
p02658 | u183158695 | 2,000 | 1,048,576 | 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 if any(j == 0 for j in A) == True:\n print(0)\n break\n ans *= A[i]\n i += 1\n if ans > 10**18:\n print('-1')\n break\n if i == N-1:\n print(ans)", 'N = int(input())\nA = list(map(int,input().split()))\n\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for i in A:\n ans *= A\n i += 1\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\n\nans = 1\nif any(j == 0 for j in A) == True:\n ans = 0\nelse:\n for i in A:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s296027512', 's680002263', 's660371630'] | [22372.0, 21628.0, 21436.0] | [2206.0, 55.0, 57.0] | [238, 186, 200] |
p02658 | u183657342 | 2,000 | 1,048,576 | 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\nimport math\n\nn = int(input())\nA = list(map(int, input().split()))\nans = np.prod(A)\nl = int(math.log10(ans)+1)\nif l >= 18:\n print(-1)\nelse:\n print(int(ans))\n ', 'n = int(input())\nA = list(map(int, input().split()))\nans = 1\ncount = 0\nif 0 in A:\n print(0)\nelse:\n for i in range(n):\n ans *= A[i]\n if ans > 10**18:\n count = 1\n print(-1)\n break\n if count == 0:\n print(ans)\n '] | ['Runtime Error', 'Accepted'] | ['s116284445', 's782029868'] | [40308.0, 21656.0] | [144.0, 55.0] | [185, 277] |
p02658 | u184661160 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\n\ndef dict_sort(ans):\n ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))\nflag=[0]*1000002\ndef seive_primes():\n flag[0]=flag[1]=1\n i=2\n while i*i<=1000000:\n if flag[i]==0:\n j=i*i\n while j<=1000000:\n flag[j]=1\n j+=i\n i+=1\ndef sqr(n):\n return n*n\ndef inp():\n ls=list(map(int,input().split()))\n return ls\nls=inp()\nif math.prod(ls)>10e18:\n print(-1)\nelse:\n print(math.prod(ls))\n', 'import math\n\ndef dict_sort(ans):\n ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))\nflag=[0]*1000002\ndef seive_primes():\n flag[0]=flag[1]=1\n i=2\n while i*i<=1000000:\n if flag[i]==0:\n j=i*i\n while j<=1000000:\n flag[j]=1\n j+=i\n i+=1\ndef sqr(n):\n return n*n\ndef inp():\n ls=list(map(int,input().split()))\n return ls\nls=inp()\nans=1\nfor i in ls:\n ans*=i\n if ans>10e18:\n print(-1)\n exit(0)\nprint(ans)\n', 'import math\n\ndef dict_sort(ans):\n ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))\nflag=[0]*1000002\ndef seive_primes():\n flag[0]=flag[1]=1\n i=2\n while i*i<=1000000:\n if flag[i]==0:\n j=i*i\n while j<=1000000:\n flag[j]=1\n j+=i\n i+=1\ndef sqr(n):\n return n*n\ndef inp():\n ls=list(map(int,input().split()))\n return ls\nN=int(input())\nls=inp()\nif 0 in ls:\n print(0)\n exit(0)\nans=1\nfor i in ls:\n ans*=i\n if ans>1000000000000000000:\n print(-1)\n exit(0)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s283934332', 's305809806', 's247253388'] | [16628.0, 16620.0, 30380.0] | [36.0, 37.0, 66.0] | [516, 540, 606] |
p02658 | u185948224 | 2,000 | 1,048,576 | 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 a in A:\n ans *= a\n if ans * a <= 10**18:\n ans *= a\n else: ans = 10**18 + 1\n \nprint(ans if ans <= 10**18 else -1)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n ans = 10**18 + 1\n \nprint(ans if ans <= 10**18 else -1)'] | ['Wrong Answer', 'Accepted'] | ['s921693590', 's467496718'] | [21636.0, 21700.0] | [68.0, 65.0] | [200, 176] |
p02658 | u185966380 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | [' \nN = int(input())\nA_list = list(map(int, input().split()))\n\nans = 1\nfor l in A_list:\n\n ans *= l\n\nif ans >= (10**18):\n ans = -1\nprint(ans)', 'def multi(L):\n ans = 1\n for l in L:\n if ans <= (10**18):\n ans *= l\n print(ans)\n else:\n ans = -1\n break\n return ans\n \nN = int(input())\nA_list = list(map(int, input().split()))\n\nprint(multi(A_list))', 'def multi(L):\n ans = 0\n for l in L:\n \tif ans <=10**18:\n ans *= l\n else:\n ans = -1\n break\n \n return ans\n\nN = int(input())\nA_list = list(map(int, input().split()))\n\nprint(multi(A_list))\n ', ' \nN = int(input())\nA_list = list(map(int, input().split()))\n\nans = 1\nif 0 in A_list:\n ans = 0\nelse:\n for l in A_list:\n\n if ans > (10**18):\n ans = -1\n break\n else:\n ans *= l\n\nif ans > (10**18):\n ans = -1\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s177257412', 's504372708', 's825444524', 's663225908'] | [21620.0, 21472.0, 9036.0, 21648.0] | [2206.0, 65.0, 23.0, 50.0] | [144, 263, 216, 269] |
p02658 | u187462782 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = input()\nA = [int(x) for x in input().split()]\nproduct = 1\n\nfor a in A:\n product *= a\n if a = 0:\n break\n\nprint(product if product <= 10**18 else -1)\n', 'n = input()\nA = sorted([int(x) for x in input().split()])\n\nproduct = 1\nfor a in A:\n product *= a\n if a == 0:\n break\n if product <= 10**18:\n product = -1\n break\n\nprint(product)\n', 'import sys\n\nn = input()\nA = sorted([int(x) for x in input().split()], reverse=True)\n\nif A[-1] == 0:\n print(0)\n sys.exit()\n\nproduct = 1\nfor a in A:\n product *= a\n if product > 10**18:\n product = -1\n break\n\nprint(product)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s402873753', 's841136355', 's522045519'] | [9028.0, 21768.0, 21536.0] | [21.0, 84.0, 80.0] | [165, 206, 246] |
p02658 | u187883751 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n break\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n\nelse:\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n break\n\nans = 1\nfor i in a:\n ans *= a\n if ans > 10**18:\n print(-1)\n break\n\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n break\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n\nprint(ans)\n', 'n = int(input())\na = sorted(map(int, input().split()))\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n\nelse:\n print(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s437279411', 's572260928', 's680320264', 's045028220'] | [8768.0, 9004.0, 9072.0, 21624.0] | [23.0, 27.0, 24.0, 92.0] | [177, 171, 171, 152] |
p02658 | u187995923 | 2,000 | 1,048,576 | 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(e) for e in input().split()]\nans = 1\nif 0 in a:\n print(0)\nelse:\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n break \nelse:\n print(ans)', 'n = int(input())\na = [int(e) for e in input().split()]\nans = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10:\n print(-1)\n break \n else:\n print(ans)', 'n = int(input())\na = [int(e) for e in input().split()]\nans = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n break \n else:\n print(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s768733053', 's868363788', 's405188995'] | [9020.0, 21572.0, 21792.0] | [25.0, 53.0, 53.0] | [203, 227, 231] |
p02658 | u188138642 | 2,000 | 1,048,576 | 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())\nAs = list(map(int,input().split()))\n\nsum = np.prod(np.asarray(As))\nsum = sum if sum<10**18 else -1\nprint(sum)', 'N = int(input())\nAs = list(map(int,input().split()))\nsum = 1\nif 0 in As:\n print(0)\n exit()\nfor i in As:\n sum *=i\n if sum>10**18:\n sum = -1\n break\nprint(sum)'] | ['Wrong Answer', 'Accepted'] | ['s171646698', 's201949610'] | [40064.0, 21604.0] | [138.0, 49.0] | [145, 182] |
p02658 | u188848640 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nl = list(map(int,input().split()))\ns = 1\nf = 1\nx = 1000000000000000000\nfor i in l:\n\ts *= i\n\tif s>x:\n print(-1)\n f = 0\n break\nif f==1:\n print(s)', 'n = int(input())\nl = list(map(int,input().split()))\ns = 1\nf = 1\nx = 1000000000000000000\nfor i in l:\n\ts *= i\n\tif s>x:\n \tf = 0\n \t\tprint(-1)\n break\nif f==1:\n print(s)', 'n = int(input())\nl = list(map(int,input().split()))\ns = 1\nf = 1\nx = 1000000000000000000\nl.sort()\nif l[0]==0:\n print(0)\nelif l[0]==1 and l[-1]==1:\n print(1)\nelse:\n l = l[::-1]\n for i in l:\n s *= i\n if s>x:\n print(-1)\n f = 0\n break\n if f==1:\n print(s)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s129613925', 's144111239', 's490596842'] | [9028.0, 9028.0, 21788.0] | [22.0, 24.0, 78.0] | [176, 177, 294] |
p02658 | u189023301 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nlis = list(map(int, input().split()))\nres = 1\nfor i in lis:\n if res > 10**18:\n res = 10**18 + 1\n else:\n res *= i\nprint(res if res < 10**18 else -1)\n', 'n = int(input())\nlis = list(map(int, input().split()))\n\nif 0 in lis:\n print(0)\n exit()\n\nres = 1\nfor i in lis:\n if res > 10**18:\n print(-1)\n exit()\n else:\n res *= i\nprint(res if res <= 10**18 else -1)\n'] | ['Wrong Answer', 'Accepted'] | ['s224663492', 's965323724'] | [21580.0, 21664.0] | [55.0, 50.0] | [185, 233] |
p02658 | u189056821 | 2,000 | 1,048,576 | 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 = np.array(list(map(int, input().split())))\nans = np.prod(A)\nif ans >= 10e17:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nflag = 0\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for a in A:\n ans *= a\n if ans > 10**18:\n flag = 1\n break\n if flag == 0:\n print(ans)\n else:\n print(-1)'] | ['Wrong Answer', 'Accepted'] | ['s514054797', 's945740661'] | [39952.0, 21648.0] | [135.0, 52.0] | [150, 267] |
p02658 | u189089176 | 2,000 | 1,048,576 | 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()\nnums=list(map(int,input().split()))\n\nans = 1\nover = 10**18\n\nfor num in nums:\n ans = ans * num\n if ans >= over:\n print(-1)\n exit()\n\nprint(ans)\n', 'n=input()\nnums=list(map(int,input().split()))\n\nif 0 in nums:\n print(0)\n exit()\n\n\nans = 1\nover = 10**18\n\nfor num in nums:\n ans = ans * num\n\n if ans > over:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s300586916', 's977874799'] | [21632.0, 21636.0] | [47.0, 50.0] | [172, 212] |
p02658 | u189487046 | 2,000 | 1,048,576 | 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 A.count(0) <= 1:\n print(0)\n exit(0)\n\nL = 10**18\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n if ans > L:\n print(-1)\n exit(0)\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nif A.count(0) >= 1:\n print(0)\n exit(0)\n\nL = 10**18\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n if ans > L:\n print(-1)\n exit(0)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s061912382', 's143230783'] | [21476.0, 21712.0] | [51.0, 52.0] | [221, 221] |
p02658 | u189901251 | 2,000 | 1,048,576 | 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())\nar = map(int,input.split())\nmul = 1\nfor i in ar:\n mul*=i\n if mul>1000000000000000000:\n break\nif mul>1000000000000000000:\n print(-1)\nelse:\n print(mul)', 'n = input()\nar = map(int,input().split())\nar = list(ar)\nmul=1\nar=sorted(ar)\n\nfor i in ar:\n\tmul*=i\n\tif mul>10**18:\n\t\tbreak\nif mul>10**18:\n\tprint(-1)\nelse:\n\tprint(mul)\n'] | ['Runtime Error', 'Accepted'] | ['s693919417', 's873121231'] | [9180.0, 21772.0] | [23.0, 88.0] | [173, 166] |
p02658 | u190178779 | 2,000 | 1,048,576 | 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())\narray = list(map(int,input().split()))\n\nif not ( 2 <= N <= 10**5 ): sys.exit()\nif not ( 0 <= min(array) and max(array) <= 10**18): sys.exit()\n\nsum = array[0]\nfor I in range(1,len(array)):\n sum *= array[I]\n if sum >= 10**18: print(-1);sys.exit()\nprint(sum)', 'import sys\nN = int(input())\narray = list(map(int,input().split()))\n\nif not ( 2 <= N <= 10**5 ): sys.exit()\nif not ( 0 <= min(array) and max(array) <= 10**18): sys.exit()\nif 0 in array: print(0); sys.exit()\n\nsum = array[0]\nfor I in range(1,len(array)):\n sum *= array[I]\n if sum >= 10**18: print(-1);sys.exit()\nprint(sum)', 'import sys\nN = int(input())\narray = list(map(int,input().split()))\n\nif not ( 2 <= N <= 10**5 ): sys.exit()\nif not ( 0 <= min(array) and max(array) <= 10**18): sys.exit()\nif 0 in array: print(0); sys.exit()\n\nsum = array[0]\nfor I in range(1,len(array)):\n sum *= array[I]\n if sum > 10**18: print(-1);sys.exit()\nprint(sum)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s682437229', 's697455260', 's787081274'] | [21544.0, 21492.0, 21688.0] | [61.0, 61.0, 60.0] | [289, 325, 324] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.