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
u688055251
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import functools\nimport operator\n\nn=int(input())\na=[int(i) for i in input().split()]\n\nb=functools.reduce(operator.mul,a)\n\nif b>=10**18:\n print(-1)\n \nelse:\n print(b)', 'import numpy as np\nn=int(input())\na=[int(i) for i in input().split()]\nb = np.prod(a)\n\n\nif b>=10**18:\n print(-1)\nelse:\n print(b)', 'n=int(input())\na=[int(i) for i in input().split()]\nb=1\n\nfor i in a:\n b=b*i\n if b>10**18:\n print(-1)\n break\n else:\n print(b)\n', 'n=int(input())\na=[int(i) for i in input().split()]\nb=1\na.sort()\nfor i in a:\n b=b*i\n \n if b>10**18:\n b=-1\n break\n \nprint(b)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s009091535', 's092911576', 's176288490', 's712791249']
[22484.0, 40164.0, 21656.0, 21624.0]
[2206.0, 140.0, 77.0, 96.0]
[173, 133, 154, 148]
p02658
u688203790
2,000
1,048,576
Given 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()\ns = []\nans = 1\n\nfor _ in range(n):\n s.append(map(int,input()))\n\nif 0 in s:\n print(0)\nelse: \n for i in range(n+1):\n ans *= s[i]\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit:\n \n exit:\nprint(ans)', 'n = input()\ns = []\nans = 1\n\nfor _ in range(n):\n s.append(map(int,input()))\n\nif "o" in s:\n print(0)\nelse:\n for i in range(n+1):\n ans *= s[i]\n if ans > 10**18:\n ans = -1\n break\n print(ans)', 'n = int(input())\ns = list(map(int,input().split()))\nans = 1\n\nif 0 in s:\n print(0)\nelse: \n for i in range(n+1):\n ans *= s[i]\n if ans > 10 ** 18:\n ans = -1\n break\n print(ans)\n', 'n = input()\ns = []\nans = 1\n\nfor _ in range(n):\n s.append(map(int,input()))\n\nif 0 in s:\n print(0)\nelse: \n for i in range(n):\n ans *= s[i]\n if ans > 10 ** 18:\n ans = -1\n break\n print(ans)\n', 'n = int(input())\na = [int(n) for n in input().split()]\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n if ans >= 10**18:\n break\n \nif ans ** 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\na = [int(n) for n in input().split()]\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n \nif ans < 10 ** 18:\n print(ans)\nelse:\n print(-1)\n', 'n = int(input())\ns = map(int,input().split())\nans = 1\n\nif 0 in s:\n print(0)\nelse: \n for i in range(n):\n ans *= s[i]\n if ans > 10 ** 18:\n ans = -1\n break\n print(ans)', 'n = int(input())\na = [int(n) for n in input().split()]\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n if ans => 10**18:\n exit:\n \nif ans ** 10**18:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\ns = list(map(int,input().split()))\nans = 1\n\nif 0 in s:\n print(0)\nelse: \n for i in range(n):\n ans *= s[i]\n if ans > 10 ** 18:\n ans = -1\n break\n print(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s003098162', 's054528140', 's054833317', 's076387698', 's171755756', 's205148189', 's536786797', 's540945588', 's854141896', 's133480955']
[8976.0, 9012.0, 9032.0, 21580.0, 9080.0, 205892.0, 21704.0, 19312.0, 9028.0, 21540.0]
[22.0, 24.0, 24.0, 53.0, 23.0, 2208.0, 2206.0, 46.0, 23.0, 50.0]
[210, 129, 230, 221, 237, 208, 158, 212, 212, 218]
p02658
u688219499
2,000
1,048,576
Given N integers 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\nif 0 in a:\n print(0)\n exit(0)\nfor i in a:\n count*=i\n\tif count>10**18:\n \tprint(-1)\n exit(0)\nelse:\n print(count)\n', 'n = int(input())\na = list(map(int,input().split()))\ncount = 1\nif 0 in a:\n print(0)\n exit()\nfor num in a:\n count *= num\n\tif count > 10**18:\n print(-1)\n exit()\nprint(count)\n', 'n=int(input())\nlis=list(map(int,input().split()))\ncount=1\nif 0 in lis:\n print(0)\n exit()\nfor i in lis:\n count *= i\n\tif count > 10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\nlis=list(map(int,input().split()))\ncount=1\nif 0 in lis:\n print(0)\n exit()\nfor num in lis:\n count *= num\n\tif count > 10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\na=list(map(int,input().split()))\ncount=1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n count*=i\n\tif count>10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n = int(input())\na = list(map(int,input().split()))\ncount = 1\nif 0 in a:\n print(0)\n exit()\nfor num in a:\n count *= num\n\tif count > 10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\nlis=list(map(int,input().split()))\ncount=1\nif 0 in lis:\n print(0)\n exit()\nfor i in lis:\n count *= i\n\tif count > 10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\nlis=list(map(int,input().split()))\ncount=1\nif 0 in lis:\n print(0)\n exit()\nfor i in lis:\n count*=i\n\tif count>10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\nlis=list(map(int,input().split()))\ncount=1\nif 0 in lis:\n print(0)\n exit()\nfor i in lis:\n count*=i\n\tif count > 10**18:\n \tprint(-1)\n exit()\nprint(count)\n', 'n=int(input())\na=list(map(int,input().split()))\ncount=1\nif 0 in a:\n print(0)\n exit(0)\nfor i in a:\n count*=i\n\tif count>10**18:\n \tprint(-1)\n exit(0)\nprint(count)\n', 'n=int(input())\na=list(map(int,input().split()))\ncount=1\nif 0 in a:\n print(0)\n exit(0)\nfor i in range(n):\n count=count*a[i]\n\tif count>10**18:\n \tprint(-1)\n exit(0)\nelse:\n print(count)\n', 'n=int(input())\na=list(map(int,input().split()))\ncount=1\nif 0 in a:\n print(0)\n exit(0)\nfor i in a:\n count=count*i\n\tif count>10**18:\n \tprint(-1)\n exit(0)\nelse:\n print(count)\n', 'n = int(input())\na = list(map(int,input().split()))\ncount = 1\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n count *= a[i]\n if count > 10**18:\n print(-1)\n exit()\nprint(count)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s050088206', 's375302189', 's412415249', 's487689346', 's539841537', 's546782977', 's715004003', 's826293687', 's858143151', 's907972297', 's938038684', 's965802211', 's202525566']
[8976.0, 9020.0, 9028.0, 9032.0, 8964.0, 9032.0, 8964.0, 9016.0, 9028.0, 8948.0, 9032.0, 9024.0, 21648.0]
[24.0, 18.0, 24.0, 24.0, 18.0, 20.0, 22.0, 19.0, 21.0, 22.0, 24.0, 23.0, 53.0]
[185, 186, 183, 187, 173, 187, 183, 179, 181, 175, 200, 190, 187]
p02658
u688649934
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\nusing namespace std;\nint n;\nint numbers[110];\nint result;\nint main() {\n cin >> n;\n for(int i; i<n; i++){\n cin >> numbers[i]\n }\n for(int i; i<sizeof(numbers)/sizeof(array[0]); i++){\n if(i == 0){\n cout << "0";\n }else{\n result *= numbers[i]\n }\n }\n if(result > pow(10,18.0)){\n cout << "-1"\n }else{\n cout << result\n }\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)']
['Runtime Error', 'Accepted']
['s500424120', 's287721188']
[9012.0, 21644.0]
[32.0, 64.0]
[370, 256]
p02658
u688857936
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['def main():\nN=int(input())\nA=list(map(int,input().split()))\nif A is 0:\n print(0)\n return\np=1\nfor i in A:\n p=p*i\n if p>1000000000000000000:\n print(-1)\n return\nprint(p) \nmain() \n \n', 'N=int(input())\nA=list(map(int,input().split()))\nif A is 0:\n print(0)\n return\np=1\nfor i in A:\n p=p*i\n if p>1000000000000000000:\n print(-1)\n return\nprint(p) \n \n ', 'N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\n return\np=1\nfor i in A:\n p=p*i\n if p>1000000000000000000:\n print(-1)\n return\nprint(p) \n \n \n', "def main():\n N=int(input())\n A=list(map(int,input().split()))\n if 0 in A:\n print('0')\n return\n p=1\n for i in A:\n p=p*i\n if p>1000000000000000000:\n print(-1)\n return\n print(p) \nmain() \n "]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s239460952', 's297560174', 's763621238', 's836571666']
[9000.0, 9108.0, 9036.0, 21708.0]
[24.0, 25.0, 23.0, 51.0]
[191, 172, 173, 242]
p02658
u689710606
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\nprod = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n prod *= i\n if prod >= 10**18:\n print(-1)\n exit()\n\nprint(prod)\n', 'n = int(input())\na = list(map(int, input().split()))\nprod = 1\n\nfor i in a:\n prod *= i\n\nif prod >= 10**18:\n print(-1)\nelse:\n print(prod)\n', 'n = int(input())\na = list(map(int, input().split()))\nprod = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n prod *= i\n if prod > 10**18:\n print(-1)\n exit()\n\nprint(prod)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s061515997', 's733572550', 's013135561']
[21440.0, 21764.0, 21624.0]
[52.0, 2206.0, 60.0]
[194, 145, 193]
p02658
u689890477
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['ans = 1\nfor i in a:\n ans *= i\n if ans > pow(10,18):\n print(-1)\n break\nprint(ans)\n', 'n = int(input())\na = [int(x) for x in input().split()]\nif 0 in a:\n print(0)\nelse:\n\n ans = 1\n for i in a:\n ans *= i\n if ans > pow(10,18):\n ans = -1\n break\n print(ans)\n']
['Runtime Error', 'Accepted']
['s639413173', 's452141575']
[9020.0, 21656.0]
[25.0, 75.0]
[101, 214]
p02658
u690419532
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\n\nA = list(map(int, input().split()))\n\nx = functools.reduce(operator.mul, A)\ny = 10**18\n\n\nif x > y:\n print("-1")\nelse:\n print(x)', 'N = int(input())\nA = list(map(int, input().split()))\nx = 1\ny = 10**18\n\nx = np.prod(A)\nif x > y:\n print("-1")\nelse:\n print(x)\n', "N = int(input())\nl = list(map(int,input().split()))\nl.sort()\nans = 1\nrec = True\nfor i in range(N):\n ans = ans * l[i]\n if ans > 10**18:\n rec = False\n break\n\nif rec:\n print(ans)\nelse:\n print('-1')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s578913691', 's821212380', 's014712801']
[21712.0, 21792.0, 21664.0]
[53.0, 51.0, 91.0]
[150, 131, 220]
p02658
u690536347
2,000
1,048,576
Given N integers 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\nINF = 10**18\n*a, = map(int, input().split())\n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n ans *= i\n print(ans)\n if ans>INF:\n print(-1)\n break\n else:\n print(ans)', 'N = int(input())\nans = 1\nINF = 10**18\n*a, = map(int, input().split())\n\nif 0 in a:\n print(0)\nelse:\n for i in a:\n ans *= i\n if ans>INF:\n print(-1)\n break\n else:\n print(ans)']
['Wrong Answer', 'Accepted']
['s215954411', 's245494540']
[21412.0, 21672.0]
[76.0, 60.0]
[241, 222]
p02658
u690833702
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n\nfor i in N:\n ans *= A[i]\n \nif ans > 10 ** 18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n \nfor i in N:\n ans *= A[i]\n \nif ans > 10**18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n \nfor i in N:\n ans *= A[i]\n \n if ans > 10 ** 18:\n print(-1)\n return \n \n\n \nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nfor i in N:\n ans *= A[i]\n \nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n \nans = 1\n \nfor i in A:\n ans *= i\n \n if ans > 10 ** 18:\n print(-1)\n return \n \n \n \nprint(ans)', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n \n if 0 in A:\n print(0)\n return\n \n ans = 1\n \n for i in A:\n ans *= i\n \n if ans > 10 ** 18:\n print(-1)\n return \n \n print(ans) \n\nmain() ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s504362754', 's630519693', 's667466126', 's699916174', 's902510817', 's767066750']
[21560.0, 21656.0, 8692.0, 21696.0, 9012.0, 21764.0]
[54.0, 54.0, 25.0, 51.0, 24.0, 59.0]
[136, 125, 154, 93, 152, 287]
p02658
u691018832
2,000
1,048,576
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\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\nn = int(readline())\na = list(map(int, readline().split()))\na.sort()\nans = 1\nfor aa in a:\n ans *= aa\n if ans > 10 ** 18:\n print(-1)\n exit()\nprint(len(str(ans)))\n', "def main():\n import sys\n read = sys.stdin.buffer.read\n readline = sys.stdin.buffer.readline\n readlines = sys.stdin.buffer.readlines\n sys.setrecursionlimit(10 ** 7)\n\n n = int(readline())\n a = list(map(int, readline().split()))\n a.sort()\n ans = 1\n for aa in a:\n ans *= aa\n if ans > 10 ** 18:\n print(-1)\n break\n else:\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s142713592', 's564988620']
[20052.0, 20176.0]
[98.0, 76.0]
[328, 443]
p02658
u692453235
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nfor i in A:\n if ans <= 10**18:\n ans *= i\n else:\n break\n\nif ans <= 10*18:\n print(ans)\nelse:\n print(-1)', '\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nFlag = False\n\nif 0 in A:\n Flag = True\nelse:\n for i in A:\n if ans <= 10**18:\n ans *= i\n else:\n break\n\nif Flag:\n print(0)\nelif ans <= 10**18:\n print(ans)\nelse:\n print(-1)']
['Wrong Answer', 'Accepted']
['s251149873', 's329006373']
[21776.0, 21700.0]
[53.0, 52.0]
[174, 252]
p02658
u692620306
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(len(a)):\n print(a[i])\n if a[i] == 0:\n print(0)\n exit()\n\nans = a[0]\nfor i in range(1, len(a)):\n ans *= a[i]\n if ans > 1000000000000000000:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(len(a)):\n if a[i] == 0:\n print(0)\n exit()\n\nans = a[0]\nfor i in range(1, len(a)):\n ans *= a[i]\n if ans > 1000000000000000000:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s821385291', 's264290454']
[21540.0, 21792.0]
[95.0, 58.0]
[275, 259]
p02658
u693007703
2,000
1,048,576
Given N integers 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 = [int(i) for i in input().split()]\n\nborder_num = 10 ** 18\n\n\nif 0 in nums:\n output = 0\nelse :\n output = 1\n for _ in nums :\n output *= _\n if output >= border_num:\n output = -1\n break\n \nprint(output)', 'N = int(input())\nnums = [int(i) for i in input().split()]\n\nborder_num = 10 ** 18\n\n\nif 0 in nums:\n output = 0\nelse :\n output = 1\n for _ in nums :\n output *= _\n if output > border_num:\n output = -1\n break\n \nprint(output)']
['Wrong Answer', 'Accepted']
['s352369583', 's996357776']
[21584.0, 21604.0]
[60.0, 51.0]
[275, 274]
p02658
u693173434
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\na=list(map(int, input().split()))\nans=1\nfor i in range(n):\n ans*=a[i]\n\nif ans>=10**18:\n print(-1)\nelse:\n print(ans)', 'n=int(input())\na=list(map(int, input().split()))\n\nans=1\ni=0\nwhile ans<=10**18:\n ans*=a[i]\n i+=1\n \nif ans>10**18:\n print("-1")\nelse:\n print(ans)', 'n=int(input())\na=list(map(int, input().split()))\n\n\nif 0 in a:\n print(0)\nelse:\n ans=1\n i=0\n while ans<=10**18 and i<n:\n ans*=a[i]\n i+=1\n\n if ans>10**18:\n print("-1")\n else:\n print(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s333654637', 's633425198', 's144071333']
[21648.0, 21792.0, 21652.0]
[2206.0, 49.0, 49.0]
[139, 158, 229]
p02658
u693933222
2,000
1,048,576
Given N integers 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()))\nfor i in a:\n ans *= a[i]\nif ans > 10**18:\n print("-1")\nelse:\n print(ans)', 'n = int(input())\nans = 1 \na = list(map(int,input().split()))\nfor i in range(n):\n ans *= i\nif ans > 10**18:\n print("-1")\nelse:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in a:\n ans *= i\n if (ans > 10 ** 18):\n print(-1)\n ans = -1\n exit()\n #break\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s006588939', 's627528418', 's045115431']
[21788.0, 21480.0, 21508.0]
[48.0, 58.0, 50.0]
[136, 140, 245]
p02658
u694951525
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reversed=True)\nres = 1\nfor a in A:\n res *= a\n if res > 1e18:\n print(-1)\n sys.exit()\nprint(res)', 'import sys\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\nres = 1\nfor a in A:\n res *= a\n if res > 1e18:\n print(-1)\n sys.exit()\nprint(res)']
['Runtime Error', 'Accepted']
['s589994881', 's609750746']
[21564.0, 21636.0]
[54.0, 93.0]
[173, 160]
p02658
u695474809
2,000
1,048,576
Given N integers 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 = list(map(int,input().split()))\nx = 1\n\nfor i in range(n):\n x *= list[i]\n\nif x>1000000000000000000:\n print(-1)\n \nelse:\n print(x)', 'N=int(input())\nnumber=list(map(int,input().split()))\nans=1\nif 0 in number:\n print(0)\n exit(0)\n \nfor i in range(N):\n ans *= number[i]\n if ans>1000000000000000000:\n print(-1)\n exit(0)\nprint(ans)']
['Runtime Error', 'Accepted']
['s716639938', 's795797791']
[21568.0, 21776.0]
[51.0, 56.0]
[161, 221]
p02658
u696469748
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans = ans * i\n\nif ans >= pow(10, 18):\n print('-1')\nelse:\n print(ans)", "n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n ans = ans * i\n if ans >= 1000000000000000000:\n \t break\n if ans >= 1000000000000000000:\n print('-1')\n else:\n print(ans)", "n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\n\nif ans >= pow(10, 18):\n print('-1')\nelse:\n print(ans)", "n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nfor i in a:\n ans = ans * i\n if ans >= 1000000000000000000:\n \tbreak:\n\nif ans >= 1000000000000000000:\n print('-1')\nelse:\n print(ans)", "n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nfor i in a:\n ans = ans * i\n\nif ans >= pow(10, 18):\n print('-1')\nelse:\n print(ans)", "n = int(input())\na = [int(i) for i in input().split()]\nans = 1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n ans = ans * i\n if ans > 1000000000000000000:\n \t break\n if ans > 1000000000000000000:\n print('-1')\n else:\n print(ans)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s048126550', 's072900165', 's463054191', 's530565203', 's671666299', 's090911130']
[21780.0, 21584.0, 21788.0, 9024.0, 21648.0, 21588.0]
[2206.0, 55.0, 2206.0, 22.0, 2206.0, 56.0]
[145, 240, 140, 200, 147, 238]
p02658
u696684809
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import numpy as np\n \nN = int(input())\nA = list(map(int, input().split())) \na = 1\nif 0 in A:\n\tprint(0)\nfor i in range(N):\n a = a*A[i] \n\tif (a > 10**18):\n \ta = -1\n return\nprint(a)', 'import numpy as np\n \nN = int(input())\nA = list(map(int, input().split())) \na = 1\nif 0 in A:\n\tprint(0)\nfor i in range(N):\n a *= *A[i] \n if (a > 10**18):\n \ta = -1\nprint(a)', 'n = int(input())\na = list(map(int,input().split()))\nwa = 1\nka = 0\nif(a.count(0)>=1):\n print(0)\n ka +=1\nelse:\n for i in range(n):\n wa = wa*a[i]\n if(wa>10**18):\n print("-1")\n ka +=1\n break\nif(ka==0):\n print(wa)\n\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s032989525', 's475143195', 's858368110']
[9028.0, 9028.0, 21600.0]
[23.0, 23.0, 61.0]
[183, 173, 235]
p02658
u697323362
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=int(input())\nA=list(map(int,input().split()))\nresult=A[0]\nfor i in range(1,N)\n result=result*A[i]\nif result>10**18:\n print(-1)\nelse:\n print(result)\n', 'N=int(input())\nA=list(map(int,input().split()))\nsorted(A)\nresult=1\nif 0 in A:\n result=0\nfor i in A:\n if result==0:\n break\n result*=i\n if result>1000000000000000000:\n result=-1\n break\n\nprint(result)\n']
['Runtime Error', 'Accepted']
['s160186593', 's924519705']
[8996.0, 21568.0]
[21.0, 80.0]
[159, 231]
p02658
u697386253
2,000
1,048,576
Given N integers 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\nif 0 in a:\n print(0)\n quit()\n \nfor i in range(n):\n ans *= a[i]\n\nif ans >= 1e18:\n print(-1)\nelse:\n print(ans)', 'import sys\nn = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n print(0)\n sys.exit()\n \nfor i in range(n):\n ans *= A[i]\n if ans > 1e18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s252323782', 's408720610']
[21712.0, 21656.0]
[2206.0, 49.0]
[177, 195]
p02658
u697559326
2,000
1,048,576
Given N integers 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())\nlimit = 10**18+1\n\nmul = 1\nif 0 in A:\n print("0")\nelse:\n for i in A:\n mul *= i\n if mul >= limit:\n print("-1")\n break\n if mul < limit:\n print(mul)\n', 'N = int(input())\nA = list(map(int, input().split()))\nlimit = 10**18+1\n\nmul = 1\nif 0 in A:\n print("0")\nelse:\n for i in A:\n mul *= i\n if mul >= limit:\n print("-1")\n break\n if mul < limit:\n print(mul)\n']
['Wrong Answer', 'Accepted']
['s242643148', 's342022333']
[19516.0, 21580.0]
[50.0, 51.0]
[244, 250]
p02658
u697641414
2,000
1,048,576
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 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 if 0 in A: \n print (0)\n return\n prod = 1 \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1) \n return\n print(prod) \n\nmain()\n']
['Runtime Error', 'Accepted']
['s355787336', 's903557425']
[8996.0, 21628.0]
[24.0, 51.0]
[268, 275]
p02658
u698264594
2,000
1,048,576
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\ntimes= int(input())\na= 1\nif 0 in times:\n print(0)\nfor i in list(map(int, input().split())):\n a*= i\n if a > 10**18:\n print('-1')\nelse:\n print(a)", '#coding: utf-8\ntimes= int(input())\na= 1\nfor i in list(map(int, input().split())):\n a*= i', "#coding: utf-8\ntimes= int(input())\nnums= list(map(int, input().split()))\na= 1\nif 0 in nums:\n print(0)\n exit()\nfor i in nums:\n a*= i\n if a > 10**18:\n print('-1')\n exit()\nelse:\n print(a)"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s027614950', 's043933019', 's144662572']
[9116.0, 21780.0, 21648.0]
[23.0, 2206.0, 48.0]
[165, 89, 195]
p02658
u699008198
2,000
1,048,576
Given N integers 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, input().split() )\n\nret = 1\nfor a in A:\n ret *= a\n if a == 0:\n ret = 0\n break\n if a > 10 ** 18:\n ret = -1\n break\nprint( ret )', 'n = int( input().split() )\nA = list( map( int, input().split()))\n\nif 0 in A:\n print( 0 )\nelse:\n ret = 1\n for a in A:\n ret *= a\n if ret > 10 ** 18:\n ret = -1\n break\n print( ret )\n', 'n = int( input() )\nA = list( map( int, input().split() ))\n\nif 0 in A:\n print( 0 )\nelse:\n ret = 1\n for a in A:\n ret *= a\n if ret > 10 ** 18:\n ret = -1\n break\n print( ret )']
['Runtime Error', 'Runtime Error', 'Accepted']
['s057814313', 's935254061', 's770753330']
[19380.0, 9116.0, 21656.0]
[33.0, 23.0, 52.0]
[173, 198, 190]
p02658
u700526568
2,000
1,048,576
Given 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()\nlines = input()\nline = [int(i) for i in lines.split(' ')]\nsum = 1\nfor i in line:\n if sum > 1.0 * 10^18:\n sum = -1\n break\n else:\n sum = sum * i\nprint(sum)\n", "n = input()\nlines = input()\nlines = [int(i) for i in lines.split(' ')]\nsum = 1\nif 0 in lines:\n\tprint(0)\nelse:\n\tfor i in lines:\n\t\tsum = sum * i\n\t\tif sum > 10**18:\n\t\t\tsum = -1\n\t\t\tbreak\n\tprint(sum)"]
['Runtime Error', 'Accepted']
['s594966207', 's036036930']
[8952.0, 23440.0]
[22.0, 53.0]
[178, 194]
p02658
u702018889
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import operator as op\nn=int(input())\na=list(map(int,input().split()))\nans=reduce(operator.mul,a,1)\nif ans>10**18:\n anscheck=False\nelse:\n anscheck=True\nprint(ans if anscheck else -1)', 'import numpy as np\nn=int(input())\na=list(map(int,input().split()))\nans=1\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n ans=ans*a[i]\n if ans>10**18 and not 0 in a:\n print(-1)\n exit()\nif ans>10**18:\n anscheck=False\nelse:\n anscheck=True\nprint(ans if anscheck else -1)']
['Runtime Error', 'Accepted']
['s046692578', 's073017500']
[22356.0, 40052.0]
[50.0, 139.0]
[187, 295]
p02658
u702399883
2,000
1,048,576
Given N integers 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()))\ncal=1\ni=0\nnew_A=A.sort()\nif A[0]==0:\n cal==0\nelse:\n while i < len(A):\n cal*=A[i]\n i+=1\n if cal>=10**18:\n print(-1)\n else:\n print(cal)\n', 'N=int(input())\nif N>=2 and N<=10**5:\n array=list(map(int,input().strip().split()))\n if array[0]>=0 and array[-1]<=10**18:\n multipul=1\n for i in len(array-1):\n multipul=multipul*array[i]\n print(multipul)', 'N=int(input())\nif N>=2 and N<=10**5:\n array=list(map(int,input().strip().split()))\n if range(array)==N:\n if array[0]>=0 and array[-1]<=10**18:\n multipul=1\n for i in len(array-1):\n multipul=multipul*array[i]\n print(multipul)', 'N=int(input())\nA=list(map(int, input().split()))\ncal=1\ni=0\nwhile i < len(A):\n cal*=A[i]\n i+=1\nif cal>=10**18:\n print(-1)\nelse:\n print(cal)\n', 'N=int(input())\nif N>=2 and N<=10**5:\n array = list(map(int, input().strip().split()))\n if N==len(array):\n if array[0]>=0 and array[-1]<=10**18:\n mul=1\n for index,number in enumerate(array):\n mul*=array[index]\n if mul>=10**18:\n print(-1)\n else:\n print(mul)\n\n', 'N=int(input())\nA=list(map(int, input().split()))\nif N>=2 and N<=10**5:\n cal=1\n for i in range(N):\n cal*=A[i]\n if cal>=10**18:\n print(-1)\n else:\n print(cal)\n\n\n', 'N=int(input())\nif N>=2 and N<=10**5:\n array = list(map(int, input().strip().split()))\n if N==len(array):\n if array[0]>=0 and array[-1]<=10**18:\n mul=1\n for i in array:\n mul*=array[i-1]\n if mul>=10**18:\n print(-1)\n else:\n print(mul)', 'N=int(input())\nA=list(map(int, input().split()))\ncal=1\ni=0\nwhile i <= range(N):\n cal*=A[i]\n i+=1\nif cal>=10**18:\n print(-1)\nelse:\n print(cal)\n\n', 'N=int(input())\nif N>=2 and N<=10**5:\n array = list(map(int, input().strip().split()))\n if N==len(array):\n if array[0]>=0 and array[-1]<=10**18:\n mul=1\n for index,number in enumerate(array):\n mul*=array[index]\n if mul>=10**18:\n print(-1)\n else:\n print(mul)\n\n', 'n = int(input())\nm = list(map(int, input().split()))\nans = 1\nif min(m) == 0:\n print(0)\nelse:\n m.sort(reverse=True)\n for i in m:\n ans *= i\n if ans > 1000000000000000000:\n ans = -1\n break\n print(ans) ']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s217951263', 's218521214', 's243008769', 's297493359', 's306329540', 's392048164', 's612024597', 's786164640', 's818244190', 's764491212']
[21748.0, 21780.0, 21648.0, 21732.0, 21788.0, 21764.0, 21724.0, 21632.0, 21768.0, 21788.0]
[2206.0, 51.0, 46.0, 2206.0, 2206.0, 2206.0, 51.0, 52.0, 2206.0, 64.0]
[223, 240, 284, 159, 358, 191, 332, 163, 358, 246]
p02658
u704287489
2,000
1,048,576
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 = input()\nMul = np.prod(list(map(int, input().split())))\nif Mul < 10**18:\n print(Mul)\nelse:\n print("-1")', 'import numpy\nN = int(input())\nls = input().split()\nMul = numpy.prod(ls)\nif Mul < 10**18:\n print(Mul)\nelse:\n print("-1")', 'N = int(input())\nls = list(map(int,input().split()))\nmul = 1\nif 0 in ls:\n print(0)\nelse:\n for i in range(N):\n mul *= ls[i]\n if mul > 10**18:\n print(-1)\n quit()\n print(mul)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s136779269', 's816789048', 's052273781']
[40292.0, 51364.0, 21600.0]
[146.0, 149.0, 51.0]
[127, 121, 216]
p02658
u704563784
2,000
1,048,576
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())\ndata = list(map(int, input().split()))\ndata = np.array(data)\nans = np.prod(data)\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'import numpy as np\nn = int(input())\ndata = list(map(int, input().split()))\nif 0 in data:\n print(0)\n exit()\nans = 1\nfor a in data:\n ans*=a\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s690704837', 's690895035']
[39888.0, 40208.0]
[141.0, 141.0]
[158, 213]
p02658
u705418271
2,000
1,048,576
Given N integers 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=1\nfor i in range(n):\n a*=A[i]\n if a>10**18\n print(-1)\n exit()\n\nprint(a)', 'n=int(input())\nA=list(map(int,input().split())\nans=1\nfor i in A:\n ans*=i\n if ans>10**18:\n print(-1)\n exit()\n\nprint(ans)', 'n=int(input())\nans=1\nfor i in range(n):\n x=int(input())\n ans*=x\n\nif ans<=10**18:\n print(ans)\nelse:\n print(-1)', '=int(input())\nA=list(map(int,input().split()))\nx=1\nflag=0\nA.sort()\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(n):\n x*=A[n-i-1]\n if x>10**18:\n print(-1)\n flag=1\n exit()\n else:\n continue\n\nif flag==0:\n print(x)', 'n=int(input())\nA=list(map(int,input().split())\nans=1\nfor i in A:\n ans*=i\n if ans>10**18:\n print(-1)\n exit()\n\nprint(ans)\n', 'n=int(input())\nA=list(map(int,input().split()))\nx=1\nA.sort()\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(n):\n x*=A[n-i-1]\n if x>10**18:\n print(-1)\n exit()\n else:\n continue\n\nprint(x)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s126633684', 's295520177', 's476164574', 's853533829', 's884686625', 's485563816']
[8980.0, 8908.0, 12800.0, 9008.0, 8904.0, 21792.0]
[25.0, 25.0, 36.0, 26.0, 26.0, 76.0]
[124, 125, 113, 227, 124, 196]
p02658
u706414019
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA =list(map(int,input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >= 10**18:\n break\n \nprint(-1 if ans>=10**18 else ans)\n', 'import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA =list(map(int,input().split()))\nans = 1\nif 0 in A:\n ans=0\nelse:\n for i in range(N):\n ans *= A[i]\n if ans >= 10**18:\n break\n \nprint(-1 if ans>=10**18 else ans)\n', 'import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA =list(map(int,input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\n\n \nprint(-1 if ans>=10**18 else ans)\n', 'import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA =list(map(int,input().split()))\nans = 1\nif 0 in A:\n ans=0\nelse:\n for i in range(N):\n ans *= A[i]\n if ans >= 10**18:\n break\n \nprint(-1 if ans>10**18 else ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s087000015', 's435900753', 's501175211', 's013379545']
[21548.0, 21704.0, 21560.0, 21808.0]
[55.0, 56.0, 2206.0, 56.0]
[208, 251, 173, 250]
p02658
u707567014
2,000
1,048,576
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())\ns = list(map(int,input().split()))\nmod = 10**18\ncus = a//2\nnum =1\nif cus %2 ==0:\n for i in range(cus):\n num = num *s[i] * s[-i-1]\nelse:\n for i in range(cus):\n num = num *s[i] * s[-i-1]\n num *= s[cus]\nif num > mod:\n print(-1)\n exit()\nprint(num)\n\n', 'a = int(input())\ns =list(map(int,input().split()))\nmod = 10 **18\nans = 1\nif 0 in s:\n print(0)\n exit()\nfor i in s:\n ans = ans *i\n if ans > 1e18:\n print(-1)\n exit()\nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s490998962', 's731326901']
[21488.0, 21600.0]
[2206.0, 60.0]
[291, 197]
p02658
u709799578
2,000
1,048,576
Given N integers 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\nmaxval = 10 ** 18\nans = 1\n\nfor i in a:\n if i <= maxval:\n ans = -1\n break\n \n if ans <= maxval:\n ans *= i\n else:\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\na = [int(x) for x in input().split()]\n\nmaxval = 10 ** 18\nans = 1\n\nfor i in a:\n if i >= maxval:\n ans = -1\n break\n\n if ans >= maxval:\n ans *= i\n else:\n ans = -1\n break\n\nprint(ans)\n', 'n = int(input())\na = [int(x) for x in input().split()]\n\nmaxval = 10 ** 18\nans = 1\n\n\nfor i in range(n):\n ans *= a[i]\n if ans > maxval:\n ans = -1\n break\n \nif 0 in a:\n ans = 0\n \nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s027151135', 's980457274', 's300120315']
[21620.0, 21664.0, 21584.0]
[53.0, 52.0, 56.0]
[242, 239, 214]
p02658
u709970295
2,000
1,048,576
Given N integers 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())))\nm = 1\nthreshold = 1e18\nfor i in a:\n m *= i\n if m >= threshold:\n m = -1 \n break\nprint(m)', 'n = int(input())\na = list(map(int,input().split()))\nm = 1\nthreshold = 1e18\nfor i in a:\n m *= i\n if m >= threshold:\n m = -1\n break\nprint(m)', 'n = int(input())\na = sorted(list(map(int,input().split())))\nm = 1\nthreshold = 1e18\nfor i in a:\n m *= i\n if m > threshold:\n m = -1 \n break\nprint(m)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s170181700', 's909520719', 's855406285']
[21712.0, 21396.0, 21332.0]
[96.0, 58.0, 91.0]
[168, 158, 167]
p02658
u710269914
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['t = int(input())\nlist_v = list(map(int,input().split()))\n \nres = 1\nfor v in list_v:\n if v == 0:\n return 0\n res = res * v\n if res > 10**18:\n res = -1\n break\nprint(res)', 'import math \nt = int(input())\nlist_v = [int(x) for x in input().split()]\n\nres = float(math.prod(list_v))\n\nif res > math.pow(10,18):\n\tprint(-1)\nelse:\n\tprint(res)\n ', 't = int(input())\nlist_v = list(map(int,input().split()))\n\nres = 1\nfor v in list_v:\n if v = 0:\n return 0\n res = res * v\n if res > 10**18:\n res = -1\n break\nprint(res)', 't = int(input())\nlist_v = list(map(int,input().split()))\n \nres = 1\nif 0 in list_v:\n res = 0\nelse:\n for v in list_v:\n res *= v\n if res > 10**18:\n res = -1\n break\nprint(res)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s101801007', 's496276740', 's786756581', 's099812180']
[9084.0, 22496.0, 8920.0, 21644.0]
[23.0, 2206.0, 24.0, 49.0]
[178, 163, 176, 189]
p02658
u712029088
2,000
1,048,576
Given N integers 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()))\ntemp = 1\n\nfor i in range(n):\n temp = temp * a[i]\n\nif temp >= 10**18:\n print(-1)\n exit()\n\nprint(temp)', "import numpy as np\n\nn = int(input())\na = list(map(int, input().split()))\nb = np.array(a, dtype=np.float128)\n\ntemp = b.prod()\n\nif temp > 10**18 or temp < 0:\n print('-1')\n exit()\n\nprint(temp)", 'n = int(input())\na = list(map(int, input().split()))\ntemp = 1\n\nif a.count(0) > 0:\n print(0)\n exit()\n \nfor i in range(n):\n temp = temp * a[i]\n\nif temp >= 10**18:\n print(-1)\n exit()\n\nprint(temp)', "import numpy as np\nfrom decimal import *\n \nn = int(input())\na = list(map(Decimal, input().split()))\nb = np.array(a)\ntemp = 1\n \nif a.count(0) >0:\n print(0)\n exit()\n \nfor i in range(n):\n temp = b[i] * temp\n if temp > 10**18 or temp < 0:\n print('-1')\n exit()\n \nprint(temp)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s381441159', 's579097440', 's878284390', 's913861142']
[21656.0, 39872.0, 21652.0, 47552.0]
[2206.0, 183.0, 2206.0, 259.0]
[156, 191, 198, 279]
p02658
u712239107
2,000
1,048,576
Given N integers 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()\n\nif s[0]*s[1]>10**18:\n print(s[0]*s[1])\nelse:\n print("-1")', 'N=int(input())\nA=list(map(int, input().split()))\nA=sorted(A)\nf=A[0]\nfor i in range(1,N):\n f*=A[i]\n if f>10**18:\n print(-1)\n exit()\n \nprint(f)']
['Runtime Error', 'Accepted']
['s654194598', 's240060658']
[19120.0, 21712.0]
[34.0, 90.0]
[97, 227]
p02658
u712768978
2,000
1,048,576
Given N integers 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\na.sort()\nans = 1\nabove = False\nfor x in a:\n\tans *= x\n\tif ans > 10**18:\n\t\tabove = True\n\t\tbreak\n\nif not above:\n\tprint(ans)\nelse:\n\tprint(-1)', 'n = int(input())\na = list(map(int, input().split()));\n\na.sort()\nans = 1\nabove = False\nfor x in a:\n\tans *= x\n\tif ans > 10**18:\n\t\tabove = True\n\t\tbreak\n\nif not above:\n\tprint(ans)\nelse:\n\tprint(-1)']
['Runtime Error', 'Accepted']
['s588218548', 's855547279']
[19376.0, 21704.0]
[32.0, 89.0]
[186, 192]
p02658
u715292831
2,000
1,048,576
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 -*-\nimport sys\n\n\nN, *d = map(int, open(0).read().split())\nA = 1\n\nfor O in d:\n A = A*O\n print(O)\n if A > 10 ** 18:\n A = -1\n break\n \nprint(A)', 'def main():\n\n\tN, *d = map(int, open(0).read().split())\n\n\tif 0 in d:\n \t\tprint(0)\n \t\treturn\n\n\tA = 1\n\tfor O in d:\n\t\tA *= O\n\t\t#print(O)\n\t\tif A > 1000000000000000000:\n\t\t\tprint(-1)\n\t\t\treturn\n\n\tprint(A)\n\nmain()']
['Wrong Answer', 'Accepted']
['s545971623', 's221646552']
[21700.0, 21644.0]
[73.0, 46.0]
[220, 246]
p02658
u717609000
2,000
1,048,576
Given N integers 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\nkey=0\nfor i in range(len(a)):\n if a[i]==0:\n key=1\n print(0)\n break;\nif key==0:\n for i in range(len(a)):\n mul=mul*a[i]\n if mul>1000000000000000000:\n break\n if(mul<1000000000000000001):\n print(mul)\n else:\n print(-1)', 'n=int(input())\na=list(map(int,input().split()))\nmul=1\nkey=0\nfor i in range(len(a)):\n if a[i]==0:\n key=1\n print(0)\n break;\nif key==0:\n for i in range(len(a)):\n mul=mul*a[i]\n if mul>1000000000000000000:\n break\n if(mul<1000000000000000001):\n print(mul)\n else:\n print(-1)']
['Runtime Error', 'Accepted']
['s519182954', 's149612178']
[9048.0, 21568.0]
[20.0, 54.0]
[335, 339]
p02658
u717839182
2,000
1,048,576
Given N integers 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\nif 0 in A:\n return 0\n\nproduct = 1\n\nfor a in A:\n product *= a\n\n if product > 10 ** 18:\n return -1\n\n return product\n', 'def solve(A):\n if 0 in A:\n return 0\n\n product = 1\n\n for a in A:\n product *= a\n\n if product > 10 ** 18:\n return -1\n\n return product\n\n\nn = int(input())\nA = list(map(int, input().split()))\n\nprint(solve(A))']
['Runtime Error', 'Accepted']
['s924070464', 's196882539']
[9028.0, 21452.0]
[22.0, 48.0]
[169, 246]
p02658
u718765445
2,000
1,048,576
Given N integers 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)\nB = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in range(N):\n B = B*A[i]\n if B>= 10**18: \n print(-1)\n quit()\nprint(B)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nans = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in range(N):\n ans *=A[i]\n if ans>= 10**18: \n print(-1)\n quit()\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nans = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in A:\n ans *=A[i]\n if ans>= 10**18: \n print(-1)\n quit()\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nB = 1\nfor i in range(N):\n B = B*A[i]\n if B>= 10**18: \n print(-1)\n quit()\nprint(B)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nans = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in range(len(A)):\n ans *=A[i]\n if ans>= 10**18: \n print(-1)\n quit()\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nB = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in A:\n B = B*i\n if B>= 10**18: \n print(-1)\n quit()\nprint(B)', 'from functools import reduce\nN = int(input())\nA = list(map(int, input().split()))\nprint(A)\nre = reduce((lambda x, y: x * y), A)\nif re <= 10**18: \n print(re)\nelse:\n print(-1)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nB = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in A:\n B *= i\n if B> 10**18: \n print(-1)\n quit()\nprint(B)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s166305723', 's180057939', 's531492359', 's580321052', 's641241337', 's651191972', 's834119185', 's531981234']
[21708.0, 21792.0, 21796.0, 21780.0, 21764.0, 21472.0, 22796.0, 21652.0]
[79.0, 82.0, 86.0, 81.0, 75.0, 77.0, 2206.0, 80.0]
[243, 249, 242, 182, 254, 233, 179, 231]
p02658
u720065198
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n s = 1\n for i in a :\n s *= i\n if s > 10**18:\n s = -1 \n break\n print(s)\n', 'n = int()\na = list(map(int, input().split()))\ns = 1\nfor i in a[] :\n ans = s*a[i]\nif ans => 10**8:\n print("-1")\nelse:\n print(ans)', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a :\n s *= i\n if s > 10**18:\n print("-1")\n else:\n print(s)', 'n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n s = 1\n for i in a :\n s *= i\n if s > 10**18:\n s = -1 \n break\n print(s)\n', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nif 0 in a:\n prrint(0)\nelse:\n for i in a :\n s *= i\n if s > 10**18:\n print("-1")\n else:\n print(s)\n', 'n = int()\na = list[map(int, input().split())]\ns = 1\nfor i in n+1 :\n ans = s*a[i]\nif ans => 10**8:\n print("-1")\nelse:\n print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n ans = -1\n break\n print(ans)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s058078701', 's242315833', 's250884474', 's597569456', 's693663001', 's802015779', 's892613499']
[9096.0, 8872.0, 21636.0, 9012.0, 8908.0, 8948.0, 21556.0]
[24.0, 23.0, 2206.0, 23.0, 23.0, 23.0, 58.0]
[172, 131, 134, 172, 166, 132, 185]
p02658
u722102777
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nAl = list(map(int,input().split()))\nresult = 0\nfor i in Al:\n result *= i\n if result > 10**18:\n result = -1\n break\n\nprint(result)', 'N = int(input())\nAl = list(map(int,input().split()))\nresult = 1\nif 0 in Al:\n result = 0\nelse:\n for i in Al:\n result *= i\n if result > 10**18:\n result = -1\n break\n\nprint(result)']
['Wrong Answer', 'Accepted']
['s375428725', 's626276654']
[21628.0, 21348.0]
[66.0, 55.0]
[165, 218]
p02658
u722535636
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\na = 1\nL = list(map(int, input().split()))\nfor i in L:\n a *= i\n if(a > 1e18)break\n\nprint(-1 if a > 1e18 else a)\n', 'N = int(input())\na = 1\nL = list(map(int, input().split()))\nL.sort()\nfor i in L:\n a *= i\n if (a > 1e18):\n break\n\nprint(-1 if a > 1e18 else a)\n']
['Runtime Error', 'Accepted']
['s492621159', 's474125550']
[8964.0, 21660.0]
[20.0, 87.0]
[134, 154]
p02658
u723345499
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\n\na = list(map(int, input().split()))\nfor _, val in enumerate(a):\n ans *= val\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n', 'n = int(input())\n\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\nelse:\n for num, val in enumerate(a):\n ans *= val\n if ans > 10**18:\n print(-1)\n break \n else:\n print(ans)\n ']
['Runtime Error', 'Accepted']
['s689990553', 's222183856']
[21652.0, 21792.0]
[50.0, 50.0]
[149, 248]
p02658
u724012411
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a=input()\nans=1;\nok=True\nfor i in range(a):\n c=input()\n ans*=c\n if ans>1000000000000000000:\n ok=False\n break\nif ok:\n print(ans)\nelse :\n print(-1)', 'a=int(input())\nans=1;\nok=True\nfor i in range(a):\n c=int(input())\n ans*=c\n if ans>10**18:\n ans=-1\n break\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nINF=10**18\nans=1\na.sort()\nfor i in a:\n ans*=i\n if ans>INF:\n ans=-1\n break\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s231559760', 's875423855', 's256338888']
[9108.0, 12888.0, 21632.0]
[23.0, 35.0, 89.0]
[174, 137, 153]
p02658
u724742135
2,000
1,048,576
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\nN = int(stdin.readline().rstrip())\nA = [int(_) for _ in stdin.readline().rstrip().split()]\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n return\nprint(ans)', 'from sys import exit, stdin\nN = int(stdin.readline().rstrip())\nA = [int(_) for _ in stdin.readline().rstrip().split()]\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s049569857', 's505190414']
[9100.0, 21596.0]
[24.0, 53.0]
[210, 252]
p02658
u725993280
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int,input().split()))\nans = 1\n\nfor i in range(n):\n ans *= a[i]\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\na.sort()\nif a[0] == 0:\n ans = 0\n print(ans)\n exit()\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s943413008', 's270171187']
[21776.0, 21660.0]
[2206.0, 77.0]
[137, 222]
p02658
u726154863
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["n=int(input())\na=list(map(int,input().split()))\np=1\nfor i in range(0,n):\n p=p*a[i]\nif p>=10**18:\n print('-1')\nelse:\n print(p)", 'n=int(input())\na=list(map(int,input().split()))\np=1\ns=0\nt=0\nif 0 in a:\n t=1\nelse:\n t=0\nfor i in range(0,n):\n if s==0:\n p=p*a[i]\n if p>=10**18 and t==0:\n s=1\n p=-1\n else:\n continue\n else:\n break\nprint(p)', 'n=int(input())\na=list(map(int,input().split()))\np=1\ns=0\nt=0\nif 0 in a:\n t=1\nelse:\n t=0\nfor i in range(0,n):\n if s==0 or t==1:\n p=p*a[i]\n if p>=10**18:\n s=1\n p=-1\n else:\n continue\n else:\n break\nprint(p)', 'n=int(input())\na=list(map(int,input().split()))\np=1\ns=0\nfor i in range(0,n):\n if s==0:\n p=p*a[i]\n if p>=10**18:\n s=1\n p=-1\n else:\n continue\n else:\n break\nprint(p)', 'n=int(input())\na=list(map(int,input().split()))\np=1\ns=0\nt=0\nif 0 in a:\n t=1\n p=0\nelse:\n t=0\nfor i in range(0,n):\n if s==0 and t==0:\n p=p*a[i]\n if p >10**18:\n s=1\n p=-1\n else:\n continue\n else:\n break\nprint(p)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s520590844', 's887104739', 's967429289', 's986530848', 's747639948']
[21584.0, 21572.0, 21580.0, 21652.0, 21824.0]
[2206.0, 2206.0, 2206.0, 50.0, 52.0]
[134, 275, 274, 229, 283]
p02658
u726285999
2,000
1,048,576
Given N integers 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\nans = 1\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ans *= a\n print(a)\n if ans > 10**18:\n print(-1)\n break\n else:\n print(ans)', 'N = int(input())\nA = [int(x) for x in input().split()]\n\nans = 1\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n break\n else:\n print(ans)']
['Wrong Answer', 'Accepted']
['s306458126', 's161855929']
[21576.0, 21580.0]
[75.0, 52.0]
[237, 220]
p02658
u726823037
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["using System;\nusing System.Linq;\nclass program{\n static void Main(){\n int n = int.Parse(Console.ReadLine());\n long[] a = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);\n long ans = 1;\n a.Sort();\n if(a[0] == 0){\n Console.Write(0);\n return;\n }\n for(int i = 0;i<n;i++){\n if(ans*a[i] > 1e18){\n Console.Write(-1);\n \treturn;\n }\n ans *= a[i];\n }\n Console.Write(ans);\n }\n}", 'def Ii():return int(input())\ndef Mi():return map(int,input().split())\ndef Li():return list(map(int,input().split()))\nn = Ii()\na = sorted(Li())\n\nmx = 10**18\nans = 1\nfor i in a:\n \n ans *= i\n if ans > mx:\n ans = -1\n break\n elif ans == 0:\n break\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s717634677', 's679078460']
[8892.0, 21528.0]
[28.0, 84.0]
[442, 270]
p02658
u726902498
2,000
1,048,576
Given N integers 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)\nans = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in A:\n ans *= i\n if ans>= 10**18: \n print(-1)\n quit()\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\nB = 1\nif 0 in A:\n print(0)\n quit()\nelse:\n for i in A:\n B *= i\n if B> 10**18: \n print(-1)\n quit()\nprint(B)']
['Wrong Answer', 'Accepted']
['s452402515', 's462199834']
[21648.0, 21644.0]
[81.0, 79.0]
[240, 231]
p02658
u727051308
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = input().split()\nanswer = 1\nflag = 0\nfor i in range(N):\n answer *= int(A[i])\n if (answer // (10**18)) >= 1:\n print(-1)\n flag = 1\n break\nif flag == 0:\n print(answer)', 'N = int(input())\nA = input().split()\nanswer = 1\nfor i in range(N):\n answer *= int(A[i])\n \nif (answer // (10**18)) >= 1:\n print(-1)\nelse:\n print(answer)', 'N = int(input())\nA = input().split()\nanswer = 1\nflag = 0\nx = 10**18\nfor i in range(N):\n answer *= int(A[i])\n if (answer / x) >= 1:\n print(-1)\n flag = 1\n break\nif flag == 0:\n print(answer)', "N = int(input())\nA = input().split()\nanswer = 1\nflag = 0\nx = 10**18\n\nif '0' in A:\n print(0)\n flag = 1\n \n\n\nif flag == 0:\n for i in range(N):\n answer *= int(A[i])\n if answer > x:\n print(-1)\n flag = 1\n break\n\nif flag == 0: \n print(answer)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s336675177', 's423129667', 's556204225', 's417974459']
[19352.0, 19356.0, 19492.0, 19532.0]
[53.0, 2206.0, 68.0, 51.0]
[202, 155, 205, 264]
p02658
u727057618
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["def main():\n n = int(input())\n a = [int(i) for i in input().split()]\n if 0 in a:\n print('0')\n exit()\n ans = 1\n for hoge in a:\n print(ans)\n ans *= hoge\n if ans >= 10**18:\n print('-1')\n exit()\n print(ans)\n\nif __name__ == '__main__':\n main()\n\n", "import sys\ndef main():\n n = int(input())\n a = [int(i) for i in input().split()]\n if 0 in a:\n print('0')\n return\n ans = 1\n for hoge in a:\n ans *= hoge\n if ans > 10**18:\n print('-1')\n return\n print(ans)\n\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Accepted']
['s806053652', 's568725956']
[21700.0, 21640.0]
[71.0, 55.0]
[318, 307]
p02658
u727643425
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['#include <bits/stdc++.h>\n\nusing namespace std;\n\nconst double eps = 1e-9;\n\nint main() {\n ios::sync_with_stdio(false);\n cin.tie(0);\n int n;\n cin >> n;\n long long ans = 1;\n vector<long long> a(n);\n bool ok = false;\n for (int i = 0; i < n; i++) {\n cin >> a[i];\n if (a[i] == 0) ok = true;\n }\n if (ok) {\n cout << "0\\n";\n return 0;\n }\n double foo = (double)1e18;\n for (int i = 0; i < n; i++) {\n if (a[i] == 0) {\n cout << "0\\n";\n return 0;\n }\n double bar = foo / a[i];\n if (bar < 1.0 * ans) {\n cout << "-1\\n";\n return 0;\n }\n ans *= a[i];\n }\n cout << ans << \'\\n\';\n return 0;\n}', 'from math import *\nn = int(input())\na = [int(x) for x in input().split()]\nans = 1\nok = False\nfail = False\nfor x in a:\n if (x == 0):\n ok = True\n break\nfor x in a:\n if (ans * x > 1000000000000000000):\n fail = True\n break\n ans *= x\nif (ok):\n print(0)\nelse:\n if (fail):\n print("-1")\n else:\n print(ans)\n']
['Runtime Error', 'Accepted']
['s098214233', 's399119640']
[8920.0, 22704.0]
[22.0, 55.0]
[633, 322]
p02658
u727865521
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['i = 0\nif 0 in number:\n total = 0\nelse:\n while i < N:\n total *= number[i]\n i = i + 1\n if total > 10**18:\n total = -1\n break\nprint(total)', 'N = int(input())\nnumbers = [int(x) for x in input().split()]\n\nif any [x == 0 for x in numbers]:\n print(0)\nelse:\n t = numbers [0]\n for el in numbers:\n \twhile total < 10**18:\n \tt *= el \n \tif t < 10**18:\n \tprint(t)\n else:\n print(-1)', 'N = int(input())\nnumbers = [int(x) for x in input().split()]\n \nif any ([x == 0 for x in numbers]):\n t = 0\nelse:\n t = 1\n for i in numbers:\n t *= i\n if t > 10 ** 18:\n t = -1\n break\nprint(t)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s029843092', 's431051458', 's147532109']
[9052.0, 8956.0, 21732.0]
[22.0, 27.0, 66.0]
[204, 248, 232]
p02658
u729008627
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nif A[0] == 0:\n print(0)\nelse:\n ans = 1\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n ans = -1\n break\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nif A[0] == 0:\n print(0)\nelse:\n ans = 1\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n ans = -1\n break\n print(ans)']
['Wrong Answer', 'Accepted']
['s006670099', 's996394590']
[21744.0, 21592.0]
[78.0, 79.0]
[202, 200]
p02658
u729217226
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n return\n\nans = 1\nfor a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n return\n\nprint(ans)', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n ans = 1\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n return\n\n print(ans)\n\nmain()\n']
['Runtime Error', 'Accepted']
['s701624007', 's113040324']
[9108.0, 21648.0]
[26.0, 57.0]
[201, 270]
p02658
u729805651
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=int(input())\nnumlist=list(map(int,input().split()))\nresult=1\nfor x in numlist:\n result=result*x\n if result>1000000000000000000:\n print(-1)\n break\n print(result)\n', 'N=int(input())\nnumlist=list(map(int,input().split()))\nresult=1\nif 0 in numlist:\n print(0)\nelse:\n for x in numlist:\n result=result*x\n if result>10**18:\n break\n if result<=10**18:\n print(result)\n else:\n print(-1)\n']
['Wrong Answer', 'Accepted']
['s777644000', 's988512654']
[21640.0, 21620.0]
[76.0, 48.0]
[186, 262]
p02658
u730449065
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nre = 1\n\nfor i in range(n):\n m = int(input())\n \n re *= m\nif(re >= 1000000000000000000):\n print("-1")\nelse:\n print(re)', 'n =int(input())\nlimit = 10**18\nre =0\n\nl = list(map(int, input().split()))\n\nl.sort()\n\nif(l[0]) != 0):\n for i in l:\n re *= i\n if(re > limit):\n print(-1)\n exit()\n\nprint(re)\n ', 'n = int(input())\nre = 1\n\nlist = [int(s) for s in input().split()]\n \nfor i in range(n):\n re *= list[i]\n \nif(re >= 1000000000000000000):\n print("-1")\nelse:\n print(re)', 'n =int(input())\nlimit = 10**18\nre =0\n \nl = list(map(int, input().split()))\n \nl.sort()\n \nif(l[0] != 0):\n for i in l:\n re *= i\n if(re > limit):\n print(-1)\n exit()\nprint(re)', 'n = int(input())\nre = 1\n\nfor i in range(n):\n m= int(input())\n re *= m\n \nif(re > 1000000000000000000):\n print("-1")\nelse:\n print(re)', 'n =int(input())\nlimit = 10**18\nre =1\n \nl = list(map(int, input().split()))\n \nl.sort()\n#print(l)\nif(l[0] == 0):\n re = 0\nelse:\n for i in l:\n re *= i\n #print(re)\n if(re > limit):\n re = -1\n break\nprint(re)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s436594627', 's463944554', 's539369823', 's964976226', 's976889863', 's705802218']
[12772.0, 8900.0, 21652.0, 21628.0, 12888.0, 21784.0]
[31.0, 24.0, 2206.0, 82.0, 34.0, 81.0]
[142, 189, 177, 187, 146, 224]
p02658
u730747703
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nnumLi = list(map(int, input().split()))\nprod = 1\nfor i in range(len(numLi)):\n prod *= numLi[i]\n if 0 in numLi:\n prod = 0\n break\n if prod >= 10 ** 18:\n prod = -1\n break\n else:\n continue\nprint(prod)\n', 'N = int(input())\nnumLi = list(map(int, input().split()))\nprod = 1\nfor i in range(len(numLi)):\n prod *= numLi[i]\n if prod >= 10 ** 18:\n prod = -1\n break\n else:\n continue\nprint(prod)\n', 'n = int(input())\nnums = list(map(int,input().split()))\nlimit = 10**18\nres = 1\ni = 0\nif 0 in nums:\n print(0)\n exit()\nwhile i<n:\n res *= nums[i]\n i += 1\n if res > limit:\n res = -1\n break\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s431804757', 's915870003', 's087487445']
[21608.0, 21792.0, 21580.0]
[2206.0, 49.0, 50.0]
[261, 211, 224]
p02658
u730807152
2,000
1,048,576
Given 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(int())\nans = 1\ni = []\n\nlist = [i for i in input().split()]\n\nfor a in range(N-1):\n ans = ans * i[a]\n\n if ans > 10**18:\n ans = -1\n\nprint(ans)', 'N = input(int())\nans = 1\n\nlist = [i for i in input().split()]\n\nfor a in range(N-1):\n ans * i[a] = ans\n\n if ans > 10**18:\n ans = -1\n\nprint(ans)', 'N = input(int())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \nfor i in range(N-1):\n ans = ans * i\n \nif ans > 10**18:\n ans = "-1"\n \nprint(str(ans))', 'N = input(int())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \nfor a in range(N-1):\n ans = ans * i[a]\n \nif ans > 10**18:\n ans = "-1"\n \nprint(str(ans))', "N = int(input())\nans = 1\n\n\ni = [int(a) for a in input().split()]\n\nif '0' in i:\n print(0)\n return\n\n for b in range(N):\n ans = ans * i[b]\n \n if ans > 10**18:\n ans = -1\n \nprint(ans)", 'N = input(int())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \nfor a in range(N):\n ans = ans * i[a]\n \n if ans > 10**18:\n ans = -1\n \nprint(str(ans))', 'N = int(input())\nans = 1\n \ni = []\n \ni = [int(a) for a in input().split()]\n\nif 0 in i:\n print(0)\n break\n \n\tfor b in range(N):\n \t\tans = ans * i[b]\n \n \t\tif ans > 10**18:\n \t\t \tans = -1\n \t\tbreak\n \nprint(ans)', 'N = input(int())\nans = 1\ni = []\na = int()\n \nlist = [i for i in input().split()]\n \nfor a in range(N-1):\n ans = ans * i[a]\n \nif ans > 10**18:\n ans = "-1"\n \nprint(str(ans))', 'N = input(int())\nans = 1\n\nlist = [i for i in input().split()]\n\nfor a in range(N-1):\n ans = ans * i[a]\n\n if ans > 10**18:\n ans = -1\n\nprint(ans)', 'N = input(int())\nans = 1\ni = []\n\nlist = [i for i in input().split()]\n\nfor a in range(N-1):\n ans = ans * i[a]\n\nif ans > 10**18:\n ans = -1\n\nprint(ans)', 'N = input(int())\nans = 1\n\nlist = [i for i in input().split()]\n\nfor a in range(N-1):\n ans = ans * list[a]\n\n if ans > 10**18:\n ans = -1\n\nprint(ans)', 'N = input(int())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \nfor i in range(N - 1):\n ans = ans * i\n \n if ans > 10**18:\n ans = -1\n \nprint(str(ans))', 'N = input(int())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \nfor i in range(N - 1):\n ans = ans * i\n \n if ans > 10**18:\n ans = -1\n \nprint(str(ans))', 'N = int(input())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n \n for a in range(N-1):\n ans = ans * i[a]\n \n if ans > 10**18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nans = 1\ni = []\n \nlist = [i for i in input().split()]\n\n \nfor a in range(N-1):\n ans = ans * i[a]\n \n if ans > 10**18:\n ans = -1\n \nprint(ans)', 'N = int(input())\nans = 1\n \ni = [int(a) for a in input().split()]\n \nif 0 in i:\n print(0)\n \nfor b in range(N):\n ans = ans * i[b]\n \n if ans > 10**18:\n \t 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 print("0")\n exit()\n\nfor i in a:\n ans *= i\n\n if ans > 10**18:\n print("-1")\n exit()\n \nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s022948110', 's026528559', 's194092690', 's332378043', 's354730679', 's405701617', 's448546981', 's527354819', 's529350773', 's680802627', 's683648808', 's802849398', 's837949799', 's893971297', 's934180229', 's987213600', 's422355818']
[19360.0, 9108.0, 19304.0, 19080.0, 9028.0, 19180.0, 8964.0, 19196.0, 19384.0, 19384.0, 19224.0, 19324.0, 19184.0, 8884.0, 19520.0, 8960.0, 21736.0]
[39.0, 22.0, 40.0, 36.0, 24.0, 37.0, 25.0, 41.0, 39.0, 35.0, 44.0, 38.0, 44.0, 24.0, 34.0, 23.0, 53.0]
[154, 147, 160, 163, 196, 161, 211, 173, 147, 152, 150, 162, 162, 162, 159, 187, 201]
p02658
u732061897
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['A, B = input().split()\nA = int(A)\nfb = float(B)\nB100 = int(fb * 100)\nans = A * B100\nprint(int(ans/100))', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\nA.sort(reverse=True)\nt = A.pop()\nif t == 0:\n print(0)\n exit(0)\n\nA.append(t)\n\nfor i in range(N):\n n = A[i]\n if ans * n > 10 ** 18:\n print(-1)\n exit(0)\n else:\n ans *= n\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s021155227', 's292081497']
[8888.0, 21664.0]
[28.0, 81.0]
[103, 275]
p02658
u732870425
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s434655390', 's978712381']
[21652.0, 21528.0]
[48.0, 51.0]
[151, 199]
p02658
u733581231
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\nans = 1\nn = int(input())\narr = list(map(int , input().split()))\nf = 1\nfor i in range(n):\n\tans*=arr[i]\n\tif ans >= 10**18:\n\t\tf = 0\n\t\tbreak\n\nif f: print(ans)\nelse: print(-1)\n', 'ans = 1\nn = int(input())\narr = sorted(list(map(int , input().split())))\nf = 1\nfor i in range(n):\n\tif arr[i] == 0:\n\t\tans = 0\n\t\tbreak\n\tans*=arr[i]\n\t#print(ans)\n\tif ans >= 10**18:\n\t\tf = 0\n\t\tbreak\n\nif f: print(ans)\nelse: print(-1)\n', 'input = sys.stdin.readline\nfrom collections import defaultdict\nfrom collections import OrderedDict\nfrom collections import deque\nfrom itertools import combinations\nfrom itertools import permutations\nimport bisect,math,heapq\nalphabet = "abcdefghijklmnopqrstuvwxyz"\n\nans = 1\nn = int(input())\narr = list(map(int , input().split()))\nfor i in range(n):\n\tans*=arr[i]\nif ans > 10**18:\n\tprint(-1)\nelse:\n\tprint(ans)', 'ans = 1\nn = int(input())\narr = sorted(list(map(int , input().split())))\nf = 1\nfor i in range(n):\n\tans*=arr[i]\n\t#print(ans)\n\tif ans > 10**18:\n\t\tf = 0\n\t\tbreak\n#print(ans)\nif f: print(ans)\nelse: print(-1)\n\n\n\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s636992050', 's769788407', 's881123911', 's971047918']
[21588.0, 21788.0, 9116.0, 21468.0]
[54.0, 79.0, 23.0, 97.0]
[173, 228, 406, 206]
p02658
u734065775
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["N = input()\nnums = input().split()\nres = int(nums.pop(0))\n\nif 0 in nums:\n print('0')\n return\n\nfor i in nums:\n res *= int(i)\n\nprint(res)", "import sys\nimport numpy as np\n\nN = input()\nnums = input().split()\n \nif 0 in nums:\n print('0')\n sys.exit(0)\n\nnums = [int(x) for x in nums]\nres = np.prod(nums)\n\nif res >= 1000000000000000000:\n res = -1\nprint(res)", "import sys\nimport numpy as np\n\nN = input()\nnums = input().split()\n \nif 0 in nums:\n print('0')\n sys.exit(0)\n\nnums = [int(x) for x in nums]\nres = np.prod(nums)\n\nif res >= 1000000000000000000:\n res = -1\nprint(res)", 'import sys\n \nN = input()\nnums = list(map(int, input().split()))\nres = 1\n\nif 0 in nums:\n res = 0\nelse:\n for i in nums:\n res *= i\n if res > 10 ** 18:\n res = -1\n break\nprint(res)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s551432547', 's613097080', 's689982377', 's162009913']
[9096.0, 40180.0, 39872.0, 21532.0]
[21.0, 144.0, 145.0, 50.0]
[138, 213, 213, 193]
p02658
u734169929
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import math\nA, B = input().split()\n\nprint(math.floor(int(A)*float(B)))', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n \nfor i in range(N):\n \tans *= A[i]\n\t\tif ans > 10**18:\n \t\tprint("-1")\n \tbreak\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n \nfor i in range(N):\n \tans *= A[i]\n\tif ans > 10**18:\n \tprint("-1")\n break\nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\nfor i in N:\n ans = A[i]*ans\n if ans > 10**18:\n print("-1")\n break\n print(ans)', 'import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\n\nif np.prod(A) >= 10**18:\n print("-1")\nelse:\n print(np.prod(A))', 'N = int(input())\nA = list(map(int, input().split))\nans = 1\n\nfor i in range(N):\n ans = ans*A[i]\n\nif ans >= 10**18:\n print("-1")\nelse:\n print(ans)', '\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nfor i in range(N):\n \tans *= A[i]\n\tif np.prod(A) > 10**18:\n \tprint("-1")\n break\nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\n exit()\nans=1\nfor i in A:\n ans*=i\n if ans>10**18:\n print(-1)\n exit()\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s308789882', 's352460590', 's474243354', 's497055163', 's745795224', 's875335087', 's941596679', 's025478990']
[9112.0, 8892.0, 9028.0, 21468.0, 40164.0, 12812.0, 9028.0, 21788.0]
[23.0, 19.0, 22.0, 48.0, 150.0, 25.0, 24.0, 49.0]
[70, 159, 156, 160, 141, 153, 163, 174]
p02658
u735355352
2,000
1,048,576
Given N integers 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()]\na.sort()\nans = 1\n\nfor i in a:\n ans *= i\n\n if ans > 10 ** 18:\n print(-1)\n\nprint(ans)', 'n = int(input())\na = [int(x) for x in input().split()]\na.sort()\nans = 1\n\nfor i in a:\n ans *= i\n if ans > 10 ** 18:\n print(-1)\n break\nelse:\n print(ans)']
['Runtime Error', 'Accepted']
['s027207463', 's079737049']
[8948.0, 21624.0]
[26.0, 97.0]
[147, 173]
p02658
u735542540
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nS = 110\nfor i in range(N):\n S *= A[i]\n if S > 100 ** 9:\n print("-1")\n exit()\n\nprint(S)', 'N = int(input())\nA = list(map(int,input().split()))\nS = 1\nif 0 in A:\n print("0")\n exit()\n \nfor i in range(N):\n S *= A[i]\n if S > 1000000000000000000:\n print("-1")\n exit()\n\nprint(S)']
['Wrong Answer', 'Accepted']
['s845513086', 's892688872']
[21656.0, 21656.0]
[56.0, 56.0]
[158, 209]
p02658
u737451238
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nresult = 1\nfor i in A:\n result *= i\n\ns_result = str(result)\n\nif len(s_result) > 18:\n result = "-1"\n\nprint(result)', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n result = 1\n for a in A:\n result *= a\n if result > 10**18:\n print(-1)\n return\n print(result)\n\nmain()']
['Wrong Answer', 'Accepted']
['s657615507', 's590602866']
[21700.0, 21648.0]
[2206.0, 52.0]
[171, 265]
p02658
u739253043
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['#include <bits/stdc++.h>\n\n#include <math.h>\nusing namespace std;\nusing ll = long long;\nusing ld = long double;\nusing namespace std::chrono; \n\n\n#define INT_BITS 32\n#define mod 1000000007\n\n\n\n\n#define pb push_back\n\n// #define s second\n\n#define float long double\n#define all(c) (c).begin(), (c).end()\n\n\n\n\nint32_t main()\n{\n \n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n cout.tie(0);\n \t\n// int t;\n// cin >> t;\n\n// while(t--){\n\n\n\n// }\n uint64_t linf = 1e18;\n \tint n;\n \tcin >> n;\n \tint arr[n];\n \tfo(i,0,n)cin >> arr[i];\n \tsort(arr,arr+n);\n \tuint64_t res = 1;\n \tint flag = 1;\n \tfo(i,0,n){\n \t\tif(res*arr[i] > linf){\n \t\t\tflag = 0;\n \t\t\tbreak;\n \t\t}\n \t\tres = res*arr[i];\n \t}\n \tif(flag)cout << res << endl;\n \telse cout << -1 << endl;\n\n\nreturn 0;\n}\n\n\n', '#include <bits/stdc++.h>\n\n#include <math.h>\nusing namespace std;\nusing ll = long long;\nusing ld = long double;\nusing namespace std::chrono; \n\n\n#define INT_BITS 32\n#define mod 1000000007\n\n\n\n\n#define pb push_back\n\n// #define s second\n\n#define float long double\n#define all(c) (c).begin(), (c).end()\n\n\n\n\nint32_t main()\n{\n \n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n cout.tie(0);\n \t\n// int t;\n// cin >> t;\n\n// while(t--){\n\n\n\n// }\n uint64_t linf = 1e18;\n \tint n;\n \tcin >> n;\n \tint arr[n];\n \tfo(i,0,n)cin >> arr[i];\n \tsort(arr,arr+n);\n \tuint64_t res = 1;\n \tint flag = 1;\n \tfo(i,0,n){\n \t\tif(res*arr[i] > linf){\n \t\t\tflag = 0;\n \t\t\tbreak;\n \t\t}\n \t\tres = res*arr[i];\n \t}\n \tif(flag)cout << res << endl;\n \telse cout << -1 << endl;\n\n\nreturn 0;\n}\n\n\n', '#include <bits/stdc++.h>\n\n#include <math.h>\nusing namespace std;\nusing ll = long long;\nusing ld = long double;\nusing namespace std::chrono; \n\n\n#define INT_BITS 32\n#define mod 1000000007\n\n\n\n\n#define pb push_back\n\n// #define s second\n\n#define float long double\n#define all(c) (c).begin(), (c).end()\n\n\n\n\nint32_t main()\n{\n \n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n cout.tie(0);\n \t\n// int t;\n// cin >> t;\n\n// while(t--){\n\n\n\n// }\n int linf = 1e18;\n \tint n;\n \tcin >> n;\n \tint arr[n];\n \tfo(i,0,n)cin >> arr[i];\n \tsort(arr,arr+n);\n \tuint64_t res = 1;\n \tint flag = 1;\n \tfo(i,0,n){\n \t\tif(res*arr[i] > linf){\n \t\t\tflag = 0;\n \t\t\tbreak;\n \t\t}\n \t\tres = res*arr[i];\n \t}\n \tif(flag)cout << res << endl;\n \telse cout << -1 << endl;\n\n\nreturn 0;\n}\n\n\n', 'n = int(input())\narr = list(map(int,input().split()))\nres = 1\nflag = 1\narr.sort()\ninf = int(1e18)\nfor i in range(n):\n res = res*arr[i]\n if(res > inf):\n flag = 0\n break\n \nif(flag == 0):\n print(-1)\nelse:\n print(res)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s683353968', 's934456409', 's967962391', 's082753284']
[8972.0, 8912.0, 8896.0, 21600.0]
[27.0, 26.0, 26.0, 97.0]
[1045, 1045, 1040, 223]
p02658
u739843002
2,000
1,048,576
Given N integers 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(lambda a : int(a), input().split(" ")))\nans = 1\nprint i in range(len(A)):\n ans *= A[i]\n\nprint(ans) if ans <= 10 ** 18 else print("-1")', 'N = int(input())\nA = list(map(lambda a : int(a), input().split(" ")))\nans = 1\nif A.count(0) > 0:\n ans = 0\n\nfor i in range(len(A)):\n ans *= A[i]\n if ans > 10 ** 18:\n ans = -1\n print("-1")\n break\n \nif ans != -1:\n print(ans)']
['Runtime Error', 'Accepted']
['s690312222', 's326720200']
[8808.0, 21620.0]
[26.0, 70.0]
[165, 234]
p02658
u740267532
2,000
1,048,576
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 mul2():\n n = int(input())\n nums = list(map(int,input().split()))\n limit = 10**8\n res = 1\n for num in nums:\n res *= num\n if res > limit:\n return -1\n return res\n\nif __name__ == "__main__":\n print(mul2())', 'def mul2():\n n = int(input())\n nums = list(map(int,input().split()))\n limit = 10**8\n res = 1\n for num in nums:\n res *= num\n if res > limit:\n return -1\n return res\n\nif __name__ == "__main__":\n print(mul2())', 'n = int(input())\nnums = list(map(int,input().split()))\nlimit = 10**18\nres = 1\ni = 0\nif 0 in num:\n print(0)\n exit()\nwhile i<n:\n res *= nums[i]\n i += 1\n if res > limit:\n res = -1\n break\nprint(res)', 'def mul2():\n n = int(input())\n nums = list(map(int,input().split()))\n limit = 10**18\n res = 1\n i = 0\n while i<n:\n res *= nums[i]\n i += 1\n if res >= limit:\n res = -1\n break\n return res\n\nif __name__ == "__main__":\n print(mul2())', 'def mul2():\n n = int(input())\n nums = list(map(int,input().split()))\n limit = 10**8\n res = 1\n for num in nums:\n res *= num\n if res > limit:\n return -1\n return res\n\nif __name__ == "__main__":\n print(mul2())', 'def mul2():\n n = int(input())\n nums = list(map(int,input().split()))\n limit = 10**8\n res = 1\n for num in nums:\n res *= num\n if res > limit:\n return -1\n return res\n\nif __name__ == "__main__":\n print(mul2())', 'n = int(input())\nnums = list(map(int,input().split()))\nlimit = 10**18\nres = 1\ni = 0\nif 0 in nums:\n print(0)\n exit()\nwhile i<n:\n res *= nums[i]\n i += 1\n if res > limit:\n res = -1\n break\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s405951103', 's460738160', 's474409393', 's751163237', 's810785875', 's843900572', 's138054241']
[21648.0, 21784.0, 21784.0, 21776.0, 21652.0, 21708.0, 21476.0]
[2206.0, 47.0, 47.0, 50.0, 50.0, 48.0, 54.0]
[243, 251, 223, 293, 251, 251, 224]
p02658
u741215420
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['from functools import reduce\nimport operator\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nans = reduce(operator.mul, a)\n\nprint(ans) if ans < 10**18 else print(-1)\n\n\n\n', 'def calc():\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 x in a:\n ans *= x\n if ans > 1000000000000000000:\n print(-1)\n return\n\n print(ans)\n\n\ncalc()\n']
['Wrong Answer', 'Accepted']
['s006386654', 's759962138']
[22884.0, 21564.0]
[2206.0, 55.0]
[177, 272]
p02658
u742960659
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nA = list(map(int,input().split()))\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n \nif ans <= 1e18:\n print(ans) \nelse:\n print(-1)\n', 'n=int(input())\nA=list(map(int,input().split()))\n\nans = 1\nfor i in range(n):\n ans=ans*a[i]\n \nif ans<= 10**18:\n print(ans)\n \nelse:\n print(-1)\n', 'n = int(input())\nA = list(map(int,input().split()))\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n \nif ans <= 10 ** 18:\n print(ans) \nelse:\n print(-1)\n', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\nif A[0]==0:\n print(0)\n exit()\n\nans = 1\nfor i in A:\n ans*=i\n if ans>1e18:\n print(-1)\n exit()\n\nprint(ans)\n\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s507286904', 's655485165', 's910230703', 's694768317']
[21652.0, 21596.0, 21812.0, 21664.0]
[51.0, 49.0, 51.0, 74.0]
[159, 155, 163, 192]
p02658
u743272507
2,000
1,048,576
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\ninput = stdin.readline\ndef main():\n n = int(input())\n a = list(map(int,input().split())).sort()\n if a[0] == 0:\n print(0)\n return\n ret = 1\n for i in a:\n ret *= i\n if ret > 10**18:\n print(-1)\n return\n print(ret)\nmain()', 'from sys import stdin\ninput = stdin.readline\ndef main():\n n = int(input())\n a = list(map(int,input().split()))\n a.sort()\n if a[0] == 0:\n print(0)\n return\n ret = 1\n for i in a:\n ret *= i\n if ret > 10**18:\n print(-1)\n return\n print(ret)\nmain()\n']
['Runtime Error', 'Accepted']
['s334523411', 's646924506']
[21744.0, 21724.0]
[81.0, 84.0]
[266, 271]
p02658
u743354620
2,000
1,048,576
Given N integers 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())).sort()\n\nif l[0] == 0:\n print(0)\n exit()\nres = 1\n\nfor i in l:\n res *= i\n if res > 10 **18:\n print(res)\n exit()\n print(res)', 'n = int(input())\n\nl = list(map(int, input().split()))\nl.sort()\n\nif l[0] == 0:\n print(0)\n exit()\nres = 1\n\nfor i in l:\n res *= i\n if res > 10 **18:\n print(-1)\n exit()\nprint(res)']
['Runtime Error', 'Accepted']
['s424146091', 's160401892']
[21712.0, 21620.0]
[75.0, 75.0]
[186, 185]
p02658
u744034042
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int,input().split()))\nans = 1\nfor i in a:\n ans *= i\n if ans >= 10**18:\n ans = -1\n break\nprint(ans if ans <= 10**18 else -1)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s789816679', 's794415177']
[21680.0, 21652.0]
[49.0, 50.0]
[173, 182]
p02658
u744920373
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = ii()\nA = li()\nans = 1\nfor num in A:\n if ans < 10**18 / num:\n #print(ans, 10**18 / num)\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)', "import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\n#from collections import defaultdict #d = defaultdict(int) d[key] += value\n#from collections import Counter # a = Counter(A).most_common()\n#from itertools import accumulate #list(accumulate(A))\n'''\nN = ii()\nA = li()\nans = 1\nfor num in A:\n ans *= num\n if ans > 10**18:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)\n'''\n\nN = ii()\nA = li()\nans = 1\nfor num in A:\n if ans <= 10**18 / num - 0.1:\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)", "import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\n#from collections import defaultdict #d = defaultdict(int) d[key] += value\n#from collections import Counter # a = Counter(A).most_common()\n#from itertools import accumulate #list(accumulate(A))\n'''\nN = ii()\nA = li()\nans = 1\nfor num in A:\n ans *= num\n if ans > 10**18:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)\n'''\n\nN = ii()\nA = li()\nans = 1\nfor num in A:\n if ans < 10**18 / num:\n #print(ans, 10**18 / num)\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)", "import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\n#from collections import defaultdict #d = defaultdict(int) d[key] += value\n#from collections import Counter # a = Counter(A).most_common()\n#from itertools import accumulate #list(accumulate(A))\nfrom decimal import Decimal\n'''\nN = ii()\nA = li()\nans = 1\nfor num in A:\n ans *= num\n if ans > 10**18:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)\n'''\n\n'''\nN = ii()\nA = li()\nans = 1\ninf = Decimal('1000000000000000000')\nfor num in A:\n if ans <= inf / Decimal(str(num)):\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\nprint(ans)\n'''\n\nN = ii()\nA = li()\nans = 1\nfor num in A:\n if ans < 10**18 / num:\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n \nprint(ans)", "import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\n#from collections import defaultdict #d = defaultdict(int) d[key] += value\n#from collections import Counter # a = Counter(A).most_common()\n#from itertools import accumulate #list(accumulate(A))\nfrom decimal import Decimal\n'''\nN = ii()\nA = li()\nans = 1\nfor num in A:\n ans *= num\n if ans > 10**18:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)\n'''\n\n'''\nN = ii()\nA = li()\nans = 1\ninf = Decimal('1000000000000000000')\nfor num in A:\n if ans <= inf / Decimal(str(num)):\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\nprint(ans)\n'''\n\nN = ii()\nA = li()\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor num in A:\n if ans < 10**18 / num:\n ans *= num\n else:\n print(-1)\n exit()\n \nprint(ans)", "import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\n#from collections import defaultdict #d = defaultdict(int) d[key] += value\n#from collections import Counter # a = Counter(A).most_common()\n#from itertools import accumulate #list(accumulate(A))\nfrom decimal import Decimal\n'''\nN = ii()\nA = li()\nans = 1\nfor num in A:\n ans *= num\n if ans > 10**18:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\n\nprint(ans)\n'''\n\n'''\nN = ii()\nA = li()\nans = 1\ninf = Decimal('1000000000000000000')\nfor num in A:\n if ans <= inf / Decimal(str(num)):\n ans *= num\n else:\n if 0 in A:\n print(0)\n else:\n print(-1)\n exit()\nprint(ans)\n'''\n\n\nN = ii()\nA = li()\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor num in A:\n #print(ans, 10**18 / num, 10**18//num)\n #if ans < (10**18+1) / num or ans == 10**18//num:\n if ans <= 10**18//num:\n ans *= num\n else:\n print(-1)\n exit()\nprint(ans)\n"]
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s383934626', 's531098155', 's658657115', 's892269160', 's934495816', 's228046111']
[9040.0, 21784.0, 21628.0, 23368.0, 23380.0, 23456.0]
[22.0, 57.0, 53.0, 60.0, 63.0, 55.0]
[232, 1049, 1076, 1327, 1304, 1401]
p02658
u745861782
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nnums = list(map(int, input().split()))\nsum = 1\ni = 0\nflag = 0\nupper = pow(10, 18)\nfor i in nums:\n sum *= nums[i]\n if sum > upper:\n print(-1)\n flag = 1\n break\nif flag == 0:\n print(sum)', 'n = int(input())\nnums = list(map(int, input().split()))\nsum = 1\ni = 0\nupper = pow(10, 18)\nfor i in nums:\n sum *= nums[i]\n if sum > upper:\n print(-1)\n exit()\nprint(sum)', 'n = int(input())\nnums = list(map(int, input().split()))\nsum = 1\nflag = 1\nupper = pow(10, 18)\nfor num in nums:\n sum = sum * num\n if sum > upper:\n flag = 0\n elif num == 0\n sum = 0\nif flag == 1:\n print(sum)\nelif:\n print(-1)', 'n = int(input())\nsum = 1\nfor (int i = 0; i < n; i++):\n sum = sum * int(input())\n \nif (sum > 1000000000000000000):\n print("-1")\nelse:\n print(sum)', 'n = int(input())\nsum = 1\nflag = 1\nlimit = 1000000000000000000\nnums = list(map(int, input().split()))\nfor num in nums:\n if num == 0:\n sum = 0\n break;\n if flag == 1:\n sum *= num\n if sum > limit or sum == -1:\n flag = 2\n sum = -1\nprint(sum)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s635458571', 's680314917', 's718431644', 's724595643', 's885265928']
[21592.0, 21544.0, 8852.0, 9016.0, 21572.0]
[50.0, 50.0, 23.0, 21.0, 71.0]
[214, 175, 231, 148, 254]
p02658
u746206084
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\nx=list(map(int,input().split()))\nans=1\nif 0 in x:\n print(0)\nelse:\n for i in x:\n ans*=i\n if ans>10**18:\n ans=-1\n break\n print(ans,i)\n if ans==-1:\n print("-1")\n else:\n print(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nif 0 in x:\n print(0)\nelse:\n for i in x:\n ans*=i\n if ans>10**18:\n ans=-1\n break\n if ans==-1:\n print("-1")\n else:\n print(ans)']
['Wrong Answer', 'Accepted']
['s192844872', 's503162021']
[21484.0, 21564.0]
[98.0, 54.0]
[260, 239]
p02658
u747391638
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nalist = list(map(int, input().split(" ")))\n\nresult = 1\nm = 0\nwhile result <= 10**18:\n result *= alist[m]\n m += 1\n\nif m < n or result > 10**18:\n print("-1")\nelse:\n print(result)', 'n = int(input())\nalist = list(map(int, input().split(" ")))\n\nif 0 in alist:\n print("0")\nelse:\n result = 1\n m = 0\n while result <= 10**18:\n result *= alist[m]\n m += 1\n if m < n or result > 10**18:\n print("-1")\n else:\n print(result)', 'n = int(input())\nalist = list(map(int, input().split(" ")))\n\nif 0 in alist:\n print("0")\nelse:\n result = 1\n m = 0\n while result <= 10**18 and m < n:\n result *= alist[m]\n m += 1\n if m < n or result > 10**18:\n print("-1")\n else:\n print(result)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s128372029', 's547483495', 's239235499']
[21636.0, 21648.0, 21656.0]
[49.0, 48.0, 52.0]
[197, 248, 258]
p02658
u748241164
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor i in range(N):\n ans = ans * A[i]\n if ans >= 10 ** 18:\n print("-1")\n quit()\n \nif ans >= 10 ** 18:\n print("-1")\n quit()\n\nprint(ans)\n ', 'N = int(input())\nA = list(map(int, input().split()))\nif min(A) == 0:\n ans = 0\n print(ans)\n quit()\n\nans = 1\nfor i in range(N):\n ans = ans * A[i]\n if ans > 10 ** 18:\n print("-1")\n quit()\n \nif ans > 10 ** 18:\n print("-1")\n quit()\n\nprint(ans)\n \n']
['Wrong Answer', 'Accepted']
['s137167517', 's302848091']
[21648.0, 21476.0]
[53.0, 54.0]
[209, 256]
p02658
u748311048
2,000
1,048,576
Given N integers 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()))\nm=1\nfor i in range(n):\n m*=l[i]\n print(m,i)\n if m>10**18:\n if 0 in l:\n print(0)\n exit()\n print(-1)\n exit()\n\nprint(m)', 'from decimal import Decimal\na,b=map(float, input().split())\nprint(int(Decimal(a)*Decimal(b)))', 'A,B=map(float, input().split())\nA=int(A*100)\nB=int(B*100)\nprint(int(A*B)/10000)', 'n=int(input())\nl=list(map(int, input().split()))\nm=1\nfor i in range(n):\n m*=l[i]\n if m>10**18:\n if 0 in l:\n print(0)\n exit()\n print(-1)\n exit()\n\nprint(m)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s139671300', 's589634440', 's657652817', 's037428060']
[21636.0, 9764.0, 9112.0, 21776.0]
[104.0, 25.0, 22.0, 49.0]
[217, 93, 79, 202]
p02658
u749416810
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\na=list(map(int,input().split()))\np=1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n p*=i\n if p>10**18:\n print(-1)\n break\n if p<10**18:print(p)', 'n=int(input())\na=list(map(int,input().split()))\np=1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n p*=i\n if p>10**18:\n print(-1)\n break\n if p<=10**18:print(p)\n']
['Wrong Answer', 'Accepted']
['s557916741', 's006712162']
[21536.0, 21640.0]
[53.0, 47.0]
[170, 172]
p02658
u749491107
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\ninlist = list(map(int, input().split()))\nx = 1\nif N == len(inlist): \n for A in inlist:\n x = x*A\n if x >= 10**18:\n print(-1)\n else:\n print(x)', 'n = int(input())\na = list(map(int, input().split()))\nx = 1\nif 0 in a:\n x = 0\n print(x)\nelse:\n for j in a:\n x = j*x\n if x > 10**18:\n x = -1\n break\n else:\n continue\n print(x)']
['Wrong Answer', 'Accepted']
['s268683913', 's742991377']
[21636.0, 21580.0]
[2206.0, 59.0]
[190, 238]
p02658
u749614185
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nif N>2 and N<100000:\n A = list(map(int,input().split()))\n if 0 in A:\n print (0)\n x=1\n for i in A:\n x=x*i\n if x>10**18:\n print(-1)\n exit(0)\n print(x)', 'N = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print (0)\n \nprod = 1\nfor a in A:\n prod *= a\n\nif prod>1000000000000000000:\n print (-1)\nelif prod<1000000000000000000:\n print(prod)\n', 'def main():\n N=int(input())\n A=list(map(int,input().split()))\n if 0 in A:\n print(0)\n return\n prod=1\n for a in range(N):\n prod*=a\n if prod>1000000000000000000:\n print(-1)\n return\n \n print(prod)', 'import math\nN = int(input())\nif N>2 and N<100000:\n A = list(map(int,input().split()))\n if 0 in A:\n print (0)\n \n prod = math.prod(A)\n if prod>1000000000000000000:\n print(-1)\n else:\n print(prod)\n', 'N = int(input())\nif N>2 and N<100000:\n A = list(map(int,input().split()))\n if 0 in A:\n print (0)\n x=1\n for i in A:\n x=x*i\n if x>10**18:\n print(-1)\n exit()\n print(x)', 'def main():\n N=int(input())\n A=list(map(int,input().split()))\n if 0 in A:\n print(0)\n return\n prod=1\n for a in A:\n prod*=a\n if prod>1000000000000000000:\n print(-1)\n return\n \n print(prod)', ' N=int(input())\n A=list(map(int,input().split()))\n if 0 in A:\n print(0)\n prod=1\n for a in A:\n prod*=a\n if prod>10**18:\n print(-1)\n \n print(prod)', 'N = int(input())\nif N>2 and N<100000:\n A = list(map(int,input().split()))\n if 0 in A:\n print (0)\n \n prod = 1\n for a in A:\n prod *= a\n\n if prod>1000000000000000000:\n print (-1)\n elif prod<1000000000000000000:\n print(prod)\n', 'N = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print (0)\n \nprod = 1\nfor a in A:\n prod *= a\n if prod>1000000000000000000:\n print (-1)\n else:\n print(prod)\n', 'N = int(input())\nL = input().split()\n \n \ndef mult():\n if "0" in L:\n return 0\n else:\n a = 1\n for i in L:\n a = a * int(i)\n if a > 1000000000000000000:\n return -1\n return a\n \nprint(mult())']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s106369745', 's128415988', 's339673778', 's468799713', 's521818738', 's618046191', 's620473656', 's634214208', 's686592045', 's443774603']
[21544.0, 21448.0, 9028.0, 22088.0, 21552.0, 9008.0, 8952.0, 21496.0, 21728.0, 19156.0]
[56.0, 2206.0, 30.0, 2206.0, 58.0, 27.0, 27.0, 2206.0, 2206.0, 48.0]
[227, 209, 222, 236, 226, 215, 166, 274, 199, 256]
p02658
u749643742
2,000
1,048,576
Given 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()))\nc = 1\ni = 0\nfor i in N-1:\n if c *= A[i] >= 10**18:\n print(-1)\n exit()\n \nprint(c)\n\n', 'A = list(map(int,input().split()))\nN = len(A)\nc = 1\nfor i in N-1:\n c *= A[i]\nprint(c)\nif c >= 10**18:\n print(-1)\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\ni = 0\nfor i in N-1:\n c *= A[i]:\n if c >= 10**18:\n print(-1)\n \nprint(c)\n\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\nfor i in N-1:\n c *= A[i]\n if c >= 10**18:\n print(-1)\n \nprint(c)\n\n', 'N = input() \nA = list(map(int,input().split()))\nc = 1\ni = 0\nfor i in N-1:\n if c *= A[i] >= 10**18:\n print(-1)\n else:\n print(c)\n \n\n\n', 'A = list(map(int,input().split()))\nN = len(A)\nc = 1\nfor i in N:\n c *= A[i]\n print(c)\nif c >= 10**18:\n print("-1")', 'A = list(map(int,input().split()))\nN = len(A)\nc = 1\nfor i in N:\n c *= A[i]\nprint(c)\nif c >= 10**18:\n print(-1)\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\ni = 0\nfor i in N-1:\n if c *= A[i] >= 10**18:\n print(-1)\n \nprint(c)\n\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\nfor i in N-1:\n c *= A[i]\nprint(c)\nif c >= 10**18:\nprint(-1)\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\nfor i in N-1:\n c *= A[i]\n print(c)\nif c >= 10**18:\n print(-1)\n', 'N = input() \nA = list(map(int,input().split()))\nc = 1\ni = 0\nfor i in N-1:\n if c *= A[i] >= 10**18:\n print(-1)\n exit()\n else:\n print(c)\n \n\n\n', 'N = int(input()) \nA = list(map(int,input().split()))\nc = 1\ni = 0\nfor i in N-1:\n c *= A[i]\n if c >= 10**18:\n print(-1)\n \nprint(c)\n\n', 'n=int(input())\nls=[int(s) for s in input().split(" ")]\n\nif 0 in ls:\n print(0)\nelse:\n num=1\n for i in ls:\n num*=i\n if num>10**18:\n num=-1\n break\n\n print(num)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s048743800', 's238579781', 's268549986', 's333442197', 's400167711', 's576798740', 's590309438', 's599248480', 's641343938', 's772058375', 's824440458', 's957935065', 's966395868']
[9028.0, 9176.0, 9020.0, 21716.0, 9020.0, 9180.0, 9176.0, 9028.0, 9024.0, 21780.0, 8960.0, 9036.0, 21616.0]
[23.0, 21.0, 21.0, 49.0, 22.0, 23.0, 24.0, 23.0, 22.0, 50.0, 24.0, 27.0, 52.0]
[148, 115, 141, 130, 148, 116, 113, 136, 120, 124, 161, 139, 177]
p02658
u751485759
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\n\nn = int(input())\na = list(map(int,input().split()))\na.sort()\n\nif 0 in a:\n print(0)\nelse:\n cur = 1\n for x in a:\n cur *= x\n if cur > 10 ** 18:\n print(-1)\n sys.exit()\n print(cur)\n', 'import sys\n\nn = int(input())\na = list(map(int,input().split()))\na.sort()\n\nif 0 in a:\n print(0)\nelse:\n cur = 1\n for x in a:\n cur *= a\n if cur > 10 ** 18:\n print(-1)\n sys.exit()\n print(cur)\n', 'import sys\n\nn = int(input())\na = list(map(int,input().split()))\na.sort()\n\ncur = 1\nfor x in a:\n cur *= a\n if cur > 10 ** 18:\n print(-1)\n sys.exit()\nprint(cur)\n', 'import sys\n\nn = int(input())\na_list = list(map(int,input().split()))\n\nif 0 in a_list:\n print(0)\n sys.exit()\n\ncur = 1\nfor a in a_list:\n cur *= a\n if cur > 10 ** 18:\n print(-1)\n sys.exit()\n\nprint(cur)\n ']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s136213934', 's603625975', 's999700114', 's565062995']
[21548.0, 21648.0, 21600.0, 21640.0]
[78.0, 76.0, 77.0, 50.0]
[240, 240, 178, 211]
p02658
u752898745
2,000
1,048,576
Given N integers 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=sorted(map(int,input().split()))\nans=x[0]\nfor i in range(1,n):\n ans=ans*x[i]\nprint(-1 if ans>=10**18 else ans)', 'n=int(input())\nx=sorted(map(int,input().split()))\nans=x[0]\nfor i in range(1,n):\n ans=ans*x[i]\n if ans>=10**18:\n break\nprint(-1 if ans>=10**18 else ans)', 'n=int(input())\nx=sorted(map(int,input().split()))\nans=x[0]\nlot=1\nwhile ans<10**18 and lot<n:\n ans=ans*x[lot]\n lot+=1\nprint(-1 if ans>=10**18 else ans)', 'n=int(input())\nx=sorted(map(int,input().split()))\nans=x[0]\nfor i in range(1,n):\n ans=ans*x[i]\n if ans>=10**18:\n break\nprint(-1 if ans>10**18 else ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s509075680', 's543357212', 's550187142', 's711958193']
[21588.0, 21640.0, 21524.0, 21712.0]
[2206.0, 86.0, 103.0, 92.0]
[130, 164, 156, 163]
p02658
u755801379
2,000
1,048,576
Given 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()\nlist1=map(int,input().split())\nif 0 in list1:\n print(0)\nelse:\n ans=1\n for i in list1:\n ans*=i\n if ans>1e18:\n ans=-1\n break\n print(ans)', 'n=input()\nlist1=list(map(int,input().split()))\nif 0 in list1:\n print(0)\nelse:\n ans=1\n for i in list1:\n ans*=i\n if ans>1e18:\n ans=-1\n break\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s867555465', 's513177726']
[19244.0, 21536.0]
[49.0, 56.0]
[192, 199]
p02658
u757274384
2,000
1,048,576
Given N integers 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(len(A)):\n ans = ans * A[i]\n \nif ans > 10**8:\n print("-1")\nelse:\n print(ans)', 'n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit()\n\nans = 1\nfor i in range(n):\n ans = ans*A[i]\n if ans >= 10**18:\n print(-1)\n exit()\n \nprint(ans)', 'import numpy\nn = int(input())\nA = map(int, input().split())\nans = numpy.prod(A)\nif ans > 10 ** 8:\n print(-1)\nelse:\n print(ans)', 'n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit()\n\nans = 1\nfor i in range(n):\n ans = ans*A[i]\n if ans > 10**18:\n print(-1)\n exit()\n \nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s383748684', 's484386618', 's777701208', 's653864511']
[21588.0, 21640.0, 37892.0, 21472.0]
[2206.0, 53.0, 122.0, 49.0]
[155, 189, 128, 189]
p02658
u757919796
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['from functools import reduce\n\nn = int(input())\nnums = list(map(int, input().split()))\n\nlimit = pow(10, 18)\n\nans = 1.0\nfor e in nums:\n ans *= e\n\nif ans >= limit:\n ans = -1\n\nprint(int(ans))\n', 'n = int(input())\nnums = list(map(int, input().split()))\n\nlimit = pow(10, 18)\n\nans = 1\n\nif 0 in nums:\n ans = 0\nelse:\n for e in nums:\n if ans > limit / e:\n ans = -1\n break\n else:\n ans *= e\n\nif ans > limit:\n ans = -1\n\nprint(int(ans))\n']
['Runtime Error', 'Accepted']
['s868490870', 's676525243']
[22756.0, 21640.0]
[64.0, 59.0]
[194, 287]
p02658
u758517053
2,000
1,048,576
Given N integers 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\nwhile N >0 :\n a = int(input(""))\n mul = mul * a\n N -= 1\n\n\n\n\n\nif mul > 10**18:\n print(-1)\nelse:\n print(mul)\n \n \n', 'n = int(input())\na = list(map(int, input().split()))\n \nans = 1\n \na.sort(reverse=True)\n \nif 0 not in a:\n for x in range(n):\n ans *= a[x]\n \n if ans > 10**18:\n ans = -1\n break\nelse:\n ans = 0\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s599677047', 's380758911']
[12584.0, 21540.0]
[32.0, 77.0]
[159, 242]
p02658
u759412327
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nfor a in A:\n ans*=a\n\nif ans>=10**18:\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nans = 1\n\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ans*=a \n if 10**18<ans:\n print(-1)\n break\n else:\n print(ans)', 'N = int(input())\nA = sorted(list(map(int,input().split())))\nans = 1\n\nfor a in A:\n ans*=a\n if 10**18<ans:\n ans=-1\n break\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s089639600', 's980475233', 's981615022']
[21788.0, 21652.0, 21620.0]
[2206.0, 77.0, 89.0]
[129, 188, 139]
p02658
u759718348
2,000
1,048,576
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 p = 1\n for a in A:\n p *= a\n if p >= 10 ** 18:\n print(-1)\n return\n\n print(p)\nmain()', '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 p = 1\n for a in A:\n p *= a\n if p > 10 ** 18:\n print(-1)\n return\n\n print(p)\nmain()']
['Wrong Answer', 'Accepted']
['s984388236', 's483089979']
[21784.0, 21784.0]
[48.0, 48.0]
[209, 208]
p02658
u759988921
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['res = 1\nif 0 in a:\n res = 0\nelse:\n for i in range(n):\n b = a.pop()\n if b != 1:\n res *= b\n\n if res > 1000000000000000000:\n res = -1\n break\nprint(res)', 'n = int(input())\na = list(map(int, input().split()))\nres = 1\na.sort()\nfor i in a:\n res *= i\n if res > 1000000000000000000:\n res = -1\n break\nprint(res)']
['Runtime Error', 'Accepted']
['s809858617', 's560451163']
[9048.0, 21588.0]
[21.0, 85.0]
[220, 170]