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 | u274005011 | 2,000 | 1,048,576 | 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 = input()\n\nstr_list = list(input().split())\n\nP = np.prod(str_list)\n\nif P > 10 ** 18:\n\tprint(-1)\nelse:\n\tprint(P)', 'n = int(input())\nA = input().split()\nA.sort()\n\ns = 1\nfor i in range(n):\n\ts*= int(A[i])\n\tif s > 10**18:\n\t\tprint(-1)\n\t\texit()\n\nprint(s)'] | ['Runtime Error', 'Accepted'] | ['s383685921', 's901585352'] | [51980.0, 19316.0] | [145.0, 92.0] | [133, 133] |
p02658 | u274841648 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = 10**5\na = [i+1 for i in range(n)]\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n else:\n print(ans)', 'n = int(input())\na = [int(i) for i in input().split()]\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\n else:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s481427246', 's256716860'] | [12896.0, 21640.0] | [32.0, 57.0] | [206, 223] |
p02658 | u275414471 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['def main():\nN = int(input())\nA = list(map(int, input().split()))\nSUM = 1\n\nif 0 in A:\n print(0)\n return\n\nfor a in A:\n SUM = SUM * a\n if SUM > 1000000000000000000:\n print(-1)\n return\n\n print(SUM)\n\nmain()', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n SUM = 1\n\n if 0 in A:\n print(0)\n return\n\n for a in A:\n SUM = SUM * a\n if SUM > 1000000000000000000:\n print(-1)\n return\n\n print(SUM)\nmain()'] | ['Runtime Error', 'Accepted'] | ['s362634513', 's119187153'] | [8980.0, 21488.0] | [23.0, 55.0] | [230, 273] |
p02658 | u275885859 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=input()\nx=input.split()\nprod=1\nfor i in x:\n prod=prod*i\n if prod>1000000000000000000:\n break\nif prod>1000000000000000000:\n print(-1)\nelse:\n print(prod)', 'n=input()\nx=[int(i) for i in input().split()]\nx.sort()\nprod=1\nfor i in x:\n prod=prod*i\n if prod>1000000000000000000:\n break\nif prod>1000000000000000000:\n print(-1)\nelse:\n print(prod)'] | ['Runtime Error', 'Accepted'] | ['s242776690', 's361089452'] | [9104.0, 21624.0] | [25.0, 95.0] | [160, 189] |
p02658 | u276686572 | 2,000 | 1,048,576 | Given N integers 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\narr = input().split()\ncount = 1\nif "0" in arr:\n count = 0\nelse: for i in arr:\n count *= int(i)\n if count > 1000000000000000000: count = -1\n \nprint(count)\n', 'n = int(input())\n\narr = input().split()\ncount = 1\nfor i in range(0, n):\n count *= int(arr[i])\n \nif count > 10^18: count = -1\n \nprint(count)', 'n = int(input())\narr = list(map(int, input().split()))\nif 0 in arr: print(0)\nelse:\n\tprod = 1\n\tfor i in arr:\n\t\tcount *= i\n\tif count > 1000000000000000000: count = -1\n\tprint(count)', 'n = int(input())\narr = input().split()\ndef mult():\n\tif 0 in arr:\n \t\tprint(0)\n return 0\n a = 1\n for i in arr:\n a = a * i\n if a > 1000000000000000000:\n print(-1)\n return 0\n else: \n print(a)\n return 0\n\nmult()', 'n = int(input())\narr = input().split()\n\n\ndef mult():\n if "0" in arr:\n return 0\n else:\n a = 1\n for i in arr:\n a = a * int(i)\n if a > 1000000000000000000:\n return -1\n return a\n\nprint(mult())\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s508542970', 's602932086', 's700000767', 's971606094', 's091969911'] | [8944.0, 19424.0, 21712.0, 8832.0, 19296.0] | [29.0, 2206.0, 54.0, 25.0, 50.0] | [186, 142, 178, 250, 260] |
p02658 | u277060039 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\'\'\'\n\n Online Python Compiler.\n Code, Compile, Run and Debug python program online.\nWrite your code in this editor and press "Run" button to execute it.\n\n\'\'\'\n\nn = int(input()) \n \na = list(map(int,input().strip().split()))[:n] \nx=1\nflag=0\nfor i in range(n):\n x*=a[i]\n if a[i]==0:\n x*=0\n break\n if x>1000000000000000000:\n flag=1\n else:\n x*=a[i]\n \n\nif x==0:\n print(0)\nelif flag==1:\n print(-1)\nelse:\n print(x)\n \n', '\'\'\'\n\n Online Python Compiler.\n Code, Compile, Run and Debug python program online.\nWrite your code in this editor and press "Run" button to execute it.\n\n\'\'\'\n\nn = int(input()) \n \na = list(map(int,input().strip().split()))[:n] \nx=1\nflag=0\nfor i in range(n):\n x*=a[i]\n if a[i]==0:\n x*=0\n break\n if x>1000000000000000000:\n flag=1\n else:\n x*=a[i]\n \n\n \nif flag==1:\n print(-1)\nelse:\n print(x)\n \n', '\'\'\'\n\n Online Python Compiler.\n Code, Compile, Run and Debug python program online.\nWrite your code in this editor and press "Run" button to execute it.\n\n\'\'\'\n\nn = int(input()) \n \na = list(map(int,input().strip().split()))[:n] \nx=1\nflag=0\nflag1=0\nfor i in range(n):\n if a[i]==0:\n x*=0\n flag1=1\n break\nif flag!=1: \n for i in range(n):\n x*=a[i]\n if x>1000000000000000000:\n flag=1\n else:\n x*=a[i]\n \n\nif flag1==1:\n print(0)\nelif flag==1:\n print(-1)\nelse:\n print(x)\n \n', '\'\'\'\n\n Online Python Compiler.\n Code, Compile, Run and Debug python program online.\nWrite your code in this editor and press "Run" button to execute it.\n\n\'\'\'\n\nn = int(input()) \n \na = list(map(int,input().strip().split()))[:n] \nx=1\nflag=0\nflag1=0\nfor i in range(n):\n if a[i]==0:\n x*=0\n flag1=1\n break\nif flag!=1: \n for i in range(n):\n if x*a[i]>1000000000000000000:\n flag=1\n break\n else:\n x*=a[i]\n \nif flag1==1:\n print(0)\nelif flag==1:\n print(-1)\nelse:\n print(x)\n \n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s167835139', 's494593772', 's761352054', 's363255503'] | [21788.0, 21708.0, 21644.0, 21636.0] | [2206.0, 2206.0, 2206.0, 72.0] | [509, 490, 593, 599] |
p02658 | u277429554 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['# 169 B\n\nimport math\nn = int(input())\na = list(map(int, input().split()))\np = 1\nx = True\n\np = math.product(a)\nif p > (10 ** 18):\n x = False\n\n\nif x == True:\n print(p)\nelse:\n print(-1)\n ', '# 169 B\n\nn = int(input())\nl = list(map(int, input().split()))\n\ndef code(a):\n pro = 1\n if 0 in a:\n print(0)\n else:\n for i in a:\n pro *= i\n if pro > (10 ** 18):\n print(-1)\n return\n print(pro)\n\ncode(l)'] | ['Runtime Error', 'Accepted'] | ['s884796858', 's578608101'] | [21748.0, 21652.0] | [56.0, 58.0] | [200, 280] |
p02658 | u278260569 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nk = 1\nfor i in range(N):\n k = k * A[i]\n\nif k >= 10 ** 18: \n print(-1)\nelse:\n print(k)', 'N = int(input())\nA = list(map(int,input().split()))\nif A.count(0) == 0:\n \n k = 1\n for i in range(N):\n k = k * A[i]\n if k >= 10 ** 18:\n k = -1\n break\nelse:\n k = 0\nprint(k)', 'N = int(input())\nA = list(map(int,input().split()))\nk = 1\nfor i in range(N):\n k = k * A[i]\n if k >= 10 ** 18:\n k = -1\n break\n \nprint(k)', 'import numpy as np\nN = int(input())\nA = np.array(list(map(int,input().split())))\np = np.prod(A)\nif p >= 10 ** 18:\n print(-1)\nelse:\n print(p)', 'N = int(input())\nA = list(map(int,input().split()))\nif A.count(0) == 0:\n \n k = 1\n for i in range(N):\n k = k * A[i]\n if k >= 10 ** 18 + 1:\n k = -1\n break\nelse:\n k = 0\nprint(k)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s122116281', 's167518478', 's258580361', 's396737538', 's920474567'] | [21772.0, 21788.0, 21648.0, 40092.0, 21640.0] | [2206.0, 49.0, 51.0, 142.0, 53.0] | [152, 218, 162, 146, 222] |
p02658 | u279266699 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nn = int(input())\na = list(map(int, input().split()))\nans = np.prod(np.array(a))\n\nif ans >= 10 ** 18:\n print(-1)\nelse:\n print(ans)\n', 'n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s981409149', 's882421001'] | [40032.0, 21520.0] | [135.0, 59.0] | [156, 188] |
p02658 | u279570066 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA =[i for i in map(int, input().split())]\n\nif a.count(0) != 0:\n print(0)\nelse:\n result = 1\n for i in range(N):\n result *= A[i]\n if result > (10**18):\n print(-1)\n break\n else:\n continue\nprint(result)', 'N =input()\nA = (map(int, input().split()))\n\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n ', 'N = int(input())\nA =[i for i in map(int, input().split())]\n\nif a.count(0) != 0:\n print(0)\nelse:\n result = 1\n for i in range(N):\n result *= A[i]\n if result > (10**18):\n print(-1)\n break\n else:\n continue\n else:\n print(result)', 'N =input()\nA = map(int, input().split())\n \nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', 'N = int(input())\nA =[i for i in map(int, input().split())]\n\nresult = 1\nfor i in range(n):\n result *= a[i]\n if result > (10**18):\n print(-1)\n break\n else:\n continue\nprint(result)', 'N =int(input())\nA = map(int, input().split())\n \nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\na = [i for i in map(int, input().split())]\n\nif a.count(0) != 0:\n print(0)\nelse:\n result = 1\n for i in range(n):\n result *= a[i]\n if result > (10**18):\n print(-1)\n break\n else:\n continue\n else:\n print(result)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s226624840', 's269843381', 's386938016', 's511936714', 's578230448', 's612332116', 's850334129'] | [21660.0, 19172.0, 21648.0, 19120.0, 21768.0, 19340.0, 21616.0] | [54.0, 41.0, 55.0, 39.0, 58.0, 38.0, 56.0] | [278, 136, 296, 132, 207, 137, 297] |
p02658 | u279735925 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nAn = list(map(int, input().split()))\nsum = 1\nfor i in range(N):\n sum *= An[i]\n if sum > 1e18:\n print(-1)\n quit()\n else sum == 0:\n print(0)\n quit()\nprint(sum)', 'N = int(input())\nAn = list(map(int, input().split()))\nsum = 1\nmax = 10 ** 18\nif 0 in An:\n print(0)\n quit()\nfor i in range(N):\n sum *= An[i]\n if sum > max:\n print(-1)\n quit()\nprint(sum)'] | ['Runtime Error', 'Accepted'] | ['s003887973', 's926655484'] | [8916.0, 21472.0] | [22.0, 49.0] | [189, 194] |
p02658 | u279810362 | 2,000 | 1,048,576 | 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 as mt\nN = int(input())\nnum = list(map(int, input().split()))\nanswer = 1\nfor i in range(len(num)):\n if answer*num[i] < 10**18:\n answer = answer*num[i]\n if i == len(num)-1:\n print(answer)\n else:\n print(-1)\n break', 'import numpy as np\nimport math as mt\nN = int(input())\nnum = list(map(int, input().split()))\nans = np.prod(num)\nif ans != 0:\n if mt.log10(ans) - 18 > 0:\n print(ans)\n else:\n print(-1)\nelse:\n print(0)', 'import numpy as np\nimport math as mt\nN = int(input())\nnum = list(map(int, input().split()))\nans = np.prod(num)\nif ans != 0:\n if mt.log10(ans) - 10**18 > 0:\n print(ans)\n else:\n print(-1)\nelse:\n print(0)', 'N = int(input())\nnum = list(map(int, input().split()))\nans = num.prod()', 'import numpy as np\nimport math as mt\nN = int(input())\nnum = list(map(int, input().split()))\nans = np.prod(num)\nif ans != 0:\n if mt.log10(ans) <8:\n print(ans)\n else:\n print(-1)\nelse:\n print(0)', 'N = int(input())\nnum = list(map(int, input().split()))\nanswer = 1\nif 0 in num:\n print(0)\nelse:\n for i in range(N):\n if answer*num[i] <= 10**18:\n answer = answer*num[i]\n if i == N-1:\n print(answer)\n else:\n print(-1)\n break'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s136772464', 's259546027', 's299685819', 's514862457', 's582159643', 's243288569'] | [40136.0, 40348.0, 40084.0, 21592.0, 40236.0, 21480.0] | [158.0, 142.0, 150.0, 51.0, 137.0, 64.0] | [260, 206, 210, 71, 204, 256] |
p02658 | u281152316 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nx = 1\nif A in 0:\n x = 0\nelse:\n for i in range(N):\n x *= A[i]\n if x > 10**18:\n x = -1\n break\nprint(x)\n', 'N = int(input())\nA = list(map(int,input().split()))\nx = 1\nif 0 in A:\n x = 0\nelse:\n for i in range(N):\n x *= A[i]\n if x > 10**18:\n x = -1\n break\nprint(x)\n'] | ['Runtime Error', 'Accepted'] | ['s230934477', 's239810805'] | [21628.0, 21624.0] | [56.0, 60.0] | [195, 195] |
p02658 | u281796054 | 2,000 | 1,048,576 | Given N integers 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 = map(int,input().split())\nans = 1\nif 0 in k:\n ans = 0\nfor i in range(n):\n if ans == 0:\n break\n ans *= k[i]\n if ans > 10**18:\n ans == -1\n ', 'n = int(input())\nk = list(map(int,input().split()))\nans = 1\nif 0 in k:\n ans = 0\nfor i in range(n):\n if ans == 0:\n break\n ans *= k[i]\n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)\nprint(k)', 'n = int(input())\nk = list(map(int,input().split()))\nans = 1\nif 0 in k:\n ans = 0\nfor i in range(n):\n if ans == 0:\n break\n ans *= k[i]\n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s368921039', 's707561201', 's326700259'] | [19492.0, 21652.0, 21640.0] | [48.0, 58.0, 51.0] | [168, 203, 195] |
p02658 | u282813849 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0', 'N = int(input())\nS = list(map(int,input().split()))\nt = 10**18\nans = 1\n\nif 0 in S:\n print(0)\n exit(0)\n \nfor n in S:\n ans *= n\n if ans > t:\n print(-1)\n exit(0)\n \nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s915652148', 's106487219'] | [8972.0, 21620.0] | [28.0, 56.0] | [64, 183] |
p02658 | u282908818 | 2,000 | 1,048,576 | 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 = [int(i) for i in input().split()]\n\nmultiple = np.prod(A)\nif multiple >= 10 ** 18:\n print(-1)\nelse:\n print(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\nmultiple = 1\n\nA.sort\nfor i in range(N):\n if A[i] == 0:\n multiple = 0\n break\n else:\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n multiple = -1\n break\n\nprint(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\n\nif 0 in A:\n multiple = 0\nelse:\n multiple = 1\n for i in range(N):\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n multiple = -1\n break\n print(multiple)', "import numpy as np\n\nN=int(input())\nA = [int(i) for i in input().split()]\n\nmultiple = np.prod(A)\nif multiple >= 10 ** 18:\n print('-1')\nelse:\n print(multiple)", 'N=int(input())\nA = [int(i) for i in input().split()]\n\nA.sort()\nif 0 in A:\n multiple = 0\nelse:\n multiple = 1\n for i in range(N):\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n multiple = -1\n break\n print(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\n\nif 0 in A:\n print(0)\n exit()\n\nmultiple = 1\nfor i in range(N):\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n multiple = -1\n print(-1)\n exit()\n\nprint(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\n\nA.sort()\nif 0 in A:\n multiple = 0\nelse:\n multiple = 1\n for i in range(N):\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n multiple = -1\n break\n\nprint(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\nmultiple = 1\n\nfor i in range(N):\n if A[i]==0:\n break\n multiple = multiple * A[i]\n if (multiple > 18 ** 10):\n break\n \nif multiple > 10 ** 18:\n print(-1)\nelse:\n print(multiple)', 'N=int(input())\nA = [int(i) for i in input().split()]\n\nif 0 in A:\n multiple = 0\nelse:\n multiple = 1\n for i in range(N):\n multiple = multiple * A[i]\n if multiple > 1000000000000000000:\n multiple = -1\n break\n\nprint(multiple)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s038078449', 's123875517', 's158853204', 's341766541', 's637821148', 's923849851', 's943086329', 's985605363', 's936989210'] | [40068.0, 21704.0, 21420.0, 40084.0, 21472.0, 21648.0, 21616.0, 8992.0, 21632.0] | [141.0, 52.0, 54.0, 140.0, 82.0, 54.0, 82.0, 23.0, 55.0] | [160, 285, 260, 162, 269, 254, 266, 263, 266] |
p02658 | u283751459 | 2,000 | 1,048,576 | Given N integers 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()))\ncount = 1\nfor i in range(n):\n count *= l[i]\n if count >= 1000000000000000000:\n print("-1")\n break\n\nif count <= 1000000000000000000:\n print(count)\n ', 'n = int(input())\nl = list(map(int,input().split()))\ncount = 1\nif l.count(0) != 0:\n print(0)\nelse:\n for i in range(n):\n count *= l[i]\n if count >= 1000000000000000000:\n print("-1")\n elif count <= 1000000000000000000:\n print(count)\n ', 'n = int(input())\nl = list(map(int,input().split()))\ncount = 1\nfor i in range(n):\n count *= l[i]\n\nif count >= 1000000000000000000:\n print("-1")\nelif count <= 1000000000000000000:\n print(count)\n ', 'n = int(input())\nl = list(map(int,input().split()))\ncount = 1\nif l.count(0) != 0:\n print(0)\nelse:\n for i in range(n):\n count *= l[i]\n if count >= 1000000000000000000:\n print("-1")\n break\n if count <= 1000000000000000000:\n print(count)\n ', 'n = int(input())\nl = list(map(int,input().split()))\ncount = 1\nif l.count(0) != 0:\n print(0)\nelse:\n for i in range(n):\n count *= l[i]\n if count > 1000000000000000000:\n print("-1")\n break\n if count <= 1000000000000000000:\n print(count)\n \n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s202079033', 's286767971', 's800518762', 's819462760', 's804895701'] | [21392.0, 21592.0, 21444.0, 21692.0, 21588.0] | [59.0, 2206.0, 2206.0, 61.0, 56.0] | [209, 245, 197, 259, 259] |
p02658 | u283929013 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nA = list(map(int,input().split()))\nc = 1\nfor a in A:\n\tc *= a\n if c > 10**18:\n print("-1")\n quit()\nprint(c)\n', 'n = int(input())\nA = list(map(int,input().split())\nc = 1\nfor a in A:\n\tc *= a\n if c > 10**18:\n print("-1")\n quit()\nprint(c)', 'n = int(input())\na = list(map(int,input().split()))\nc = 1\nflag = True\nfor _ in a:\n c *= _\n if c > 10**18:\n flag = False\n c = 1\n if c == 0:\n print(0)\n quit()\nif flag:\n print(c)\nelse:\n print(-1)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s001394987', 's613910471', 's448705490'] | [9012.0, 9016.0, 21600.0] | [30.0, 31.0, 70.0] | [143, 141, 235] |
p02658 | u284744415 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nnums = sorted([int(e) for e in input().split()])\nans = 1\nfor a in nums:\n ans *= a\n if(10 * 18 < ans):\n ans = -1\n break\n elif(ans == 0):\n break\nprint(ans)', 'n = int(input())\nnums = [int(e) for e in input().split()]\nans = 1\nfor i in range(n):\n ans *= nums[i]\n if(10 * 18 < ans):\n ans = -1\n break\n elif(ans == 0):\n break\nprint(ans)', 'N = int(input())\nnum = sorted([int(e) for e in input().split(" ")])\nans = 1\nfor a in num:\n ans *= a\n if(ans > 10 ** 18):\n print(-1)\n break\n elif(ans == 0):\n print(0)\n break\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s881666416', 's988238025', 's438115756'] | [21648.0, 21780.0, 21540.0] | [77.0, 54.0, 79.0] | [200, 202, 230] |
p02658 | u285257696 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = sorted(list(map(int, input().rstrip().rsplit())))\nprint(A)\n\nans = 1\nfor val in A:\n ans *= val\n\n if ans == 0:\n break\n\n if ans > 10**18:\n ans = -1\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().rstrip().rsplit()))\nA_dict = {}\n\nfor val in A:\n A_dict[val] = A_dict.get(val, 0) + 1\n\nlimit = 10**18\nans = 1\n\nif A_dict.get(0, 0) > 0:\n ans = 0\nelse:\n for val in A_dict:\n ans *= val ** A_dict[val]\n\n if ans > limit:\n ans = -1\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s318061157', 's720761845'] | [21664.0, 24124.0] | [2206.0, 81.0] | [201, 332] |
p02658 | u285372827 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na_list = list(map(int,input().split()))\nans = 1\nfor i in range(n):\n ans = ans * a_list[i]\n if ans > 10**8:\n ans = -1\n break\nprint(ans)', 'import sys\nn = int(input())\na_list = list(map(int,input().split()))\nif 0 in a_list:\n print(0)\n sys.exit(0)\nans = 1\nfor i in range(n):\n ans = ans * a_list[i]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s014695536', 's557523590'] | [21780.0, 21576.0] | [53.0, 49.0] | [159, 212] |
p02658 | u285436211 | 2,000 | 1,048,576 | Given N integers 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(_) for _ in input().split()]\nans=1\nif A.count(0)>0:\n print(0)\nelse:\n for i in range(n):\n ans=ans*A[i]\n if ans>10**18:\n print(-1)\n else:\n print(ans)', 'n=int(input())\nA=[int(_) for _ in input().split()]\nans=1\nif A.count(0)>0:\n print(0)\nelse:\n for i in range(n):\n ans=ans*A[i]\n if ans>10**18:\n print(-1)\n exit()\n print(ans) \n '] | ['Wrong Answer', 'Accepted'] | ['s626301817', 's734777568'] | [21628.0, 21588.0] | [2206.0, 62.0] | [190, 193] |
p02658 | u285492845 | 2,000 | 1,048,576 | Given N integers 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 = input().split()\ns = [int(i) for i in s]\nmul = 1\nflag = 0\n\nif 0 in s:\n print(0)\nelse:\n\n\n for item in s:\n mul *= item\n if flag == 1:\n break\n\n if mul // 1e18 >= 1.0:\n print(-1)\n flag = 1\n\n if mul // 1e18 < 1.0:\n print(mul)\n\n', 'n = int(input())\ns = input().split()\ns = [int(i) for i in s]\nmul = 1\nflag = 0\n\nif 0 in s:\n print(0)\nelse:\n\n\n for item in s:\n mul *= item\n if flag == 1:\n break\n\n if mul > 1e18:\n print(-1)\n flag = 1\n\n if mul <= 1e18:\n print(mul)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s416392651', 's009968051'] | [21580.0, 21792.0] | [59.0, 53.0] | [314, 300] |
p02658 | u287660527 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nx = input().split()\na = 0\nb = 1\nif x.count(0) >= 1:\n print(0)\nelse:\n while a <= n - 1 and b <= 1000000000000000000:\n b = b * int(x[a])\n a <= n - 1\n if b <= 1000000000000000000:\n print(b)\n else:\n print(-1)', "n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 and b < 10^8:\n b = b * int(x[a])\n a += 1\nif b > 10^8:\n print('-1')\nelse:\n print(b)", 'n = int(input())\nx = input().split()\na = 0\nb = 1\nif x.count(0) > 1:\n print(0)\nelse:\n while a <= n - 1 and b <= 1000000000000000000:\n b = b * int(x[a])\n a <= n - 1\n if b > 1000000000000000000:\n print(-1)\n else:\n print(b)', 'n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 and b <= 1000000000000000000:\n b = b * int(x[a])\n a += 1\nif b < 1000000000000000000:\n print(b)\nelse:\n print(-1)', "n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 or b > 10^8:\n b = b * int(x[a])\n a += 1\nif b > 10^8:\n print('-1')\nelse:\n print(b)", "n = int(input())\nx = input().split()\na = 0\nb = 1\nif x.count('0') >= 1:\n print(0)\nelse:\n while a <= n - 1 and b <= 1000000000000000000:\n b = b * int(x[a])\n a <= n - 1\n if b <= 1000000000000000000:\n print(b)\n else:\n print(-1)", 'n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 and b <= 10^18:\n b = b * int(x[a])\n a += 1\nif b > 10^18:\n print(-1)\nelse:\n print(b)\n', "n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 and b <= 10^8:\n b = b * int(x[a])\n a += 1\nif b > 10^8:\n print('-1')\nelse:\n print(b)", "n = int(input())\nx = input().split()\na = 0\nb = 1\nwhile a <= n - 1 and b <= 10^18:\n b = b * int(x[a])\n a += 1\nif b > 10^18:\n print('-1')\nelse:\n print(b)", '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 prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n \n print(prod)\n \nmain ()\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s105775087', 's136654921', 's170139995', 's195364117', 's289882985', 's464550119', 's524798803', 's548308015', 's686589863', 's821553400'] | [19316.0, 19336.0, 19316.0, 19452.0, 19364.0, 19440.0, 19360.0, 19344.0, 19416.0, 21484.0] | [2206.0, 54.0, 2206.0, 64.0, 2206.0, 2206.0, 58.0, 57.0, 60.0, 52.0] | [237, 152, 235, 181, 151, 239, 154, 153, 155, 244] |
p02658 | u289105044 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n d=b*d\n if d>10**18:\n print("-1")\n break\n \n \n \n \nif d>10**18:\n print("-1")\nelse:\n print(d) ', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n d=b*d\n if d=>10**18:\n break \n \n \n \n \nif d=>10**18:\n print("-1")\nelse:\n print(d) ', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n \n d=d*b\nif d==10**18:\n print("-1")\n continue\n print(d) ', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n \n \td=d*b\n if d>10**18:\n break\nif d>10**18:\n print("-1")\nelse:\n print(d) ', 'def main():\n\nn=input()\na=map(int,input().split)\nd=1\n\nif 0 in a:\n print(0)\n return\n\nfor b in a:\n d=d*b\n \n if d>10**18:\n print("-1")\n return\nprint(d)\n\ndef main():', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n \n d=d*b\nif d==10**18:\n print("-1")\nelse:\n print(d) ', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor c in a:\n if c==0:\n d=0\n\nfor b in a:\n d=b*d\n if d>(10**18):\n \n break \n \n \n \n \nif d>(10**18):\n print("-1")\nelse:\n print(d) ', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n d=b*d\n if d>10**18:\n break \n \n \n \n \nif d>10**18:\n print("-1")\n', 'n = input()\na = map(int,input(). split ())\n\nd=1\n\nfor b in a:\n d=b*d\n if d>=10**18:\n break \n \n \n \n \nif d>=10**18:\n print("-1")\nelse:\n print(d) ', 'def main():\n\n\tn=input()\n\ta=list(map(int,input().split()))\n\t\n\t\n\tif 0 in a:\n\t\tprint(0)\n\t\treturn\n\n\td=1\n \n\t\n\n\tfor b in a:\n\t\td=d*b\n\t\tif d>10**18:\n\t\t\tprint("-1")\n\t\t\treturn\n\tprint(d)\n\nmain()'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s025774242', 's039253026', 's138613863', 's269943648', 's405768060', 's880504976', 's920878570', 's943792171', 's989380290', 's681317394'] | [8992.0, 9036.0, 9064.0, 9016.0, 9004.0, 19288.0, 19316.0, 19152.0, 19172.0, 21644.0] | [23.0, 21.0, 24.0, 21.0, 22.0, 2206.0, 51.0, 41.0, 41.0, 47.0] | [183, 167, 122, 146, 171, 117, 206, 148, 167, 186] |
p02658 | u289288647 | 2,000 | 1,048,576 | 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(str, input().split()))\ntotal = 1\n\nif '0' in a:\n print('0')\n sys.exit()\nfor i in a:\n total *= int(i)\n if total >= 10**18:\n print('-1')\n sys.exit()\nprint(total)\n", "import sys\nN = int(input())\na = list(map(str, input().split()))\ntotal = 1\n\nif '0' in a:\n print('0')\n sys.exit()\nfor i in a:\n total *= int(i)\n if total > 10**18:\n print('-1')\n sys.exit()\nprint(total)\n"] | ['Wrong Answer', 'Accepted'] | ['s414537132', 's959066761'] | [19388.0, 19380.0] | [53.0, 56.0] | [226, 225] |
p02658 | u290784570 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\na.sort(reverse = True)\nres = 1\ncheck = 10**18\nif 0 in a:\n print(0)\nelse:\n for i in range(a):\n if res > check:\n res = -1\n break\n res *= a[i]\n print(res)', 'n = int(input())\nls = list(map(int, input().split()))\nres = 1\nif 0 in ls:\n res = 0\nfor x in ls:\n res *= x\n if res > 10**18:\n res = -1\n break\nprint(res)'] | ['Runtime Error', 'Accepted'] | ['s520762106', 's857256215'] | [21784.0, 21752.0] | [78.0, 54.0] | [249, 174] |
p02658 | u290886932 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ret *= a\n if ret > MAX:\n print(-1)\n break\n if ret < MAX:\n print(ret)', "N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nflag = True\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ret *= a\n if ret > MAX:\n print('-1')\n flag = False\n break\n if flag and ret < MAX:\n print(ret)", 'N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nflag = True\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ret *= a\n if ret > MAX:\n print(-1)\n flag = False\n break\n if flag and ret < MAX:\n print(ret)', 'N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nfor a in A:\n ret *= a\n if ret > MAX:\n print(-1)\n break\nif ret < MAX:\n print(ret)', 'N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ret *= a\n if ret > MAX:\n print(-1)\n break\n if ret < MAX:\n print(ret)', 'N = int(input())\nA = list(map(int,input().split()))\nMAX = 10**18\nret = 1\nflag = True\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ret *= a\n if ret > MAX:\n print(-1)\n flag = False\n break\n if flag and ret <= MAX:\n print(ret)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s155434334', 's367618517', 's671019079', 's752073219', 's866431415', 's452717201'] | [9032.0, 21656.0, 21712.0, 21632.0, 21640.0, 21600.0] | [21.0, 50.0, 50.0, 48.0, 53.0, 51.0] | [214, 282, 280, 162, 234, 281] |
p02658 | u291216062 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(map(int,input().split())\nmul=1\nflag=0\nfor i in range(len(a)):\n mul=mul*a[i]\n if mul>10**18:\n \t\tflag=1\n\t\t\tbreak\nif flag==1:\n\tprint(-1)\n continue\nprint(mul)', 'n=int(input())\na=list(map(int,input().split()))\nmul=1\nif a.count(0)>=1:\n print(0)\nif a.count(0)==0:\n for i in range(len(a)):\n mul=mul*a[i]\n if mul>10**18:\n break\n \n if mul>10**18:\n print(-1)\n if mul<=10**18:\n print(mul)'] | ['Runtime Error', 'Accepted'] | ['s931409749', 's354506186'] | [9040.0, 21616.0] | [21.0, 52.0] | [197, 273] |
p02658 | u293215208 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n\nif 0 in A:\n ans = 0\n break \nelse:\n for i in A:\n ans = ans*i\n if ans > 10**18:\n ans = -1\n break\n \nprint(ans)', 'n = int(input())\nA = list(map(int, input().split()))\n \nint ans = 1\n \nfor i in A:\n ans = ans*i\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\n \nif 0 in A:\n ans = 0\nelse:\n for i in A:\n ans = ans*i\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s521948396', 's690015260', 's409665574'] | [9044.0, 8808.0, 21556.0] | [24.0, 28.0, 57.0] | [198, 152, 180] |
p02658 | u293893582 | 2,000 | 1,048,576 | Given N integers 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\nl = list(map(int, input().split()))\n\nfor x in l:\n ans = ans*x\n \nif(ans > 1000000000000000000):\n print(-1)\nelse:\n print(ans)', 'def main():\n n = int(input())\n\n\tl = list(map(int, input().split()))\n\n\tans = 1\n\n for x in l:\n ans = ans*x\n if(ans > 1000000000000000000):\n print(-1)\n return\n\n\n print(ans)\n\nmain()', 'def main():\n n = int(input())\n l = list(map(int, input().split()))\n ans = 1\n \n if 0 in l:\n print(0)\n return\n \n for x in l:\n ans = ans*x\n if(ans > 1000000000000000000):\n print(-1)\n return\n print(ans)\n \nmain()\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s315724441', 's831063958', 's470449833'] | [21560.0, 8992.0, 21584.0] | [48.0, 24.0, 49.0] | [145, 196, 275] |
p02658 | u294385082 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n \nn = int(input())\na = list(map(int,input().split()))\n \nproduct = np.prod(a)\n \nif product >= 10**18:\n print(-1)\nelse:\n print(product)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n \nfor i in range(n):\n ans = ans*a[i]\n if ans > 10**18:\n print(-1)\n exit()\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s834512404', 's789945573'] | [40152.0, 21780.0] | [138.0, 56.0] | [154, 190] |
p02658 | u294542073 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\na=list(map(int,input().split()))\n\nans=1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n ans*=i\n if ans>10**18:\n print(-1)\n exit()\n\n\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\n\nans=1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n ans*=i\n if ans>10**18:\n print(-1)\n exit()\n\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s879786392', 's781813601'] | [9188.0, 21576.0] | [25.0, 50.0] | [155, 169] |
p02658 | u295120316 | 2,000 | 1,048,576 | 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 multipilation():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A\n print(0) \n return\n \n prod = 1\n for a in A\n prod *= a\n if prod > 10**18\n print(-1)\n return\n\n print(prod)\n \n multipilation()\n \n ', 'def multipilation():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A\n print(0) \n return\n \n prod = 1\n for a in A\n prod *= a\n if prod > 1000000000000000000\n print(-1)\n return\n\n print(prod)\n \nmultipilation()\n \n \n', 'def multipilation():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A\n print(0) \n return\n \n prod = 1\n for a in A\n prod *= a\n if prod > 10**18\n print(-1)\n return\n\n print(prod)\n \nmultipilation()\n \n \n', 'def multipilation():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A:\n print(0) \n return\n \n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n\n print(prod)\n \nmultipilation()\n \n \n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s016077617', 's316050110', 's658990879', 's186737230'] | [9024.0, 8964.0, 8936.0, 21648.0] | [24.0, 22.0, 25.0, 52.0] | [296, 306, 293, 309] |
p02658 | u298376876 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n = int(input())\na = list(map(int, input().split()))\ncount = 1\n\nfor A in a:\n count = count * A\n if count >= 10**18:\n print('-1')\n exit()\nprint(count)", 'n = int(input())\na = list(map(int, input().split()))\ncount = 1\n \nif 0 in a:\n print(0)\n exit()\n \nfor A in a:\n count *= A\n if count > 10**18:\n print(-1)\n exit()\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s343722843', 's501720921'] | [21476.0, 21648.0] | [49.0, 48.0] | [166, 182] |
p02658 | u299599133 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = sorted(list(map(int, input().split())), reverse = True)\nif 0 in A:\n print(0)\nelse:\n val = 1\n for a in A:\n val *= a\n if val >= 10**18:\n val = -1\n break\n print(val)', 'N = int(input())\nA = list(map(int, input().split()))\nval = 1\nfor a in A:\n val *= a\nif val >= 10**18:\n val = -1\nprint(val)', 'N = int(input())\nA = sorted(list(map(int, input().split())), reverse = True)\nif 0 in A:\n print(0)\nelse:\n val = 1\n for a in A:\n val *= a\n if val > 10**18:\n val = -1\n break\n print(val)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s427499772', 's603346786', 's928200934'] | [21648.0, 21644.0, 21488.0] | [81.0, 2206.0, 77.0] | [231, 127, 230] |
p02658 | u301584411 | 2,000 | 1,048,576 | Given 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()\nb=list(map(int , input().slice()))\nc=1\nfor i in b:\n c=c*i\nif c>10**18:\n print(-1) \nelse:\n print(c)', 'n=input()\nb=list(map(int,input(). split ()))\nc=1\nif 0 in b:\n print(0)\n return\nc=1\nfor i in b:\n c=c*i\n if c>10**18:\n print(-1)\n return\nprint(c)', 'n=input()\nb=map(int , input().slice())\nc=1\nfor i in range(1,n):\n c=c*b[i]\n \nprint(c)', 'n=input()\nb=list(map(int,input(). split ()))\nc=1\nif 0 in b:\n print(0)\n return\nc=1\nfor i in b:\n c=c*i\n if c>10**18:\n print(-1)\n return\nprint(c)', 'n=int(input())\nb=list(map(int,input(). split ()))\nif 0 in b:\n print(0)\n return\nc=1\nfor i in b:\n c=c*i\n if c>10**18:\n print(-1)\n return\nprint(c)', 'n=input()\nb=list(map(int , input().slice()))\nc=1\nfor i in range(1,n):\n c=c*b[i]\n\nif c>10**18:\n print(-1) \nelse:\n print(c)', 'N = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\nprint(0)\nreturn\nprod = 1\nfor a in A:\nprod *= a\nif prod > 1000000000000000000:\nprint(-1)\nreturn\nprint(prod)\n', 'n=input()\nb=list(map(int , input().slice()))\nc=1\nfor i in range(1,n):\n c=c*b[i]\n if c>10**18:\n print(-1)\n \nprint(c)', 'n=input()\nb=list(map(int,input(). split ()))\nif 0 in b:\n print(0)\n return\nc=1\nfor i in b:\n c=c*i\n if c>10**18:\n print(-1)\n return\nprint(c)', 'def main ():\nN = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\nprint(0)\nreturn\nprod = 1\nfor a in A:\nprod *= a\nif prod > 1000000000000000000:\nprint(-1)\nreturn\nprint(prod)\nmain ()\n', 'n=input()\nb=list(map(int,input(). split ()))\nc=1\nif 0 in b:\n print(0)\nelse:\n c=1\n for i in b:\n c=c*i\n if c>10**18:\n print(-1)\n return\nprint(c)', 'n=int(input())\na=list(map(int, input().split( )))\nif 0 in a:\n print(0)\n \nelse:\n c=1\n for i in a:\n c= c*i\n if c> 10**18:\n c=-1\n break\n print(c)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s000595633', 's102095873', 's200348376', 's437920074', 's515937624', 's607136310', 's695311789', 's759333776', 's945035546', 's951186009', 's995438438', 's747935655'] | [12396.0, 8968.0, 12584.0, 9032.0, 9036.0, 12608.0, 8980.0, 12576.0, 9036.0, 8932.0, 9092.0, 21472.0] | [27.0, 24.0, 25.0, 22.0, 24.0, 27.0, 22.0, 23.0, 22.0, 23.0, 25.0, 51.0] | [112, 152, 86, 156, 153, 125, 172, 121, 148, 193, 161, 190] |
p02658 | u302697704 | 2,000 | 1,048,576 | 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())\nnumbers = input().split()\nsum = 1\nfor i in range(num):\n sum = sum*int(numbers[i])\nif (sum>=(10**18)):\n print (-1)\nelse :\n print (sum)', "num = int(input())\nnumbers = input().split()\nsum = 1\nfor i in range(num):\n numbers[i] = int(numbers[i])\n sum = sum*numbers[i]\nif (sum>=(10**18)):\n print ('-1')\nelse :\n print (sum)", 'num = int(input())\nnumbers = list(map(int,input().split()))\nsum = 1\nfor i in range(num):\n sum *=numbers[i]\n if (sum>(10**18)):\n \tprint (-1)\n break\nif sum<=(10**18):\n print (sum)', 'import numpy as np\n\nN = int(input())\nAlist = list(map(int,input().split()))\n\n\nAlist.sort()\nans = 1\nfor i in range(N):\n #print (Alist[i])\n ans*= Alist[i]\n if Alist[i]==0:\n break\n if ans >10**18:\n break\n\nif ans >10**18:\n print(-1)\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s531637731', 's786739946', 's951286198', 's521424555'] | [19340.0, 19416.0, 8968.0, 39700.0] | [2206.0, 2206.0, 24.0, 174.0] | [155, 183, 184, 279] |
p02658 | u303058371 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["N = int(input())\nsum = eval(input().replace(' ','*'))\nprint(sum if sum<= 10**8 else -1)", 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nres = 1\nfor i in A:\n res*=i;\n if res>10**18:\n res = -1\n break\nprint(res)'] | ['Runtime Error', 'Accepted'] | ['s491214729', 's364188360'] | [57436.0, 21684.0] | [111.0, 95.0] | [87, 154] |
p02658 | u303059352 | 2,000 | 1,048,576 | 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())\nlis = map(int, input().split())\nans = 1\nif 0 in lis:\n print(0)\n sys.exit()\nfor i in lis:\n ans *= i\n if ans > 10**18:\n print(-1)\nelse:\n print(ans)\n', 'import sys\nn = int(input())\nlis = list(map(int, input().split()))\nans = 1\nif 0 in lis:\n print(0)\n sys.exit()\nfor i in lis:\n ans *= i\n \n if ans > 10**18:\n print(-1)\n sys.exit()\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s594889982', 's192274359'] | [19424.0, 21792.0] | [46.0, 49.0] | [182, 198] |
p02658 | u303739137 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\naa = list(map(int, input().split()))\nret = 1\nfor a in aa:\n ret *= a\nif ret > 10**18:\n print(-1)\nelse:\n print(a)', 'n = int(input())\naa = list(map(int, input().split()))\nret = 1\nff = False\nfor a in reversed(sorted(aa)):\n ret *= a\n if ret > 10**18:\n ff = True\n break\nif ff:\n print(-1)\nelse:\n print(a)', 'n = int(input())\naa = sorted(list(map(int, input().split())))\nif aa[0] == 0:\n print(0)\nelse:\n ret = 1\n ff = False\n for a in reversed(aa):\n ret *= a\n if ret > 10**18:\n ff = True\n break\n if ff:\n print(-1)\n else:\n print(a)', 'n = int(input())\naa = sorted(list(map(int, input().split())))\nif aa[0] == 0:\n print(0)\nelse:\n ret = 1\n ff = False\n for a in reversed(aa):\n ret *= a\n if ret > 10**18:\n ff = True\n break\n if ff:\n print(-1)\n else:\n print(ret)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s348684756', 's353985015', 's878271837', 's671391348'] | [21640.0, 21780.0, 21660.0, 21708.0] | [2206.0, 78.0, 75.0, 83.0] | [137, 209, 287, 289] |
p02658 | u304058693 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n\n ans = 1\n i = 0\n while (ans < 10 ** 18):\n ans *= a[i]\n i += 1\n\n if i == n - 1:\n print(ans)\n else:\n print(-1)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n\n ans = 1\n i = 0\n while (i <= n - 1):\n if ans <= 10 ** 18:\n ans *= a[i]\n i += 1\n else:\n break\n\n #print(i)\n if ans <= 10 ** 18:\n print(ans)\n else:\n print(-1)\n'] | ['Runtime Error', 'Accepted'] | ['s221612519', 's464125916'] | [21460.0, 21576.0] | [58.0, 61.0] | [237, 320] |
p02658 | u305237878 | 2,000 | 1,048,576 | Given N integers 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\ncount = 0\nS = list(map(int, input().split()))\n\nwhile count <= N - 1:\n ans *= S[count]\n if ans <= 10**18:\n ans = -1\n break\n count += 1\nprint(ans)', 'N = int(input())\nans = 1\nS = list(map(int, input().split()))\n\nif 0 in S:\n ans = 0\nelse:\n for i in range(N):\n ans *= S[i-1]\n if ans >= 10**18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nans = 1\nS = list(map(int, input().split()))\n\nif 0 in S:\n ans = 0\nelse:\n for i in range(N):\n ans *= S[i-1]\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s610530412', 's844280616', 's641092375'] | [21548.0, 21784.0, 21536.0] | [55.0, 59.0, 58.0] | [192, 211, 210] |
p02658 | u305349402 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['INF = 1000000000000000000\nN = int(input())\nflag = 1\nl = list(map(int,input().split()))\nif 0 in l:\n print(0)\n import sys\n sys.exit()\nsum = 1\nfor i in l:\n sum = sum*i\n print(sum)\n if sum > INF:\n print(-1)\n flag = 0\n break\n else:\n pass\n \nif flag:\n print(sum)', 'INF = 10**18\nN = int(input())\nsum = 1\nfor _ in range(N):\n sum = sum*int(input())\n if sum > INF:\n print(-1)\n import sys\n sys.exit()\n\nprint(sum)', 'INF = 1000000000000000000\nN = int(input())\nflag = 1\nl = list(map(int,input().split()))\nif 0 in l:\n print(0)\n import sys\n sys.exit()\nsum = 1\nfor i in l:\n sum = sum*i\n if sum > INF:\n print(-1)\n flag = 0\n break\n else:\n pass\n \nif flag:\n print(sum)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s158910430', 's691011749', 's240770434'] | [21472.0, 12800.0, 21704.0] | [79.0, 33.0, 53.0] | [278, 153, 265] |
p02658 | u305452255 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nnums = list(map(int,input().split()))\n\nres = 1\nfor i in range(n):\n res = res * nums[i]\n if res > 10**18 :\n print(-1)\n', 'n = int(input())\nnums = sorted(list(map(int,input().split())), reverse=True)\n\nres = 1\n\nif 0 in nums:\n print(0)\n exit()\n \nfor i in range(n):\n res = res * nums[i]\n if res <= 10**18 :\n continue\n else:\n res = -1\n break\nprint(res)\n'] | ['Wrong Answer', 'Accepted'] | ['s079019700', 's611478562'] | [21584.0, 21540.0] | [2206.0, 79.0] | [139, 241] |
p02658 | u305824645 | 2,000 | 1,048,576 | 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 decimal import *\nn = int(input())\na=list(map(Decimal,input().split()))\na.sort()\nans = 1\nfor i in range(0, n-1):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n\n', 'from decimal import *\nn = int(input())\na=list(map(Decimal,input().split()))\na.sort()\nans = 1\nfor i in a:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s984239324', 's880290642'] | [30544.0, 30708.0] | [167.0, 189.0] | [213, 198] |
p02658 | u306142032 | 2,000 | 1,048,576 | Given N integers 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 x in a:\n ans *= x\nif x > pow(10, 18):\n print(-1)\nelse:\n print(x)\n ', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nul = pow(10, 18)\nif 0 in a:\n print(0)\n exit(0)\nfor x in a:\n ans *= x\n if ans > ul:\n print(-1)\n exit(0)\nprint(ans)\n '] | ['Wrong Answer', 'Accepted'] | ['s234448590', 's816726949'] | [21708.0, 21752.0] | [2206.0, 53.0] | [135, 187] |
p02658 | u306497037 | 2,000 | 1,048,576 | Given N integers 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()))\nfinish = 0\nresult = 1\n\nif 0 in A:\n print(0)\n finish = 1\nelse:\n \n for n in range(N):\n result = result*A[n]\n if result > 1000000000000000000:\n print(-1)\n finish = 1\n\nif finish = 0:\n print(result)', 'N = int(input())\nA = list(map(int,input().split()))\nfinish = 0\nresult = 1\n\nif 0 in A:\n print(0)\n finish = 1\nelse:\n for n in range(N):\n result = result*A[n]\n if result > 10**18:\n print(-1)\n finish = 1\n break\n\n if finish == 0:\n print(result)'] | ['Runtime Error', 'Accepted'] | ['s683454898', 's739728883'] | [9044.0, 21652.0] | [20.0, 49.0] | [296, 305] |
p02658 | u309018392 | 2,000 | 1,048,576 | 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 = eval(input().replace(' ','*'))\nprint([a,-1][a>=10**18])", 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a :\n ans = 0\n\nelse:\n for i in range(n):\n ans *= a[i]\n if ans >10**18:\n ans = -1\n break\n \nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s126062480', 's875450317'] | [57244.0, 21476.0] | [106.0, 50.0] | [67, 221] |
p02658 | u309120194 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["N = int(input())\nA = map(int, input().split())\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n\nif ans > 10**18: ans = '-1'\nprint(ans)", "N = int(input())\nA = list(map(int, input().split()))\n\n\n\nans = 0\nif 0 not in A:\n ans = 1\n for a in A:\n ans *= a\n if ans > 10**18:\n ans = '-1'\n break\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s907002848', 's369564408'] | [19352.0, 21524.0] | [39.0, 56.0] | [128, 320] |
p02658 | u310035060 | 2,000 | 1,048,576 | 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())\nlist_A = list(input().split())\nlist_A = [int(n) for n in list_A]\ncal = np.prod(list_A)\nif cal > 10e+8:\n cal = -1\nprint(cal)', 'N = int(input())\nlist_A = list(input().split())\nlist_A = [int(n) for n in list_A]\n#print(list_A)\ncal = list_A[0]\nfor i in range(1,N):\n cal = cal * list_A[i]\nif cal > 10e+8:\n cal = -1\nprint(cal)', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n \n if 0 in A:\n return print(0)\n prod = 1\n for n in A:\n prod *= n\n if prod > 1000000000000000000:\n return print(-1)\n return print(prod)\n\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s482536083', 's587541327', 's289391893'] | [39924.0, 21552.0, 21484.0] | [149.0, 2206.0, 56.0] | [162, 199, 261] |
p02658 | u310291549 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['def main():\n n=int(input())\n a=list(map(int,input().split()))\n if 0 in a:\n print(0)\n return\n ans=1\n for i in a:\n ans=ans*i\n if pro>1000000000000000000:\n print(-1)\n return \n print(ans)\n return\nmain() ', 'def main():\n n=int(input())\n a=list(map(int,input().split()))\n if 0 in a:\n print(0)\n return\n ans=1\n for i in a:\n pro=pro*i\n if pro>1000000000000000000:\n print(-1)\n return \n print(ans)\n return\nmain() ', 'def main():\n n=int(input())\n a=list(map(int,input().split()))\n if 0 in a:\n print(0)\n return\n ans=1\n for i in a:\n ans=ans*i\n if ans>1000000000000000000:\n print(-1)\n return \n print(ans)\n return\nmain() '] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s493442539', 's877857131', 's068812264'] | [21708.0, 21780.0, 21624.0] | [51.0, 46.0, 49.0] | [284, 284, 284] |
p02658 | u310466455 | 2,000 | 1,048,576 | 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())\n\nscore = 1\nfor i in range(a):\n b = int(input())\n score *= b\n \nif score > 10 ** 18:\n print(-1)\nelse:\n print(score)', 'a1 = int(input())\nb2 = input().split(" ")\n\ndef check(a , b):\n score = 1\n if \'0\' in b:\n return 0\n else:\n for i in range(a):\n score *= int(b[i])\n if score > 10 ** 18:\n return -1\n \n return score\n\nprint(check(a1 , b2))'] | ['Runtime Error', 'Accepted'] | ['s970339189', 's874817971'] | [12740.0, 19448.0] | [32.0, 41.0] | [134, 246] |
p02658 | u310956674 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\nans = 1\nfor i in range(N):\n\u3000 ans = ans*A[i]\n if 10**18 < ans:\n print(-1) \n exit(0)\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit(0)\nans = 1\nfor i in range(N):\n ans = ans*A[i]\n if 10**18 < ans:\n print(-1) \n exit(0)\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s120582176', 's288225702'] | [8956.0, 21640.0] | [24.0, 58.0] | [197, 196] |
p02658 | u314089899 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA_list = [int(e) for e in input().split()]\n\nans = A_list[0]\nfor i in range(1,N):\n ans *= A_list[i]\n \n if ans >= 10**18:\n print(-1)\n break\nelse:\n print(ans)', 'N = int(input())\nA_list = [int(e) for e in input().split()]\nA_list.sort(reverse=False)\nans = A_list[0]\nfor i in range(1,N):\n ans *= A_list[i]\n \n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s500988869', 's315335249'] | [21576.0, 21344.0] | [54.0, 96.0] | [198, 223] |
p02658 | u315133903 | 2,000 | 1,048,576 | 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_1n = np.array(list(map(int, input().split())))\n\nif 0 not in A_1n:\n\tout = np.cumprod(A_1n)[-1]\n\tprint(out) if out < 10 ** 18 else print(-1)\nelse:\n print(0)', 'import numpy as np\n\nN = int(input())\nA_1n = np.array(list(map(int, input().split())))\n\nif 0 not in A_1n:\n\tout = np.cumprod(A_1n)[-1]\n\tprint(out) if out < 1e18 else print(-1)\nelse:\n print(0)', 'N = int(input())\nMX = 10**18\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\n exit(0)\nans = 1\nfor x in a:\n ans *= x\n if ans > MX:\n print(-1)\n exit(0)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s003670754', 's348514125', 's686972928'] | [40076.0, 40232.0, 21656.0] | [147.0, 138.0, 47.0] | [196, 192, 195] |
p02658 | u315600877 | 2,000 | 1,048,576 | Given N integers 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\nA=list(map(int,input().split()))\nwhile ans<10**18:\n for i in A:\n ans*=i\nif ans>=10**18\n print(-1)\nelse:\n print(ans)', 'N=int(input())\nans=1\nfor i in range(N):\n A=int(input())\n ans*=A\nif ans>1000000000000000000:\n print(-1)\nelse:\n print(ans)', 'def kai():\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 i in A:\n ans*=i\n if ans>10**18:\n print(-1)\n return\n print(ans)\n return\nkai()\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s328701262', 's347206653', 's307872741'] | [8924.0, 12776.0, 21660.0] | [25.0, 36.0, 50.0] | [152, 124, 262] |
p02658 | u316733945 | 2,000 | 1,048,576 | Given N integers 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\nprint(n)\nprint(a)\n\nnum = 1\nfor k in range(n):\n\tnum *= a[k]\n\nif num > 10**18:\n\tprint("-1")\nelse:\n\tprint(num)', 'n = int(input())\na = list(map(int, input().split()))\n\nnum = 1\nif 0 in a:\n num = 0\n \nelse:\n for k in range(n):\n num *= a[k]\n if num > 10**18:\n num = "-1"\n break\n\nprint(num)'] | ['Wrong Answer', 'Accepted'] | ['s405597329', 's183582528'] | [21708.0, 21552.0] | [2206.0, 50.0] | [161, 198] |
p02658 | u317423698 | 2,000 | 1,048,576 | 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\nreadline = sys.stdin.buffer.readline\nn = int(readline())\na = map(int, readline().split())\na.sort()\nv = 1\nfor i in a:\n v *= i\n if v > 1000000000000000000:\n print(-1)\n break\n elif v == 0:\n print(0)\n break\nelse:\n print(v)', 'import sys\nreadline = sys.stdin.buffer.readline\nn = int(readline())\na = list(map(int, readline().split()))\nv = 1\n\nif min(a) == 0:\n print(0)\nelse:\n for i in a:\n v *= i\n if v > 1000000000000000000:\n print(-1)\n break\n else:\n print(v)'] | ['Runtime Error', 'Accepted'] | ['s716551085', 's866464243'] | [17912.0, 20088.0] | [37.0, 52.0] | [245, 252] |
p02658 | u317485668 | 2,000 | 1,048,576 | 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\nfrom decimal import decimal\n\na, b = input().split()\n\nprint(int(decimal(a)*decimal(b)))\n', '# -*- coding: utf-8 -*-\n\nn = int(input())\na_li = list(map(int, (input().split())))\n\nproduct = 1\n\nif 0 in a_li:\n product = 0\nelse:\n for i in a_li:\n product *= i\n if product > 10**18:\n product = -1\n break\n break\n \nprint(product)', '# -*- coding: utf-8 -*-\n\nn = int(input())\na_li = list(map(int, (input().split())))\n\nproduct = 1\n\nif 0 in a_li:\n product = 0\nelse:\n for i in a_li:\n product *= i\n if product > 10**18:\n print(-1)\n exit()\n\nprint(product)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s558573132', 's678228310', 's311889283'] | [9860.0, 9048.0, 21656.0] | [27.0, 24.0, 50.0] | [112, 282, 258] |
p02658 | u317884892 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nmul = 1\nlst = [map(int.input().split())]\nfor ele in lst:\n mul = mul *ele\nif(mul > 1e18):\n print(-1)\nelse:\n print(mul)', 'def solve():\n n = int(input())\n lst = list(map(int,input().split()))\n if 0 in lst:\n print(0)\n return\n mul = 1\n for ele in lst:\n mul = mul * ele\n if mul > 1e18:\n print(-1)\n return\n \n print(mul)', 'def solve():\n n = int(input())\n lst = list(map(int,input().split()))\n if 0 in lst:\n print(0)\n return\n mul = 1\n for ele in lst:\n mul = mul * ele\n if mul > 1e18:\n print(-1)\n return\n \n print(mul)\n \nsolve()'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s041373411', 's625939374', 's275867938'] | [9180.0, 9064.0, 21640.0] | [24.0, 27.0, 53.0] | [137, 263, 276] |
p02658 | u318182140 | 2,000 | 1,048,576 | Given N integers 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 *= i\n if int(ans) in range(10**18):\n print(int(ans))\n else:\n print(-1)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\n quit()\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n quit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s035243975', 's747078785'] | [21640.0, 21636.0] | [124.0, 54.0] | [178, 185] |
p02658 | u319957725 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nN = int(input())\nA = list(map(int, input().split())) \nans = np.prod(A)\nans = -1 if ans >= 1e+18 else ans\nprint(ans)', 'import numpy as np\n\nN = int(input())\nA = list(map(int, input().split())) \n\nFLAG = True\nif(min(A) == 0):\n prod = 0\nelse:\n prod = 1\n for a in A:\n prod *= a\n if(prod > 1000000000000000000):\n print(-1)\n FLAG = not FLAG\n break\n\nif FLAG:\n print(prod)'] | ['Wrong Answer', 'Accepted'] | ['s639248365', 's782012289'] | [40164.0, 40184.0] | [136.0, 140.0] | [135, 303] |
p02658 | u323045245 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nl= list(map(int,input().split()))\nif 0 in l:\n print(0)\n exit()\nans = 1\nfor i in l:\n ans *= 1\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', '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 print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s760664987', 's212468104'] | [21648.0, 21620.0] | [57.0, 94.0] | [167, 152] |
p02658 | u324197506 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['nums = list(map(int, input().split()))\n\nans = 1\n\nif 0 in nums:\n print(0)\n exit()\n\nfor num in nums:\n ans = ans * num\n if ans > 10 ** 18:\n print(-1)\n exit()\n \nprint(ans)', '\nimport numpy as np\n\nn = int(input())\n\nnums = list(map(int, input().split()))\n\nans = 1\n\nif 0 in nums:\n print(0)\n exit()\n\nfor num in nums:\n ans = ans * num\n if ans > 10 ** 18:\n print(-1)\n exit()\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s361515147', 's717868651'] | [9188.0, 40040.0] | [22.0, 134.0] | [197, 236] |
p02658 | u324818389 | 2,000 | 1,048,576 | Given N integers 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 = int(1)\na = input().split(" ")\n\nfor i in range(n):\n ans *= int(a[i])\n if ans > 10**18:\n print("-1")\n break\n \nif ans < 10**18:\n print(ans)', 'n = int(input())\nans = int(1)\na = input().split(" ")\n\nif "0" in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= int(a[i])\n if ans > 10**18:\n print("-1")\n break\n \nif ans <= 10**18:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s273389285', 's849524030'] | [19508.0, 19408.0] | [49.0, 52.0] | [171, 211] |
p02658 | u324975917 | 2,000 | 1,048,576 | 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 \ninput()\nA = list(map(int, input().split()))\nk=np.prod(A)\nif k >= 10**(18):\n print(-1)\nelse:\n print(k)', 'import numpy as np\n\ninput()\nA = list(map(int, input().split()))\n\nif k > 10**(18):\n print(-1)\nelse:\n print(int(np.prod(A)))', 'n = input()\nA = list(map(int,input().split()))\ns = 1\nA.sort()\nfor a in A:\n s *= a\n if s > 10**18:\n s = -1\n break\nprint(s)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s281505620', 's959773379', 's313637251'] | [40200.0, 40052.0, 21644.0] | [136.0, 139.0, 86.0] | [128, 128, 129] |
p02658 | u325132311 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nb = [int(x) for x in input().split()]\na = 1\nmax = 10**18\n\nfor i in b:\n a *= i\n \na = -1 if a > max else a\nprint(r)', 'n = int(input())\nl = [int(x) for x in input().split()]\n\nif 0 in l:\n r=0\nelse:\n r = 1\n for x in range(n):\n r = r * l[x]\n if r > 10**18:\n r=-1\n break\n \nprint(r)'] | ['Runtime Error', 'Accepted'] | ['s306054227', 's722746224'] | [21644.0, 21524.0] | [2206.0, 53.0] | [132, 204] |
p02658 | u325149030 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nif A in 0:\n ans = 0\nelse:\n ans = 1\n check = 10 **18\n for i in range(N):\n ans *= A[i]\n print(ans)\n if ans > check:\n ans = -1\n break\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n ans = 0\nelse:\n ans = 1\n check = 10 **18\n for i in range(N):\n ans *= A[i]\n if ans > check:\n ans = -1\n break\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s597200517', 's223523762'] | [21636.0, 21468.0] | [49.0, 52.0] | [250, 231] |
p02658 | u325270534 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N, result = eval(input()), 1\nList = list(map(int, input().split()))\nif 0 in List:\n print(0)\n quit()\nfor i in List[N]:\n result *= i\n \nprint(result if result <= 10**18 else -1)', 'N, result = eval(input()), 1\nList = list(map(int, input().split()))\nfor i in List[N]:\n result *= i\n \nprint(result if result <= 10**18 else -1)', 'n = int(input())\nList = list(map(int, input().split()))\nres = 1\nif 0 in List:\n print(0)\n quit()\nfor x in List:\n res *= x\n if res > 10**18:\n print(-1)\n quit()\nprint(res)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s236746567', 's485612274', 's061156192'] | [21460.0, 21628.0, 21684.0] | [51.0, 52.0, 53.0] | [182, 148, 194] |
p02658 | u325660636 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in a:\n ans = i * ans\n print(ans)\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in a:\n ans = i * ans\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s556327709', 's909097330'] | [21684.0, 21648.0] | [74.0, 50.0] | [223, 204] |
p02658 | u326775883 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\na = sorted(a, reverse=True)\n\nans = 1\nif a[-1] == 0:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans >= 10**18:\n ans = -1\n break\n elif a[i] == 1:\n break\n \nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans == 0:\n break\n \nif ans >= 10**18:\n ans = -1\n \nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\na = sorted(a, reverse=True)\n\nans = 1\nif a[-1] == 0:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n ans = -1\n break\n elif a[i] == 1:\n break\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s364243445', 's982968363', 's495696322'] | [21788.0, 21468.0, 21784.0] | [75.0, 2206.0, 78.0] | [256, 170, 255] |
p02658 | u327294693 | 2,000 | 1,048,576 | 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\nfrom functools import reduce \n\n\ninputs = [list(map(int, input().split())) for _ in range(2)]\ninputs = inputs[1]\n\nif (0 in inputs):\n output = 0\nelse:\n output = reduce((lambda x, y: -1 if (x * y) <= 1e18 or x < 0 or y < 0 else (X * y)), inputs)\n\nprint(output)', 'from sys import stdin\nfrom functools import reduce \n\n\ninputs = [list(map(int, input().split())) for _ in range(2)]\ninputs = inputs[1]\n\nif (0 in inputs):\n output = 0\nelse:\n output = reduce((lambda x, y: -1 if (x * y) > 1e18 or x < 0 or y < 0 else (x * y)), inputs)\n\nprint(output)'] | ['Runtime Error', 'Accepted'] | ['s042305888', 's320814369'] | [22660.0, 22604.0] | [52.0, 65.0] | [314, 313] |
p02658 | u327532412 | 2,000 | 1,048,576 | Given N integers 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, = map(int, input().split())\nans = 1\nfor a in range(A):\n ans *= a\n if ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'N = int(input())\n*A, = map(int, input().split())\naa = sum(A)\nif aa >= 10 ** 18:\n print(-1)\nelse:\n print(aa)', 'N = int(input())\n*A, = map(int, input().split())\nans = 1\nfor a in A:\n ans *= a\n if ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'N = int(input())\n*A, = map(int, input().split())\nif 0 in A:\n print(0)\n exit()\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s134099154', 's599957777', 's606155490', 's994140547'] | [21784.0, 21700.0, 21764.0, 21556.0] | [49.0, 51.0, 49.0, 51.0] | [156, 113, 149, 199] |
p02658 | u328179275 | 2,000 | 1,048,576 | 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 =list(map(int,input().split()))\na = np.array(a_list)\ntotal = a.prod()\nif total >= 10**18:\n print(-1)\nelse:\n print(int(total))', "import numpy as np\nn = int(input())\na_list =list(map(int,input().split()))\ntotal = np.prod(a_list)\nprint(a_list)\n\nif total > 1000000000000000000 or total <0:\n print('-1')\nelse:\n print(int(total))", "import numpy as np\nn = int(input())\na_list =list(map(int,input().split()))\ntotal = np.prod(a_list)\nprint(a_list)\n\nif int(total) > 1000000000000000000:\n print('-1')\nelif int(total) < 0:\n print('-1')\nelse:\n print(int(total))", 'a = int(input())\nli = list(map(int,input().split()))\ntotal = 1\ni = 1\nfor i in range(a):\n total = total*li[i]\n if total > 1000000000000000000:\n total = -1\n break\nfor i in range(a):\n if li[i] == 0:\n total = 0\n \nprint(total)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s117719533', 's371502766', 's913082026', 's553002422'] | [40328.0, 40084.0, 40072.0, 21712.0] | [141.0, 154.0, 160.0, 57.0] | [174, 201, 231, 251] |
p02658 | u329048218 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['def main():\n N = int(input())\n A = list(map(int,input().split()))\n \n if 0 in A:\n print(0)\n return\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain()\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 prod = 1\n for a in A:\n prod *= a\n if prod > 10000000000000000000:\n print(-1)\n return\n print(prod)\nmain()\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 prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain()\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s281329501', 's726037321', 's555789848'] | [21636.0, 21756.0, 21652.0] | [74.0, 75.0, 56.0] | [279, 280, 275] |
p02658 | u329962837 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\np = [int(i) for i in input().split()]\nans = 1\n\nif 0 in p:\n print(0)\n exit()\n \nfor i in range(N):\n ans*=p[i]\n if ans > 10 ** 18:\n print(-1)\n exit()\n \nprint(ans)', 'N = int(input())\np = [int(i) for i in input().split()]\nans = 1\n\nif 0 in p:\n print(0)\n exit()\n \nfor i in range(n):\n ans*=p[i]\n \nif ans > 10 ** 18:\n print(-1)\n exit()\n \nprint(ans)', 'N = int(input())\np = [int(i) for i in input().split()]\nans = 1\n\nif 0 in p:\n print(0)\n exit()\n \nfor i in range(N):\n ans*=p[i]\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s164905250', 's700072989', 's761734796'] | [8948.0, 21468.0, 21584.0] | [26.0, 63.0, 59.0] | [184, 185, 185] |
p02658 | u331105860 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = [int(x) for x in input().split()]\n\nfor i in range(N):\n if A[i] == 0:\n print(0)\n exit()\n\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n print(ans, A[i])\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n', 'N = int(input())\nA = [int(x) for x in input().split()]\n\nfor i in range(N):\n if A[i] == 0:\n print(0)\n exit()\n\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s288756213', 's079837593'] | [21660.0, 21348.0] | [119.0, 67.0] | [262, 241] |
p02658 | u331606500 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['_,*a=map(int,open(0).read().split());z=1\nfor i in a:\n if i>=1e18/z:z=-1;break\n z*=i\nprint(0 if 0in a else z)', 'input();a=sorted(map(int,input().split()));z=1\nfor i in a:\n z*=i\n if z>1e18:z=-1;break\nprint(z)'] | ['Wrong Answer', 'Accepted'] | ['s259913359', 's898494481'] | [21784.0, 21748.0] | [59.0, 90.0] | [108, 95] |
p02658 | u332793228 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\na=list(map(int,input().split()))\nans=a[0]\nfor i in range(1,n):\n ans*=a[i]\nprint(ans if ans<10**18 else -1)', 'n=int(input())\na=list(map(int,input().split()))\na=sorted(a)\nans=0\nif a[0]==0:\n print(0)\nelse:\n a=a[::-1]\n ans=a[0]\n for i in a[1:]:\n ans*=i\n if ans>10**18:\n print(-1)\n break\n else:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s043888840', 's588317703'] | [21464.0, 21700.0] | [2206.0, 81.0] | [124, 250] |
p02658 | u333286360 | 2,000 | 1,048,576 | Given 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()))\nmult = 1\nfor i in range(N):\n mult *= A[i]\n if mult > 1e18:\n break\n\nif mult > 1e18:\n print(mult)\nelse:\n print(-1)', 'N = int(input())\nA = list(map(int,input().split()))\nmult = 1\n \nif 0 in A:\n mult = 0\n \nfor i in range(N):\n mult *= A[i]\n if mult > 1e18:\n print(-1)\n break\n\nif mult <= 1e18:\n print(mult)'] | ['Runtime Error', 'Accepted'] | ['s360408976', 's869755274'] | [21596.0, 21640.0] | [51.0, 64.0] | [166, 195] |
p02658 | u334983390 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["n = int(input())\nnums = map(int, input().split(' '))\nresult = 1\nif min(nums) == 0:\n print(0)\nelse:\n for i in nums:\n result *= i\n if result > 10**18:\n print(-1)\n else:\n print(result)", "n = int(input())\nnums = list(map(int, input().split(' ')))\nresult = 1\nfor i in sorted(nums):\n result *= i\n if result > 10**18:\n print(-1)\n break\nelse:\n print(result)"] | ['Wrong Answer', 'Accepted'] | ['s754526682', 's783672972'] | [19504.0, 21672.0] | [54.0, 93.0] | [214, 188] |
p02658 | u335087552 | 2,000 | 1,048,576 | Given N integers 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 = input() \nl = list(map(int,arr.split(' ')))\nsum = 1\nfor i in l:\n sum *= i\n if sum >= 1e18:\n break\nif sum < 1e18:\n print(sum)\nelse:\n print(-1)", "import math\nn = int(input())\narr = input() \nl = list(map(int,arr.split(' ')))\n\n\n\n\n# print(-1)\n# break\nsum = math.prod(l)\nif sum < 1e18:\n print(sum)\nelse:\n print(-1)", "n = int(input())\narr = input() \nl = list(map(int,arr.split(' ')))\nsum = l[0]\nfor i in range(1,n):\n sum *= l[i]\n if sum >= 1e18:\n print(-1)\n break\nif sum < 1e18:\n print(sum)", "n = int(input())\narr = input() \nl = list(map(int,arr.split(' ')))\nsum = 1\nfor i in l:\n if len(str(i)) + len(str(sum)) < 18:\n sum *= i\n if sum >= 1e18:\n break\nif sum < 1e18:\n print(sum)\nelse:\n print(-1)\n", "import sys \nn = int(input())\narr = input()\nans = 1\narr = list(map(int,arr.split(' ')))\narr.sort()\nfor i in range(n):\n t = arr[i]\n ans *= t\n if (ans > 1000000000000000000):\n print(-1)\n sys.exit()\nprint(ans)\n"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s031840630', 's044274861', 's811818500', 's947556937', 's759211819'] | [23536.0, 23712.0, 23436.0, 23428.0, 23600.0] | [51.0, 2206.0, 51.0, 102.0, 94.0] | [172, 244, 183, 214, 229] |
p02658 | u338597441 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['a=int(input())\nb=map(int,input().split())\nb=[int(i) for i in b]\nc=1\nfor i in b:\n c=c*i\nif(c<10**18):\n print(c)\nelse:\n print(-1)', '\na=int(input())\nb=list(map(int,input().split()))\n\nif 0 in b:\n print(0)\n exit()\nc=1\nfor i in b:\n c*=i\n\tif(c>10**18):\n \tprint(-1)\n exit()\n \nprint(c)\n', 'a=int(input())\nb=list(map(int,input().split()))\n\nc=1\nfor i in b:\n c*=i\nif(c<10**18):\n print(c)\nelse:\n print(-1)\n', 'a=int(input())\nb=list(map(int,input().split()))\n\nif 0 in b:\n print(0)\n exit()\nc=1\nfor i in b:\n c*=i\n if(c>10**18):\n print(-1)\n exit()\n \nprint(c)\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s055825019', 's411003688', 's870172278', 's885693950'] | [21476.0, 8972.0, 21772.0, 21796.0] | [2206.0, 23.0, 2206.0, 50.0] | [136, 174, 121, 171] |
p02658 | u338904752 | 2,000 | 1,048,576 | 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\n\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nval = numpy.prod(A)\n\nprint(val)\nif val > 10**18:\n print('-1')\nelse:\n print(val)\n", 'N = int(input())\nA = sorted(list(map(int, input().split())))\n\nvt = 1\n\nfor v in A:\n if v == 0:\n print(0)\n exit(0)\n if v > 10**18:\n print(-1)\n exit(0)\n vt *= v\n if vt > 10**18:\n print(-1)\n exit(0)\n\nprint(vt)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s367523114', 's530579567'] | [40152.0, 21660.0] | [168.0, 78.0] | [162, 265] |
p02658 | u340249922 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\na_list = [int(_c) for _c in input().split(" ")]\n\nres = 1\nfor a in a_list:\n res = res * a\n\nif res > 10 ^ 18:\n print(-1)\nelse:\n print(res)', 'N = int(input())\na_list = [int(_c) for _c in input().split(" ")]\na_list = sorted(a_list)\n\nres = 1\nflg = False\nfor a in a_list:\n res = res * a\n if res > 10 ** 18:\n flg = True\n break\n\nif flg:\n print(-1)\nelse:\n print(res)'] | ['Wrong Answer', 'Accepted'] | ['s257145790', 's826943594'] | [21708.0, 21652.0] | [2206.0, 84.0] | [162, 244] |
p02658 | u340461557 | 2,000 | 1,048,576 | Given N integers 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=False\nf=True\nfor i in a:\n ans*=i\n if ans>10**18:\n f=True\n break\nif f:\n print(-1)\nelse:\n print(ans)', 'n=int(input())\na=sorted(list(map(int, input().split())))\nans=1\nf=True\nfor i in a:\n ans*=i\n if ans>10**18:\n f=False\n break\nif f:\n print(ans)\nelse:\n print(-1)'] | ['Wrong Answer', 'Accepted'] | ['s219477804', 's399460812'] | [21780.0, 21652.0] | [59.0, 103.0] | [177, 182] |
p02658 | u341131717 | 2,000 | 1,048,576 | 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\n\ndef main ():\n count = int(input())\n c = list(map(int,input().split()))\n print(c)\n\n if 0 in list:\n print(0)\n\n a = reduce(mul, list)\n\n if a > 1000000000000000000:\n print('-1')\n else:\n print(a)\n\nmain()", 'from operator import mul\nfrom functools import reduce\n\ndef main ():\n count = int(input())\n c = list(map(int,input().split()))\n print(c)\n\n if 0 in list:\n print(0)\n\n a = reduce(mul, list)\n\n if a > 1000000000000000000:\n print(-1)\n else:\n print(a)\n\nmain()', 'def main ():\n count = int(input())\n c = list(map(int,input().split()))\n\n if 0 in c:\n print(0)\n return\n\n result = 1\n for a in c:\n result *= a\n if result > 1000000000000000000:\n print(-1)\n return\n\n print(result)\n\nmain()'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s267448170', 's428160554', 's956580510'] | [22592.0, 22552.0, 21648.0] | [64.0, 69.0, 49.0] | [269, 267, 245] |
p02658 | u341610067 | 2,000 | 1,048,576 | Given N integers 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 = lit(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nlimit = 10**18\n\nresult = 1\nfor value in A:\n result *= value\n if result > limit:\n result = -1\n break\n\nprint(result)', 'N = int(input())\n\nA = lit(map(int, input().split()))\n\nif 0 in A:\n print(0)\n return\n \nlimit = 10**18\n\nresult = 1\nfor value in A:\n result *= value\n if result > limit:\n result = -1\n break\n\nprint(result)', 'N = int(input())\n\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nlimit = 10**18\n\nresult = 1\nfor value in A:\n result *= value\n if result > limit:\n result = -1\n break\n\nprint(result)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s202102094', 's848145521', 's780439652'] | [8992.0, 9064.0, 21740.0] | [21.0, 24.0, 51.0] | [224, 228, 225] |
p02658 | u342062419 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = input()\nnum = list(map(int,input().split()))\nfor l in range(n):\n ans *= num[l] \n if ans >= 10**18:\n print(-1)\n return\nprint(ans)', "# %%\ndef main():\n N = input()\n A = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n ans = 1\n for a in A:\n ans *= a\n if ans >= 10**18:\n print(-1)\n return\n print(ans)\nif __name__ == '__main__':\n main()", 'num = list(map(int,input().split()))\nfor l in range(len(num)):\n ans *= num[l] \nif ans < 10**18:\n print(ans)\nelif ans >= 10**18:\n print(-1)', 'def main():\n N = input()\n A = list(map(int, input().split()))\n ans = 1\n for a in A:\n ans *= a\n if ans >= 10**18:\n print(-1)\n return\n print(ans)\nmain()', 'def main():\n N = input()\n A = list(map(int, input().split()))\n ans = 1\n for a in A:\n ans *= a\n if ans >= 10**18:\n print(-1)\n return\n print(ans)\nmain()', "# %%\ndef main():\n N = input()\n A = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n ans = 1\n for a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n return\n print(ans)\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s181446476', 's343437884', 's730849196', 's956496759', 's993824660', 's712339793'] | [8864.0, 21536.0, 9008.0, 21772.0, 21520.0, 21604.0] | [25.0, 59.0, 23.0, 55.0, 52.0, 56.0] | [152, 284, 147, 201, 201, 283] |
p02658 | u343021464 | 2,000 | 1,048,576 | Given N integers 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\nmul = 1\nif 0 in set(a): print(0)\nelse:\n iter = 0\n for i in range(n):\n mul *= a[i]\n if mul < 1e18:\n print(-1)\n break\nprint(mul) ', 'n = int(input())\na = list(map(int, input().split()))\n\nmul = 1\nfor i in range(n):\n mul *= a[i]\nprint(mul if mul < 1e18 else -1)', 'n = int(input())\na = list(map(int, input().split()))\n\nmul = 1\nif 0 in set(a): mul = 0\nelse:\n iter = 0\n for i in range(n):\n mul *= a[i]\n if mul > 1e18:\n mul = -1\n break\nprint(mul) '] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s572198592', 's594870974', 's818363365'] | [21660.0, 21576.0, 21648.0] | [60.0, 2206.0, 59.0] | [226, 129, 224] |
p02658 | u344412812 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nans = 1\nfor i in range(n):\n a = int(input())\n if ans * a > 1e18:\n ans = -1\n else:\n ans *= a\n\nprint(ans)', 'n = int(input())\nl = map(int, input().split())\nans = 1\nfor a in l:\n if ans * a > 1e18:\n ans = -1\n elif ans != -1 or a == 0:\n ans *= a\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s056780394', 's831948347'] | [12724.0, 19296.0] | [36.0, 68.0] | [143, 165] |
p02658 | u344888046 | 2,000 | 1,048,576 | Given N integers 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\nketa = 0\nfor c in range(N):\n keta += len(str(A[c])) - 1\n\nif keta >= 18:\n print("-1")\nelse:\n ans = 1\n for c in range(N):\n ans *= A[c]\n if ans > 10 ** 18:\n print("-1")\n else:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\ncount = 1\n\nif A.count(0) != 0:\n print("0")\nelse:\n for c in A:\n count *= c\n if count > 10 ** 18:\n print("-1")\n break\n \n else:\n print(count)'] | ['Wrong Answer', 'Accepted'] | ['s305029028', 's222835546'] | [21540.0, 21688.0] | [88.0, 48.0] | [277, 255] |
p02658 | u345621867 | 2,000 | 1,048,576 | Given N integers 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 = []\na = map(int,input().split())\nans = 1\nfor val in a:\n ans *= val\nif ans > 10**18:\n print("-1")\n break\nelse:\n print(ans)', 'n = int(input())\na = []\na = map(int,input().split())\na = sorted(a)\nans = 1\nfor val in a:\n ans *= val\n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s904356518', 's467234680'] | [9080.0, 21648.0] | [20.0, 85.0] | [153, 177] |
p02658 | u347116006 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int, input().split()))\nAns=1\n\nfor i in range(N):\n if A[i]==0:\n Ans=0\n break\n Ans=Ans*A[i]\n \n\nif Ans>10*18:\n Ans=-1\n \nprint(Ans)', 'N = int(input())\nA = list(map(int, input().split()))\nAns=1\n\nfor i in range(N):\n if A[i]==0:\n Ans=0\n break\n Ans=Ans*A[i]\n \nif Ans>10*18:\n Ans=-1\n \nprint(Ans)', 'N = int(input())\nA = list(map(int, input().split()))\nAns=1\n\nfor i in range(N):\n\tAns=Ans*A[i]\n\nif Ans>10*18:\n Ans=-1\nprint(Ans)', 'N = int(input())\nA = list(map(int, input().split()))\nAns=1\n\nA.sort()\nfor i in range(N):\n\tAns=Ans*A[i]\n\nif Ans>10*18:\n Ans=-1\n \nprint(Ans)', 'N=int(input())\nans=1\nA=list(map(int, input().split()))\n\nfor i in range(N):\n ans=ans*A[i]\n if ans>10**18 or ans<0:\n ans=-1\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s338167384', 's608291739', 's729599573', 's841216039', 's560690287'] | [21652.0, 21756.0, 21696.0, 21480.0, 21648.0] | [2206.0, 2206.0, 2206.0, 2206.0, 65.0] | [170, 167, 127, 139, 139] |
p02658 | u347134705 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = input()\nx = list(map(int,input().split()))\n \nz = 1\nif N == 0:\n print(0)\n \nfor a in x:\n z *= a\n if z >= 10**18:\n print(-1)\n exit()\n \nif z<10**18:\n print(z)', 'N = input()\nx = list(map(int,input().split()))\n \nz = 1\t\nfor a in x:\n z *= a\n if z >= 10**18:\n print(-1)\n break\n \nif z<10**18:\n print(z)', 'N = input()\nx = list(map(int,input().split()))\n \nz = 1\nif 0 in x:\n print(0)\n\nfor a in x:\n z *= a\n if z > 1000000000000000:\n print(-1)\n return\n \nprint(z)', 'N = input()\nx = list(map(int,input().split()))\n\nz = 1\t\nfor a in x:\n z *= a\n if z >= 10**18:\n break\n print(-1)\n \nif z<10**18\n print(z)', 'N = input()\nx = list(map(int,input().split()))\n \nz = 1\t\nfor a in x:\n z *= a\n \nif z<10**18 :\n print(z)\nelse:\n print(-1)', 'import sys\nN = input()\nx = list(map(int,input().split()))\n \nz = 1\nif 0 in x:\n print(0)\n sys.exit()\n \nfor a in x:\n z = a*z\n if z > 10**18:\n print(-1)\n sys.exit()\n \nprint(z)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s225300443', 's320745034', 's435428773', 's780750862', 's789539847', 's509782429'] | [21560.0, 21764.0, 9096.0, 8964.0, 21768.0, 21768.0] | [48.0, 47.0, 21.0, 24.0, 2206.0, 50.0] | [170, 145, 162, 143, 122, 183] |
p02658 | u347452770 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nsum = 1\na = list(map(int, input().split()))\nfor i in range(n):\n sum = sum*a[i]\n \nif sum > 1e10:\n print(-1)\nelse:\n print(sum)', 'n = int(input())\nsum = 1\nnoFlag = False\nzeroFlag = False\na = list(map(int, input().split()))\nfor i in range(n):\n if a[i] == 0:\n zeroFlag = True\nif zeroFlag == False:\n for i in range(n):\n sum = sum*a[i]\n if sum > 10 ** 18:\n noFlag = True\n break \n if noFlag == True and zeroFlag == False:\n print(-1)\n else:\n print(sum)\nelse:\n print(0)\n'] | ['Wrong Answer', 'Accepted'] | ['s012788614', 's036486461'] | [21588.0, 21484.0] | [2206.0, 59.0] | [145, 364] |
p02658 | u347600233 | 2,000 | 1,048,576 | Given N integers 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\nA = [ans*int(i) for i in input().split()]\nprint(A[-1] if A[-1] <= 10**18 else -1)', 'def prod(a):\n if 0 in a:\n return 0\n p = 1\n for ai in a:\n if p * ai <= 10**18:\n p *= ai\n else:\n return -1\n return p\n\nn = int(input())\na = list(map(int, input().split()))\nprint(prod(a))'] | ['Wrong Answer', 'Accepted'] | ['s185132116', 's147895475'] | [23232.0, 21716.0] | [63.0, 62.0] | [106, 238] |
p02658 | u349836672 | 2,000 | 1,048,576 | Given N integers 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\nAs = [int(a) for a in input().split()]\n\n\nprod = 1\noverflow_flag = False\n\nfor a in As:\n prod *= a\n\n if prod > 10*18:\n overflow_flag = True\n break\n\nif overflow_flag or prod > 10**18:\n print("-1")\nelse:\n print(prod)\n', 'N = int(input())\n\nAs = [int(a) for a in input().split()]\n\n\nprod = 1\noverflow_flag = False\n\nif 0 in As:\n print(0)\nelse:\n for a in As:\n prod *= a\n\n if prod > 10**18:\n overflow_flag = True\n break\n\n if overflow_flag:\n print("-1")\n else:\n print(prod)\n'] | ['Wrong Answer', 'Accepted'] | ['s188107779', 's371992033'] | [21648.0, 21712.0] | [51.0, 54.0] | [257, 308] |
p02658 | u350667455 | 2,000 | 1,048,576 | Given N integers 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()))\nimport functools\nimport operator\nresult = functools.reduce(operator.mul, A[0:N])\nprint(-1 if result >=10**18 else result)', 'N = int(input())\nA = list(map(int, input().split()))\nr=1\nfor n in A:\n r=r*n\n if r==0:\n print(0)\n elif r>10**18:\n print(-1)\n else:\n print(r)', 'N = int(input())\nA = list(map(int, input().split()))\nr=1\nif 0 in A:\n r=0\nfor n in A:\n r=r*n\n if r>10**18:\n r=-1\n break\nprint(r)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s080374508', 's684176133', 's252322907'] | [21640.0, 21776.0, 21784.0] | [2206.0, 2206.0, 59.0] | [174, 172, 150] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.