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
|
u933140383
| 2,000 | 1,048,576 |
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()))\ns=1\nif 0 in a:\n print(0)\n sys.exit()\nelse:\n for i in a:\n if s>10**18:\n s*=i\n if s>10**18:\n print(-1)\n sys.exit()\n print(s)', 'import sys\nN=int(input())\nif N>10**5 or N<2:\n sys.exit(1)\ns=1\nfor i in range(N):\n a=input().rstrip()\n s*=int(a)\nif s<10e+18:\n print(s)\nelse:\n print("-1")', 'import sys\nN=int(input())\nif N>10**5 or N<2:\n sys.exit()\na=input().split(\' \')\nif N<len(a):\n sys.exit()\ns=1\nfor i in range(N):\n s*=int(a[i])\nif s<10**18:\n print(s)\nelse:\n print("-1")', 'import sys\nN=int(input())\na=list(map(int, input().split()))\ns=1\n\nif 0 in a:\n print(0)\n sys.exit()\nelse:\n\n for i in a:\n if s<10**18:\n s*=i\n if s>10**18:\n print(-1)\n sys.exit()\n print(s)']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s478064485', 's734017859', 's777370187', 's594335975']
|
[21580.0, 12660.0, 19432.0, 21700.0]
|
[52.0, 31.0, 2206.0, 52.0]
|
[229, 168, 196, 300]
|
p02658
|
u934788990
| 2,000 | 1,048,576 |
Given N integers 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\ncnt = 1\n\nif a in 0:\n print(-1)\nelse:\n for i in range(n):\n cnt = cnt * a[i]\n\n if cnt > 10**18:\n print(-1)\n else:\n print(cnt)', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n\n if 0 in A:\n print(0)\n return\n\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n\n print(prod)\n\n\nmain()\n']
|
['Runtime Error', 'Accepted']
|
['s042751921', 's568696905']
|
[21576.0, 21664.0]
|
[52.0, 57.0]
|
[209, 274]
|
p02658
|
u935642171
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n prod = 0\n for i in A:\n prod *= i\n if prod>10**18:\n print(-1)\n break', 'N = int(input())\nA = list(map(int,input().split()))\nF = True\n\nif 0 in A:\n print(0)\nelse:\n prod = 1\n for i in A:\n prod *= i\n if prod>10**18:\n print(-1)\n F = False\n break\n if F:\n \tprint(prod)']
|
['Wrong Answer', 'Accepted']
|
['s366661157', 's186333930']
|
[21456.0, 21544.0]
|
[75.0, 66.0]
|
[167, 215]
|
p02658
|
u936050991
| 2,000 | 1,048,576 |
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 itertools import accumulate\nfrom operator import add, mul\nimport sys \ninput = sys.stdin.readline\n\n\nn = int(input())\n\na= list(map(int,input().split())) \n\n\nb = accumulate(a, mul)\n\nc = list(b)\n\n\n# b=1\n\n# b *= a[i]\n \nif c[n-1]-1 > 10**18:\n print('-1')\nelse:\n # print(b)\n print(c[n-1]-1)\n", '# import sys \n# input = sys.stdin.readline\n \n \nn = int(input())\n \na= list(map(int,input().split())) \n \ndef main(a):\n if 0 in a:\n print(0)\n return\n \n ans = 1\n for i in a:\n ans *= i \n \n if ans > 1000000000000000000:\n print(-1)\n return\n \n print(ans)\n \nmain(a)\n']
|
['Wrong Answer', 'Accepted']
|
['s331353575', 's303956275']
|
[2394212.0, 21776.0]
|
[2273.0, 51.0]
|
[324, 336]
|
p02658
|
u936493337
| 2,000 | 1,048,576 |
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()\n\nlist1 = [ a for items in list1 list1[items]=input() ]\n\n', '# a= int(input())\n# list1 =[]\n\nn = int(input())\na = list(map(int,input().split()))\n# print(a)\n# a.sort(reverse=True)\n# print(a)\nif 0 in a :\n ans = 0\n print(ans)\nelse :\n ans = 1\n for i in range(n):\n ans *= a[i]\n if ans > 10**18 :\n print(-1)\n break\nif ans <= 10**18 and ans != 0 :\n print(ans)\n']
|
['Runtime Error', 'Accepted']
|
['s768207038', 's986671174']
|
[8952.0, 21580.0]
|
[23.0, 54.0]
|
[67, 343]
|
p02658
|
u938051273
| 2,000 | 1,048,576 |
Given N integers 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()))\nw=pow(10,18)\np=1\na.sort()\nif a[0]==0:\n print(0)\nelse:\n for k in range(n):\n p*=a[k]\n if p>w:\n break\n print(p) if p<w else print(-1)', 'n=int(input())\na=list(map(int,input().split()))\nw=pow(10,18)\np=1\nfor k in range(n):\n p*=a[k]\nprint(p) if p<w else print(-1)', 'n=int(input())\na=list(map(int,input().split()))\nw=pow(10,18)\np=1\na.sort()\nif a[0]==0:\n print(0)\nelse:\n for k in range(n):\n p*=a[k]\n if p>w:\n print(-1)\n break\n if p<=w:\n print(p)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s601224029', 's780118636', 's609999144']
|
[21644.0, 21784.0, 21780.0]
|
[80.0, 2206.0, 74.0]
|
[192, 124, 199]
|
p02658
|
u938933689
| 2,000 | 1,048,576 |
Given N integers 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()\nresult=1\nfor i in range (N):\n result=result*int(s[i])\n if result>= 10**18:\n print(-1)\n break\n elif i==N-1 :\n print(result)\n\n', "N=int(input())\ns=input().split()\nresult=1\nif '0' in s:\n print(0)\nelse:\n for i in range (N):\n result=result*int(s[i])\n if result>= 10**18:\n print(-1)\n break\n elif i==N-1 and result<=10**18:\n print(result)\n\n", 'N=int(input())\ns=input().split()\nresult=1\nif 0 in s:\n print(0)\nelse:\n for i in range (N):\n result=result*int(s[i])\n if result>= 10**18:\n print(-1)\n break\n elif i==N-1 and result<=10**18:\n print(result)\n ', 'N=int(input())\ns=input().split()\nresult=1\nfor i in range (N):\n result=result*int(s[i])\n if result>= 10**18:\n print(-1)\n break\nprint(result)\n ', 'N=int(input())\ns=input().split()\nresult=1\nfor i in range (N):\n result=result*int(s[i])\n if result>= 10**18:\n print(-1)\n break\n elif i==N-1 and result<=10**18:\n print(result)', 'A, B=input().split()\nb=float(B)*100\nresult=int(A)*int(b)\nanswer=round(result/100,2)\nprint(int(answer))', "N=int(input())\ns=input().split()\nresult=1\nif '0' in s:\n print(0)\nelse:\n for i in range (N):\n result=result*int(s[i])\n if result> 10**18:\n print(-1)\n break\n elif i==N-1 and result<=10**18:\n print(result)\n\n"]
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s069857724', 's141371542', 's215768688', 's638691032', 's649602103', 's658703277', 's930074393']
|
[19384.0, 19352.0, 19312.0, 19364.0, 19372.0, 9112.0, 19484.0]
|
[52.0, 53.0, 53.0, 49.0, 54.0, 22.0, 56.0]
|
[169, 231, 234, 150, 185, 102, 230]
|
p02658
|
u939026953
| 2,000 | 1,048,576 |
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 demon():\n N = int(input())\n A = list(map(int,input().split()))\n A = sort(A)\n if A[0] == 0:\n print(0)\n return\n\n X = 1\n for i in A:\n X *= A\n if X > 10 ** 18:\n print("-1")\n return\n\n print(X)\n\ndemon()', 'def demon():\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\n X = 1\n for i in A:\n X *= i\n if X > 10 ** 18:\n print("-1")\n return\n\n print(X)\n\ndemon()']
|
['Runtime Error', 'Accepted']
|
['s423162467', 's833461332']
|
[21632.0, 21672.0]
|
[53.0, 79.0]
|
[229, 226]
|
p02658
|
u940569542
| 2,000 | 1,048,576 |
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\nN = int(input())\nx = sorted(list(map(int, input().split())))\nprint(x)\nt = 1\nfor num in x:\n t = t * num\n if t > 10 ** 18:\n print(-1)\n sys.exit()\n\nif (t > 10 ** 18): \n print(-1)\nelse:\n print(t)\n', 'import sys\ninput = sys.stdin.readline\nN = int(input())\nx = sorted(list(map(int, input().split())))\nt = 1\nfor num in x:\n t = t * num\n if t > 10 ** 18:\n print(-1)\n sys.exit()\n\nif (t > 10 ** 18): \n print(-1)\nelse:\n print(t)\n']
|
['Wrong Answer', 'Accepted']
|
['s075272122', 's224701799']
|
[21604.0, 21564.0]
|
[108.0, 93.0]
|
[256, 247]
|
p02658
|
u941438707
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n,*a=map(int,open(0).read().split())\na.sort()\nans=1\nfor i in a:\n ans*=i\n if ans>=1e18:\n print(-1)\n exit()\nprint(ans)', 'n,*a=map(int,open(0).read().split())\na.sort()\nans=1\nfor i in a:\n ans*=i\n if ans>1e18:\n print(-1)\n exit()\nprint(ans) ']
|
['Wrong Answer', 'Accepted']
|
['s972562880', 's587294860']
|
[21464.0, 21632.0]
|
[87.0, 92.0]
|
[136, 137]
|
p02658
|
u942356554
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['p=int(input())\nk=list(map(int,input().split()))\nt=1\nfor e in k:\n t = t*e\n if t>10**8:\n break\nif t>10**8:\n print(-1)\nelse:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\n\nt=1\nfor e in k:\n t = t*e\n\nif t>10**8:\n print(-1)\nelse:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\nif 0 in k:\n print(0)\nelse:\n t=k[0]\n for e in range(1,len(k)):\n t = t * k[e]\n if t > 10**8:\n break\n if t > 10**8:\n print(-1)\n else:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\nif 0 in k:\n print(0)\nelse:\n t=k[0]\n for e in range(1,len(k)):\n t = t * k[e]\n if t > 10**18:\n break\n if t > 10**8:\n print(-1)\n else:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\nif 0 in k:\n print(0)\nelse:\n t=k[0]\n for e in range(1,len(k)):\n t = t * k[e]\n \n if t > 10**8:\n print(-1)\n else:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\n\nt=k[0]\nfor e in range(1,len(k)):\n t = t * k[e]\n\nif t > 10**8:\n print(-1)\nelse:\n print(t)', 'p=int(input())\nk=list(map(int,input().split()))\nif 0 in k:\n print(0)\nelse:\n t=k[0]\n for e in range(1,len(k)):\n t = t * k[e]\n if t > 10**18:\n break\n if t > 10**18:\n print(-1)\n else:\n print(t)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s233468140', 's298417273', 's685111999', 's806217426', 's884342108', 's960378851', 's712394506']
|
[21472.0, 21648.0, 21704.0, 21680.0, 21708.0, 21776.0, 21608.0]
|
[50.0, 2206.0, 48.0, 51.0, 2206.0, 2206.0, 48.0]
|
[150, 122, 240, 241, 207, 146, 242]
|
p02658
|
u942982705
| 2,000 | 1,048,576 |
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()\nprint(int(A)*int(B.replace(".", ""))//100)', 'from sys import stdin\nN = stdin.readline().rstrip()\nAn = [int(x) for x in stdin.readline().rstrip().split()]\nW = 1\nif any([A == 0 for A in An]):\n print(0)\n exit()\nfor A in An:\n W = W * A\n if 1000000000000000000 < W:\n print(-1)\n exit()\nprint(W)']
|
['Runtime Error', 'Accepted']
|
['s375728898', 's175635484']
|
[9112.0, 21620.0]
|
[23.0, 56.0]
|
[62, 269]
|
p02658
|
u943786281
| 2,000 | 1,048,576 |
Given N integers 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\nflg = False\nfor i in map(int,input().split()):\n\ta *= i\n\tif a>10e12:\n\t\tflg = True\n\t\tbreak\n\nif flg:\n\tprint(-1)\nelse:\n\tprint(a)', 'from math import floor\n \na,b = list(map(float,input().split()))\nprint(floor(a*b))', 'n=int(input())\na = 1\nfor i in map(int,input().split()):\n\ta *= i\n\nif a>10e12:\n\tprint(-1)\nelse:\n\tprint(a)', 'import sys\n\nn=int(input())\nl=list(map(int,input().split()))\n\nif 0 in l:\n\tprint(0)\n\tsys.exit()\n\nflg=False\na = 1\nfor i in l:\n\ta *= i\n\tif a>10e17:\n\t\tflg=True\n\t\tbreak\n \nif flg:\n\tprint(-1)\nelse:\n\tprint(a)']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s393344885', 's565719391', 's690895857', 's222917017']
|
[19456.0, 9116.0, 19368.0, 21588.0]
|
[44.0, 24.0, 2207.0, 50.0]
|
[145, 81, 103, 199]
|
p02658
|
u943981124
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input()); s= 1\nlis = list(map(int,input().split()))\nif 0 in lis: print(0)\nelse:\n for i in range(n):\n s = s*lis[i]\n s = str(s)\n if len(s)>18: print(-1)\n else: print(s)', 'n = int(input()); s= 1\nlis = list(map(int,input().split()))\nfor i in range(n):\n s = s*lis[i]\ns = str(s)\nif len(s)>18: print(-1)\nelse: print(s)', 'input()\nlis = list(map(int,input().split()))\ns = 1\nif 0 in lis: print(0)\nelse:\n for i in range(len(lis)):\n s = s * lis[i]\n if s>1000000000000000000: print(-1); exit()\n print(s)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s304663109', 's458917136', 's902110265']
|
[21780.0, 21580.0, 21568.0]
|
[2206.0, 2206.0, 57.0]
|
[193, 145, 196]
|
p02658
|
u944545272
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\nmx = 10**18\na = list(map(int, input().split()))\nfor x in a:\n if x == 0:\n print(0)\n exit(0)\nans = 1\nfor x in a:\n ans *= a\n if ans > mx:\n print(-1)\n exit(0)\nprint(ans)', 'n = int(input())\nmx = 10**18\na = list(map(int, input().split()))\nfor x in a:\n if x == 0:\n print(0)\n exit(0)\nans = 1\nfor x in a:\n ans *= a\n if ans > mx:\n print(-1)\n exit(0)\nprint(ans)', 'n = int(input())\nmx = 10**18\na = list(map(int, input().split()))\nfor x in a:\n if x == 0:\n print(0)\n exit(0)\nans = 1\nfor x in a:\n ans *= x\n if ans > mx:\n print(-1)\n exit(0)\nprint(ans)']
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s104413188', 's321398891', 's631508680']
|
[21764.0, 21716.0, 21780.0]
|
[53.0, 55.0, 50.0]
|
[219, 219, 219]
|
p02658
|
u944886577
| 2,000 | 1,048,576 |
Given N integers 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\nfor i in x:\n if x.count(0)>=0:\n print(0)\n break\n else:\n for i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nfor i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\n elif ans=0:\n break\nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nfor i in x:\n if x.count(0)>=0:\n print(0)\n exit()\nfor i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\nprint(ans)', 'n=input()\ns=list(map(int,input().split())\nsum=1\nfor i in s\n sum=sum*i\nif sum>10**18:\n print(-1)\nelse:\n print(sum)\n ', 'n=int(input())\nx=list(map(int,input().split()))\n\ndigits=0\nans=1\n\nfor i in list:\n digits+=len(i)\n if digits >=18:\n print(-1)\n else:\n ans=ans*i\n\nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nfor i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\n elif ans=0\n break\nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nfor i in x:\n if x.count(0)>=0:\n print(0)\nfor i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\nans=1\nfor i in x:\n if i==0:\n print(0)\n exit()\n\nfor i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\nprint(ans)']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s106975850', 's265548165', 's446893404', 's670871087', 's868099126', 's943775937', 's998786383', 's671097616']
|
[21728.0, 8872.0, 21556.0, 8960.0, 21456.0, 9024.0, 21588.0, 21600.0]
|
[58.0, 26.0, 58.0, 29.0, 57.0, 22.0, 2206.0, 58.0]
|
[191, 159, 177, 135, 161, 158, 158, 182]
|
p02658
|
u945359338
| 2,000 | 1,048,576 |
Given N integers 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())]\nsorted(A)\nif A[0] == 0:\n print(0)\n exit(0)\n\nans = 1\nfor i in range(N):\n ans*=A[i]\n if(ans>1000000000000000000):\n print(-1)\n exit(0)\nprint(ans)', 'N=int(input())\nA=list(map(int, input().split()))\nA=sorted(A,reverse=True)\nif A[N-1] == 0:\n print(0)\n exit(0)\n\nans = 1\nfor i in range(N):\n ans*=A[i]\n if(ans>1000000000000000000):\n print(-1)\n exit(0)\nprint(ans)']
|
['Runtime Error', 'Accepted']
|
['s107473377', 's375249907']
|
[19360.0, 21772.0]
|
[38.0, 79.0]
|
[196, 218]
|
p02658
|
u945375934
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['def main ():\n N = int(input())\n A = list(map(int,input(). split ()))\n \n if 0 in A:\n print(0)\n return\n \n prod = 1\n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\n \nmain ()\n', 'def main ():\n N = int(input())\n A = list(map(int,input(). split ()))\n \n if 0 in A:\n print(0)\n return\n \n prod = 1\n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\n \nmain ()\n']
|
['Wrong Answer', 'Accepted']
|
['s284202620', 's261011402']
|
[21392.0, 21640.0]
|
[67.0, 50.0]
|
[259, 257]
|
p02658
|
u945405878
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nlist_num = [int(_) for _ in input().split(" ")]\n\nproduct = 1\n\nif 0 in list_num:\n print(0)\nelse:\n checker = True\n for i, num in enumerate(list_num):\n product *= num\n if len(str(product)) >= 18:\n checker = False\n break\n \n if checker:\n print(product)\n else:\n print(-1)', 'N = int(input())\nlist_num = [int(_) for _ in input().split(" ")]\n\nproduct = 1\nchecker = True\nfor i, num in enumerate(list_num):\n product *= num\n if len(str(product)) >= 18:\n checker = False\n break\n \nif checker:\n print(product)\nelse:\n print(-1)', 'N = int(input())\nlist_num = [int(_) for _ in input().split(" ")]\n\nproduct = 1\n\nif 0 in list_num:\n print(0)\nelse:\n checker = True\n for i, num in enumerate(list_num):\n product *= num\n if product > 10**18:\n checker = False\n break\n \n if checker:\n print(product)\n else:\n print(-1)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s328650222', 's517540824', 's374360612']
|
[21644.0, 21640.0, 21584.0]
|
[71.0, 73.0, 51.0]
|
[354, 272, 347]
|
p02658
|
u946404093
| 2,000 | 1,048,576 |
Given N integers 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()\nresult = 1\nline = pow(10,18)\n\nfor i in range(N):\n result *= int(A[i])\n if result >= line:\n result = -1\n break\n\nprint(result)', 'N = int(input())\nA = input().split()\nresult = 1\nline = pow(10,18)\n\nfor i in range(N):\n result *= int(A[i])\nif result >= line:\n result = -1\n\nprint(result)', 'N = int(input())\nA = input().split()\nresult = 1\nline = pow(10,18)\n\nif "0" in A:\n result = 0\nelse:\n for i in range(N):\n result *= int(A[i])\n if result > line:\n result = -1\n break\n\nprint(result)\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s341971127', 's779071340', 's691655414']
|
[19196.0, 19440.0, 19500.0]
|
[51.0, 2206.0, 50.0]
|
[169, 155, 211]
|
p02658
|
u946648678
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\narr = [int(x) for x in input().split()]\nn = 1\nflag = True\nfor i in range(n):\n n *= arr[i]\n if n > 10**18:\n flag = False\n break\nif flag:\n print(n)\nelse:\n print(-1)', 't = int(input())\narr = [int(x) for x in input().split()]\nn = 1\nflag = True\nif 0 in arr:\n print(0)\nelse:\n for i in range(t):\n n *= arr[i]\n if n > 10**18:\n flag = False\n break\n if flag:\n print(n)\n else:\n print(-1)\n']
|
['Wrong Answer', 'Accepted']
|
['s836543919', 's498391141']
|
[21640.0, 21636.0]
|
[64.0, 60.0]
|
[189, 274]
|
p02658
|
u948165355
| 2,000 | 1,048,576 |
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\nnum_data = sys.stdin.readlines()\nnum_list = num_data[1].split()\nans = 1\nfor i in range(int(num_data[0])):\n ans *= int(num_list[i])\n\nif ans >= pow(10, 18):\n print("-1")\nelse:\n print(ans)', 'import sys\n\nnum_data = sys.stdin.readlines()\nnum_list = num_data[1].split()\nans = 1\nflag = True\nfor i in range(int(num_data[0])):\n ans *= int(num_list[i])\n if ans >= pow(10, 18):\n flag = False\n break\nif flag:\n print(ans)\nelse:\n print("-1")', 'import sys\nimport numpy as np\n\nnum_data = sys.stdin.readlines()\nstr_num_list = num_data[1].split()\nnum_list = [int(s) for s in str_num_list]\nans = 1\nif 0 in num_list:\n ans = 0\nelse:\n for i in range(int(num_data[0])):\n ans *= num_list[i]\n if ans > pow(10, 18):\n ans = -1\n break\n\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s026199860', 's375911522', 's713246945']
|
[20252.0, 19300.0, 42456.0]
|
[2206.0, 71.0, 161.0]
|
[200, 249, 306]
|
p02658
|
u948875995
| 2,000 | 1,048,576 |
Given N integers 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)\n quit()\nelse:\n for i in range(N):\n output = 1\n output *= A[i]\n if output> 10**18:\n print(-1)\n quit()\n print(output)\n ', 'N = int(input())\nA = list(map(int,input().split()))\nfor i in range(N):\n output = 1\n output *= a[i]\n\n if output> 10**18:\n print(-1)\n quit()\nprint(output)\n', 'N = int(input())\nA = list(map(int,input().split()))\nif (0 in A):\n print(0)\nfor i in range(N):\n output = 1\n output *= a[i]\n if output> 10**18:\n print(-1)\n quit()\nprint(output)', 'N = int(input())\nA = list(map(int,input().split()))\nif 0 in A:\n print(0)\n quit()\nfor i in range(N):\n output = 1\n output *= a[i]\n if output> 10**18:\n print(-1)\n quit()\nprint(output)', 'N = int(input())\nA = list(map(int,input().split()))\noutput = 1\nif 0 in A:\n print(0)\nelse:\n for i in range(N):\n output *= A[i]\n if output> 10**18:\n print(-1)\n quit()\n print(output)']
|
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s051278191', 's610095352', 's762105182', 's956531617', 's860724323']
|
[21572.0, 21588.0, 21652.0, 21636.0, 21716.0]
|
[62.0, 47.0, 47.0, 46.0, 49.0]
|
[236, 176, 200, 209, 224]
|
p02658
|
u950052018
| 2,000 | 1,048,576 |
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\na = int(input())\n\nlist = list(map(int,input().split()))\nlist.sort\n\na = 1\n\nfor i in list:\n a *= a * i\n if a > 10 ** 18:\n a = -1\n break\n \nprint(a)', 'import numpy as np\n\na = int(input())\n\nlist = list(map(int,input().split()))\n\nlp = np.prod(list)\n\nprint(lp if lp > 1000000000000000000 else "-1")', 'import numpy as np\n\na = int(input())\n\nlist = list(map(int,input().split()))\n\nlp = np.prod(list)\n\nprint(lp if lp > 10 ** 18 else "-1")', 'num = int(input())\n\nlist = list(map(int,input().split()))\nlist.sort()\n\na = 1\n\nfor i in list:\n a = a * i\n if a > 10**18:\n a = -1\n break\n \nprint(a)\n']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s072553692', 's266458209', 's347065160', 's656984195']
|
[40212.0, 40060.0, 40236.0, 21640.0]
|
[131.0, 142.0, 136.0, 90.0]
|
[173, 144, 133, 155]
|
p02658
|
u951947571
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\nAs = [int(num) for num in input().split()]\nflag = False\nres = 1\n\nAs_sorted = sorted(As, reverse=True)\nif As_sorted[-1] == 0:\n print(0)\nelse:\n for num in As_sorted:\n res *= num\n if res > 10^18:\n flag = True\n break \n if flag:\n print(-1)\n print(res)\n else:\n print(res)', 'n = int(input())\nAs = [int(num) for num in input().split()]\n\nAs_sorted = sorted(As, reverse=True)\nif As_sorted[-1] == 0:\n print(0)\nelse:\n flag = False\n res = 1\n for num in As_sorted:\n res *= num\n if res > 10**18:\n flag = True\n break \n if flag:\n print(-1)\n else:\n print(res)']
|
['Wrong Answer', 'Accepted']
|
['s094837635', 's490832081']
|
[21452.0, 21708.0]
|
[88.0, 89.0]
|
[362, 352]
|
p02658
|
u951985579
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\narr = list(map(int, input().split()))\nresult = 1\nif 0 in arr:\n result = 0\nelse:\n for i in a:\n result *= i\n if result > 10**18:\n result = -1\n break\nprint(result)', 'N = int(input())\narr = list(map(int, input().split()))\nresult = 1\nif 0 in arr:\n result = 0\nelse:\n for i in arr:\n result *= i\n if result > 10**18:\n result = -1\n break\nprint(result)']
|
['Runtime Error', 'Accepted']
|
['s666004991', 's330008476']
|
[21532.0, 21644.0]
|
[56.0, 58.0]
|
[219, 221]
|
p02658
|
u952708174
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nA = [int(i) for i in input().split()]\nans = reduce(mul, A)\nprint(ans if ans <= 10**18 else -1)', 'N = int(input())\nA = sorted([int(i) for i in input().split()])\nans = 1\nfor a in A:\n if a == 0:\n ans = 0\n break\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)']
|
['Runtime Error', 'Accepted']
|
['s197470281', 's371270473']
|
[21784.0, 21784.0]
|
[58.0, 78.0]
|
[111, 203]
|
p02658
|
u953655640
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\na = list(map(int, input().split()))\ntotal = 1\nfor i in a:\n total *= i\n \nif len(str(total)) >18:\n print(-1)\nelse:\n print(total)', 'n = int(input())\na = list(map(int, input().split()))\n\n \ntotal = 1\nh = 0\nif 0 in a:\n print(0)\nelse:\n for i in a:\n total *= i\n if total > 10**18:\n break\n\n if total > 10**18:\n print(-1)\n else:\n print(total)']
|
['Wrong Answer', 'Accepted']
|
['s009237018', 's745573456']
|
[21780.0, 21796.0]
|
[2206.0, 46.0]
|
[155, 257]
|
p02658
|
u954954040
| 2,000 | 1,048,576 |
Given N integers 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().rstrip().split(" ")))\nans=1\nfor i in range(N):\n ans*=A[i]\nif ans>=10**18:\n print(-1)\nelse:\n print(ans)', 'N=int(input())\nA = list(map(int,input().split(" ")))\na=sorted(A)\n#print(a)\nans=1\nfor i in range(N):\n ans*=a[i-1]\n if ans>10**18:\n print(-1)\n break\nelse:\n print(ans)']
|
['Wrong Answer', 'Accepted']
|
['s680642663', 's371286420']
|
[21628.0, 21544.0]
|
[2206.0, 93.0]
|
[151, 187]
|
p02658
|
u955865009
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nmylist = (input().split(" "))\nresult = 1\n\nif 0 in mylist:\n result = 0\n\nelse:\n for i in mylist:\n \n if result > 10 ** 18:\n result = -1\n break\n else:\n result *= i\nprint(result)', 'N = int(input())\nmylist = list(map(int , input().split(" ")))\nresult = 1\n\nif 0 in mylist:\n result = 0\n\nelse:\n for i in mylist:\n \n if result * i > 10 ** 18:\n result = -1\n break\n else:\n result *= i\n \nprint(result)']
|
['Runtime Error', 'Accepted']
|
['s609523025', 's214832631']
|
[19432.0, 21648.0]
|
[40.0, 59.0]
|
[250, 282]
|
p02658
|
u956910277
| 2,000 | 1,048,576 |
Given N integers 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\tprint(0)\n\texit(0)\n \nfor i in a :\n print(prod)\n if i * prod > 1e18:\n print(-1)\n exit(0)\n else:\n prod = prod * i\n \nprint(prod)', 'a = list( map( int , input().split() ))\nprod =1\n\nfor i in a :\n if i * prod > 1e18:\n print(-1)\n exit(0)\n else:\n prod *= i\n\nprint(prod)', "'''input\n31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0\n\n'''\n\nn = int(input())\na = list( map( int , input().split() ))\nprod =1\n\nif 0 in a:\n\tprint(0)\n\texit(0)\n \nfor i in a :\n # print(prod)\n if i * prod > 1e18:\n print(-1)\n exit(0)\n else:\n prod = prod * i\n \nprint(prod)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"]
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s494015245', 's911281428', 's623042675']
|
[21636.0, 9180.0, 21656.0]
|
[83.0, 23.0, 52.0]
|
[216, 145, 336]
|
p02658
|
u956931202
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\nA = map(int,input().split())\n \nans = 1\nfor num in A:\n\tans*=num\n \nif (ans > 10^18):\n ans = -1\nprint(ans)', '\nn = int(input())\nA = map(int,input().split())\n \nans = 1\nfor num in A:\n ans*=num\n if (ans >= 10**18):\n ans = -1\n break\n \nprint(ans)', 'n = input()\nA = map(int,input().split())\n\nans = 1\nfor num in A\n\tans*=num\nprint(num)', '\nn = int(input())\nA = map(int,input().split())\n \nans = 1\nfor num in A:\n ans*=num\n if (ans > 10^18):\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nA = map(int,input().split())\n \nans = 1\nfor num in A:\n\tans*=num\n if (ans > 10^18):\n ans = -1\n break\n\nprint(ans)', 'n = int(input())\nA = map(int,input().split())\n \nans = 1\nfor num in A:\n ans*=num\n if (ans > 10**18):\n ans = -1\n break\nif (0 in A):\n ans = 0;\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s171400988', 's233056443', 's588987034', 's595075323', 's604804464', 's725759800']
|
[19484.0, 19488.0, 9020.0, 19404.0, 9028.0, 19412.0]
|
[2206.0, 42.0, 24.0, 42.0, 23.0, 44.0]
|
[126, 151, 83, 148, 134, 173]
|
p02658
|
u957098479
| 2,000 | 1,048,576 |
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 \n#=input()\nn=int(input())\n#=map(int,input().split())\na=list(map(int,input().split()))\n#=[list(map(int,input().split())) for _ in range()]\n\nif 0 in set(a):\n ans = 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\nprint(ans)', '#import \n#=input()\nn=int(input())\n#=map(int,input().split())\na=list(map(int,input().split()))\n#=[list(map(int,input().split())) for _ in range()]\n\nif 0 in set(a):\n ans = 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\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s023902952', 's800369400']
|
[21464.0, 21644.0]
|
[65.0, 65.0]
|
[313, 312]
|
p02658
|
u957198490
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nA = list(map(int,input().split()))\nans = 1\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n else:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\nif 0 in A:\n print(0)\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)']
|
['Wrong Answer', 'Accepted']
|
['s152128249', 's325612401']
|
[21532.0, 21568.0]
|
[2206.0, 50.0]
|
[198, 214]
|
p02658
|
u957390897
| 2,000 | 1,048,576 |
Given N integers 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\naList = list(map(int, input().split()))\n\nresult = aList[0]\n\nfor i in range(n):\n if i == 0:\n continue\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result < enemy:\n print(result)\nelse:\n print(-1)', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nresult = aList[0]\n\nfor i in range(n):\n if i == 0:\n continue\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result < enemy:\n print(result)\nelse:\n print("-1")', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nresult = aList[0]\n\nfor i + 1 in range(n):\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result < enemy:\n print(result)\nelse:\n print("-1")', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nif 0 in aList:\n print(0)\nelse:\n for i in range(n):\n if i == 0:\n continue\n result = result * aList[i]\n\n enemy = 10 ** 18\n\n if result < enemy:\n print(result)\n else:\n print(-1)', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nresult = 0\n\nfor i in range(n):\n if i == 0:\n result = aList[i]\n continue\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result > enemy:\n print(result)\nelse:\n print(-1)', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nif 0 in aList:\n print(0)\nelse:\n for i in range(n):\n if i == 0:\n continue\n result = result * aList[i]\n if result > 10 ** 18:\n result = -1\n break\n print(result)', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nresult = 0\n\nfor i in range(n):\n if i == 0:\n result = aList[i]\n continue\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result > enemy:\n print(result)\nelse:\n print("-1")', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nresult = 0\n\nfor i in range(n):\n if i == 0:\n result = aList[i]\n continue\n result = result * aList[i]\n\nenemy = 10 ** 18\n\nif result < enemy:\n print(result)\nelse:\n print("-1")', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nif 0 aList:\n print(0)\nelse:\n for i in range(n):\n if i == 0:\n continue\n result = result * aList[i]\n\n enemy = 10 ** 18\n\n if result < enemy:\n print(result)\n else:\n print(-1)', 'n = int(input())\n\naList = list(map(int, input().split()))\n\nif 0 in aList:\n print(0)\nelse:\n result = 1\n for a in aList:\n result = result * a\n if result > 10 ** 18:\n result = -1\n break\n print(result)']
|
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s115430459', 's117290895', 's122934411', 's189707764', 's608995778', 's839427742', 's859465209', 's864518180', 's977974453', 's206949873']
|
[21528.0, 21796.0, 9116.0, 21588.0, 21712.0, 21644.0, 21648.0, 21784.0, 9012.0, 21472.0]
|
[2206.0, 2206.0, 25.0, 51.0, 2206.0, 48.0, 2206.0, 2206.0, 23.0, 50.0]
|
[223, 225, 203, 254, 238, 244, 240, 240, 251, 217]
|
p02658
|
u957799665
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in A:\n ans *= i\nprint(ans)\n\n\nif ans > 10**18:\n ans = -1\nelif min(A) == 0:\n ans = 0\n\nprint(ans)', 'import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nans = np.prod(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 min(A) == 0:\n print(0)\n exit()\n\nfor i in A:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s404404133', 's419278599', 's640724321']
|
[21636.0, 39896.0, 21680.0]
|
[2206.0, 144.0, 62.0]
|
[170, 145, 193]
|
p02658
|
u958506960
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\na = list(map(int, input().split()))\nx = 10**18\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\nprint(ans if ans < x else -1)', 'n = int(input())\na = list(map(int, input().split()))\nx = 10**18\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n ans = ans * a[i]\n if ans > x:\n print(-1)\n exit()\n\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s748858194', 's216797605']
|
[21480.0, 21632.0]
|
[2206.0, 52.0]
|
[142, 209]
|
p02658
|
u958820283
| 2,000 | 1,048,576 |
Given N integers 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()))\nans= 1\n\nif 0 in l:\n print("0")\nelse:\n for i in range(n):\n ans*= l[i]\n if ans>= 10**18:\n break\n if ans>= 10**18:\n print("-1")\n else:\n print(ans)', 'n= int(input())\na= list(map(int,input().split()))\nans=1\na.sort()\nfor i in a:\n ans=ans* i\n if i==0:\n break\n if ans>10**18:\n break\n\nif ans > 10**18:\n print("-1")\nelse:\n print(ans)']
|
['Wrong Answer', 'Accepted']
|
['s359559789', 's849225721']
|
[21632.0, 21468.0]
|
[50.0, 77.0]
|
[244, 205]
|
p02658
|
u959340534
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\nan = list(map(int, input().split()))\ns = 1\nflg = False\nfor a in an:\n s = s * a\n if s > 10**8 or s< 0:\n flg = True\n break\nif flg:\n print(-1)\nelse:\n print(s)', 'n = int(input())\nan = list(map(int, input().split()))\ns = 1\nflg = False\nfor a in an:\n s = s * a\n if s > 10**18 or s< 0:\n flg = True\n break\nif 0 in s:\n print(0)\nelif flg:\n print(-1)\nelse:\n print(s)', 'n = int(input())\nan = list(map(int, input().split()))\ns = 1\nflg = False\nfor a in an:\n s = s * a\n if s > 10**18 or s< 0:\n flg = True\n break\nif 0 in an:\n print(0)\nelif flg:\n print(-1)\nelse:\n print(s)\n']
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s229295234', 's777286801', 's339336913']
|
[21640.0, 21648.0, 21660.0]
|
[51.0, 53.0, 48.0]
|
[182, 207, 209]
|
p02658
|
u960201620
| 2,000 | 1,048,576 |
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()))\n\nprod = 1 \nfor a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n else:\n print(prod) \n\nmain ()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n \n for a in A:\n prod *= a\n if a\n \n if prod > 1000000000000000000:\n print(-1)\n return\n \n else:\n print(prod) \n\nmain()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n else:\n print(prod) \n\nif __name__ == "__main__":\n main()', '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 ()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n \n print(prod) \n \nmain()', 'def main ():\nN = int(input())\nA = list(map(int,input().split()))\nif 0 in A: print (0)\nreturn\nprod = 1 for a in A:\nprod *= a\nif prod > 1000000000000000000:\nprint(-1) return\nprint(prod) main ()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n else:\n print(prod) \n\nif __name__ == "__main__":\n main()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n \n print(prod) \n \nmain()', 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n prod = 1 \n A.sort()\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n \n print(prod) \n \nmain()']
|
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s020721604', 's154873046', 's331661377', 's383511871', 's491573808', 's494625552', 's561175029', 's664772072', 's853632661']
|
[8912.0, 8956.0, 21600.0, 21584.0, 8968.0, 9032.0, 21520.0, 8976.0, 21584.0]
|
[22.0, 21.0, 68.0, 67.0, 22.0, 24.0, 2206.0, 25.0, 84.0]
|
[180, 219, 243, 233, 198, 191, 230, 187, 210]
|
p02658
|
u961059809
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\nlim = 10**18\nans,exc = 1,False\na = map(int,input().split())\nif 0 in a:\n print(0)\nelse:\n for x in a:\n ans *= int(x)\n if ans > lim:\n exc = True\n print("-1")\n break\n if not exc:\n print(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\nres = 1\nexc = False\nfor i in a:\n\tres *= i\n\tif res > 10**18:\n exc = True\n print(-1)\nif not exc:\n print(res)', 'n = int(input())\nlim = 10**18\nans,exc = 1,False\na = list(map(int,input().split()))\n# print(a)\nif 0 in a:\n print(0)\nelse:\n for x in a:\n ans *= x\n if ans > lim:\n exc = True\n print("-1")\n break\n if not exc:\n print(ans)']
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s139993098', 's202756244', 's912722268']
|
[19364.0, 9028.0, 21780.0]
|
[42.0, 26.0, 53.0]
|
[231, 169, 242]
|
p02658
|
u961288441
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n, *l = map(int, open(0).read.split())\n\na = 1\nfor i in l:\n\ta *= i\n\tif a > 1e18:\n\t\ta =-1\n\t\tbreak\nprint(a)\n\t', 'n = int(input())\nl = list(map(int, input().split()))\nl.sort()\na = 1\nfor i in l:\n\ta *= i\n\tif a > 10**18:\n\t\ta = -1\n\t\tbreak\nprint(a)']
|
['Runtime Error', 'Accepted']
|
['s046393114', 's178626284']
|
[9092.0, 21636.0]
|
[24.0, 85.0]
|
[106, 129]
|
p02658
|
u961358555
| 2,000 | 1,048,576 |
Given N integers 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()))\nsuma = sum(a)\nif(suma > 10**18): suma = -1\nprint(suma)', 'n = int(input())\na = list(map(int,input().split()))\nlim = 10**18\nans = 1\nif(0 in a):\n ans = 0\nelse:\n for i in a:\n ans *= i\n if(ans > lim):\n ans = -1\n break\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s212644220', 's087547929']
|
[21616.0, 21760.0]
|
[63.0, 57.0]
|
[106, 184]
|
p02658
|
u961674365
| 2,000 | 1,048,576 |
Given N integers 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\ninf = 10 ** 18\nif 0 in a:\n print(0)\n exit()\nfor x in a:\n ans *= x\n if ans >= inf:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nfor x in a:\n ans *= x\n if ans >= 10 ** 18:\n print(-1)\n exit()\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\ninf = 10 ** 18 + 1\nif 0 in a:\n print(0)\n exit()\nfor x in a:\n ans *= x\n if ans >= inf:\n print(-1)\n exit()\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s718324424', 's769752255', 's713541751']
|
[21648.0, 21644.0, 21652.0]
|
[49.0, 55.0, 48.0]
|
[197, 187, 201]
|
p02658
|
u962330718
| 2,000 | 1,048,576 |
Given N integers 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()))\ncnt=1\nfor i in range(N):\n cnt*=A[i]\npritn(cnt)', 'N=int(input())\nA=list(map(int,input().split()))\nA=sorted(A)\ncnt=1\nfor i in range(N):\n cnt*=A[i]\n if cnt>10**18:\n cnt=-1\n break\nprint(cnt)']
|
['Runtime Error', 'Accepted']
|
['s429752612', 's704522533']
|
[21472.0, 21640.0]
|
[2206.0, 95.0]
|
[97, 157]
|
p02658
|
u964521959
| 2,000 | 1,048,576 |
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())\n\nA_list = list(map(int, input().split()))\n\nif((0 in A_list) ==True):\n print("0")\n exit()\n \nans = 1\nfor i in range(N):\n if(ans<10**18):\n ans = ans * A_list[i]\n else:\n print("-1")\n exit()\n \nif(ans<10**18):\n print(ans)\nelse:\n print("-1")', '\nN = int(input())\n\nA_list = list(map(int, input().split()))\n\nif((0 in A_list) ==True):\n print("0")\n exit()\n \nans = 1\nfor i in range(N):\n if(ans<=10**18):\n ans = ans * A_list[i]\n else:\n print("-1")\n exit()\n \nif(ans<=10**18):\n print(ans)\nelse:\n print("-1")']
|
['Wrong Answer', 'Accepted']
|
['s754758859', 's524463868']
|
[21580.0, 21780.0]
|
[47.0, 49.0]
|
[338, 340]
|
p02658
|
u964763428
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['import numpy as np\n\nn = int(input())\na = np.array(list(map(int, input().split())), dtype=np.uint64)\n\n\nans = np.prod(a)\n\nif ans >= pow(10, 18):\n print(-1)\nelse:\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nans = 1\n\nfor b in a:\n if b:\n ans *= b\n if ans > pow(10, 18):\n ans = -1\n break\n else:\n ans = 0\n break\n\nprint(ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s490509632', 's794226711']
|
[40260.0, 21792.0]
|
[149.0, 80.0]
|
[178, 231]
|
p02658
|
u965397031
| 2,000 | 1,048,576 |
Given N integers 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]\n\nprint(ans if ans / (10 ** 18) < 1 else -1)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)', "n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a: print('0')\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n break\n\nprint(ans)", "n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a: print('0')\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n break\n print(ans)\n", 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n ans = 0\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s028016511', 's089238794', 's348380352', 's748160627', 's717393327']
|
[21516.0, 21612.0, 21636.0, 21704.0, 21660.0]
|
[2206.0, 65.0, 51.0, 58.0, 59.0]
|
[140, 205, 205, 209, 209]
|
p02658
|
u965669098
| 2,000 | 1,048,576 |
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(stdin.readline())\n a = list(map(int,stdin.readline().split()))\n f = 1\n flag=0\n a = sorted(a)\n for i in range(n):\n f = f*a[i]\n if f>10**18:\n flag=1\n break\n if flag:\n print("-1")\n else:\n print(f)\n\nmain()', 'from sys import stdin, stdout\nfrom collections import defaultdict\n\ndef main():\n n = int(stdin.readline())\n a = list(map(int,stdin.readline().split()))\n f = 1\n flag=0\n a = sorted(a)\n for i in range(n):\n f = f*a[i]\n if f>10**18:\n flag=1\n break\n if flag:\n print("-1")\n else:\n print(f)\n\nmain()']
|
['Runtime Error', 'Accepted']
|
['s724835389', 's993469324']
|
[9124.0, 22588.0]
|
[24.0, 90.0]
|
[296, 363]
|
p02658
|
u966207392
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['import numpy as np\n \nN = input()\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\nif 0 in k:\n print(0)\n \nif p < 10**18:\n print(p)\nelse:\n print(-1)', 'import numpy as np\n\nN = input()\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\n\nif p < 10**18:\n print(p)\nelse:\n print(-1)', 'N = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\nAx = 1\ni = 0\nwhile Ax <= 10**18:\n Ax *= A[i]\n i += 1\n if i == N-1:\n print(Ax)\n exit()\nprint(-1)', "import numpy as np\n\nN = input()\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\n\nif p < 10**18:\n print(p)\nelse:\n print('-1')", 'import numpy as np\n\nN = int(input())\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\n\nif p < 10**18:\n print(p)\nelse:\n print(-1)', 'import sys\nN = int(input())\nL = list(map(int, input().split()))\ncnt = 1\nif 0 in L:\n print(0)\n sys.exit()\nfor i in range(N):\n cnt *= L[i]\n if cnt > 10^18:\n print(-1)\n sys.exit()\nprint(cnt)\n', 'N = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\nAx = 1\ni = 0\nwhile Ax > 10**18:\n Ax *= A[i]\n if i == N-1:\n print(Ax)\n exit()\n i += 1\nprint(-1)', "import numpy as np\n\nN = int(input())\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\n\nif p < 10**18:\n print(p)\nelse:\n print('-1')", 'import numpy as np\n \nN = input()\ns = input().split()\nk = [int(_) for _ in s]\np = np.prod(k)\nif 0 in k:\n print(0)\n \nelif p < 10**18:\n print(p)\nelse:\n print(-1)', 'import sys\nN = int(input())\nL = list(map(int, input().split()))\ncnt = 1\nif 0 in L:\n print(0)\n sys.exit()\nfor i in range(N):\n cnt *= L[i]\n if cnt > 10**18:\n print(-1)\n sys.exit()\nprint(cnt)\n']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s296368058', 's343963289', 's366504355', 's459099915', 's523621433', 's614196278', 's717737017', 's788275425', 's822008075', 's632262743']
|
[40956.0, 40872.0, 21604.0, 40948.0, 41128.0, 21696.0, 21716.0, 41032.0, 40956.0, 21552.0]
|
[149.0, 142.0, 64.0, 156.0, 137.0, 56.0, 54.0, 137.0, 145.0, 60.0]
|
[165, 139, 195, 141, 144, 214, 194, 146, 167, 215]
|
p02658
|
u966695411
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['#! /usr/bin/env python3\ninput()\nl = 10**18\na = 1\nfor i in map(int, input()):\n a *= i\n if a > l:\n a = -1\n break\nprint(a)', '#! /usr/bin/env python3\ninput()\nl = 10**18\na = 1\n*b, = map(int, input().split())\nif 0 in b:\n a = 0\nelse:\n for i in b:\n a *= i\n if a > l:\n a = -1\n break\nprint(a)']
|
['Runtime Error', 'Accepted']
|
['s267629115', 's420792296']
|
[12572.0, 21732.0]
|
[25.0, 51.0]
|
[139, 202]
|
p02658
|
u966836999
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['#B\nN = int(input())\nA = list(map(int, input().split()))\nresult = 1\nfor i in range(len(A)):\n result *= A[i]\nif result >=10**18:\n print(-1)\nelse:\n print(result)', '#B\nunti()\n\ndef unti():\n N = int(input())\n A = list(map(int, input().split()))\n result = 1\n if 0 in A:\n print(0)\n return\n for a in A:\n if 0 in A:\n print(0)\n break\n result *= a\n if result >10**18:\n print(-1)\n else:\n print(result)', '#B\ndef main ():\n N = int(input())\n A = list(map(int,input(). split ()))\n if 0 in A:\n print(0)\n return\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain ()']
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s077920479', 's679811713', 's713532267']
|
[21652.0, 9044.0, 21676.0]
|
[2206.0, 25.0, 50.0]
|
[167, 312, 275]
|
p02658
|
u967484343
| 2,000 | 1,048,576 |
Given N integers 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 if A[i] == 0:\n ans = 0\n break\n else:\n ans *= A[i]\n \nif ans < 1000000000000000000:\n print(ans)\nelse:\n print(-1)', 'N = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 10 ** 18:\n ans = -1\n break\n\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s222871922', 's998936567']
|
[21676.0, 21548.0]
|
[2206.0, 58.0]
|
[225, 211]
|
p02658
|
u967822229
| 2,000 | 1,048,576 |
Given N integers 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\nc=0\n \nwhile c<N:\n if A[c]==0:\n ans=0\n elif ans>10000000000000000/A[c]:\n ans=10000000000000001\n else :\n ans=ans*A[c]\n \n c+=1\n \nif ans>10000000000000000: print(-1)\nelse: print(ans)', 'N = int(input())\nA=list(map(int, input().split()))\n\nans=1\nc=0\n\nwhile c<N:\n if A[c]==0:\n ans=0 break;\n else if ans*A[c]>10000000000000000:\n ans=10000000000000001\n else :\n ans=ans*A[c]\n \n c+=1\n \nif ans>10000000000000000: print(-1)\nelse: print(ans)', 'N = int(input())\nA=list(map(int, input().split()))\n\nans=1\nc=0\n\nwhile c<N:\n ans=ans*A[c]\n c+=1\n \nif ans>10000000000000000: print(-1)\nelse: print(ans)', 'N = int(input())\nA=list(map(int, input().split()))\n\nans=1\nc=0\n\nwhile c<N:\n if A[c]==0: ans=0 break;\n else if ans*A[c]>10000000000000000: ans=10000000000000001\n else :\n ans=ans*A[c]\n \n c+=1\n \nif ans>10000000000000000: print(-1)\nelse: print(ans)', 'N = int(input())\nA=list(map(int, input().split()))\n \nans=1\nc=0\n \nwhile c<N:\n if A[c]==0:\n ans=0\n elif ans*A[c]>10000000000000000:\n ans=10000000000000001\n else :\n ans=ans*A[c]\n \n c+=1\n \nif ans>10000000000000000: print(-1)\nelse: print(ans)', 'N = int(input())\nA=list(map(int, input().split()))\n \nans=1\nc=0\n \nwhile c<N:\n if A[c]==0:\n ans=0\n elif ans*A[c]>1000000000000000000:\n ans=1000000000000000001\n else :\n ans=ans*A[c]\n \n c+=1\n \nif ans>1000000000000000000: print(-1)\nelse: print(ans)']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s456600037', 's531524537', 's719892856', 's749334749', 's850510761', 's663803870']
|
[21644.0, 9028.0, 21656.0, 9032.0, 21652.0, 21776.0]
|
[96.0, 22.0, 2206.0, 24.0, 74.0, 75.0]
|
[276, 284, 157, 268, 276, 282]
|
p02658
|
u967864815
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['a = list(map(int, input().split()))\nsum_a = 1\n\nfor e in a:\n sum_a *= e\n\nif sum_a > 10e18:\n sum_a = -1\n\nprint(sum_a)\n', 'a = list(map(int, input().split()))\nsum_a = sum(a)\nif sum_a > 10e18:\n sum_a = -1\n\nprint(sum_a)', 'import sys\n\nn = input()\na = list(map(int, input().split()))\nsum_a = 1\n\nif 0 in a:\n print(0)\n sys.exit()\n\nfor e in a:\n sum_a *= e\n if sum_a > 1e18:\n print(-1)\n sys.exit()\n\nif sum_a > 1e18:\n sum_a = -1\n\nprint(sum_a)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s151158937', 's312271486', 's841296370']
|
[9084.0, 9164.0, 21600.0]
|
[23.0, 24.0, 99.0]
|
[122, 97, 242]
|
p02658
|
u968404618
| 2,000 | 1,048,576 |
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 collections\n\nn = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\ncounter = collections.Counter(A)\nans = 1\nfor k, v in counter.items():\n ans *= k * v\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'import collections\n\nn = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\ncounter = collections.Counter(A)\nans = 1\nfor k, v in counter.items():\n ans += k * v\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'import collections\n\nn = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\ncounter = collections.Counter(A)\nans = 0\nfor k, v in counter.items():\n ans += k * v\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'from operator import mul\nfrom functools import reduce\n\nn = int(input())\nA = list(map(int, input().split()))\n\nans = reduce(mul, A)\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'import numpy as np\n\nn = int(input())\nans = np.array(list(map(int, input().split()))).prod()\n\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'import math\na, b = map(float, input().split())\nprint(math.floor(a*b))', 'def main():\n ## IMPORT MODULE\n #import sys\n\n \n #input=lambda :sys.stdin.readline().rstrip()\n\n #f_inf=float("inf")\n #MOD=10**9+7\n \n if \'get_ipython\' in globals(): \n ## SAMPLE INPUT\n n = 2\n A = [1000000000, 1000000000]\n\n else:\n ##INPUT \n n = input()\n A = list(map(int, input().split()))\n\n ## SUBMITION CODES HERE\n if 0 in A:\n print(0)\n exit()\n \n ans = 1\n for a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\n \n print(ans)\n \nmain()']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s119677726', 's125548086', 's143951498', 's192860949', 's356875692', 's534150238', 's015515309']
|
[22352.0, 22352.0, 22528.0, 22920.0, 40160.0, 9112.0, 21636.0]
|
[2206.0, 53.0, 57.0, 2206.0, 136.0, 23.0, 48.0]
|
[238, 238, 238, 178, 141, 69, 521]
|
p02658
|
u969080040
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N=int(input())\nA=list(map(int,input().split()))\nS=1\nfor i in range(N):\n S*=A[i]\nif S>10*18:\n print(-1)\nelse:\n print(S)', 'N=int(input())\nA=list(map(int,input().split()))\ns=1\nif 0 in A:\n print(0)\nelse:\n for i in range(N):\n s*=A[i]\n if s>10**18:\n print(-1)\n break\n if s<=10**18:\n print(s)']
|
['Wrong Answer', 'Accepted']
|
['s994370632', 's562401648']
|
[21516.0, 21576.0]
|
[2206.0, 52.0]
|
[121, 186]
|
p02658
|
u969081133
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n=int(input())\narray=list(map(int,input().split()))\nans=1\nif 0 in array:\n ans=0\nelse:\n for i in range(n):\n if ans>10**18:\n break\n else:\n ans=ans*array[i]\nif ans>10**18:\n print(-1)\nelse:\n print(ans)', 'n=int(input())\narray=list(map(int,input().split()))\nans=1\nif 0 in array:\n ans=0\nelse:\n for i in range(n):\n if ans>10**18:\n break\n else:\n ans=ans*array[i]\nif ans>10**18:\n print(-1)\nelse:\n print(ans)']
|
['Runtime Error', 'Accepted']
|
['s146219989', 's207138854']
|
[8872.0, 21668.0]
|
[28.0, 58.0]
|
[209, 217]
|
p02658
|
u970198631
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nMM = input().split()\ntotal = 1\nfor i in MM:\n total = total*int(i)\n print(total)\n if total > 10**18:\n break\nif total > 10**18:\n print(-1)\nelse:\n print(total)', 'N = int(input())\nMM = input().split()\ntotal = 1\nfor i in MM:\n total = total*int(i)\n\n if total > 10**18:\n break\nfor i in MM:\n if int(i) == 0:\n total = 0\nif total > 10**18:\n print(-1)\nelse:\n print(total)\n ']
|
['Wrong Answer', 'Accepted']
|
['s090702285', 's151349378']
|
[19304.0, 19376.0]
|
[79.0, 72.0]
|
[181, 215]
|
p02658
|
u971091945
| 2,000 | 1,048,576 |
Given N integers 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 = ans * a[i]\n if len(str(ans))>18:\n print(-1)\n exit()\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n ans = ans * a[i]\n if len(str(ans))>18:\n print(-1)\n exit()\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n ans = ans * a[i]\n if ans>10**18:\n print(-1)\n exit()\n\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s172534872', 's959554464', 's742108463']
|
[21764.0, 21644.0, 21604.0]
|
[65.0, 66.0, 50.0]
|
[171, 207, 201]
|
p02658
|
u974485376
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nm,k = input().split()\nresult=int(m)*int(k)\nprint("%d"%result)\nif result>=10**18:\n print("-1")\n\n\n\n', 'N = int(input())\nm,k = input().split()\nresult=int(m)*int(k)\nprint("%d"%result)\nif result>=10**18:\n print("-1")\n\n\n\n', 'A= int(input())\nB = list(map(int, input().split()))\nresult = 1\nif 0 in B:\n print(0)\n exit()\n\nfor S in B:\n result *= S\n if result > 10**18:\n print(-1)\n exit()\nprint("%d"%result)\n']
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s244500586', 's667545991', 's225204534']
|
[19316.0, 19476.0, 21780.0]
|
[39.0, 37.0, 55.0]
|
[117, 117, 203]
|
p02658
|
u975771310
| 2,000 | 1,048,576 |
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 ans = 1\n\n for i in range(N):\n ans = ans*A[i]\n if ans>10**18:\n ans = -1\n break\n\n return ans', 'def main():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 1\n\n if 0 in A:\n ans = 0\n else:\n for i in range(N):\n ans = ans*A[i]\n if ans>10**18:\n ans = -1\n break\n\n return ans\n\n\nif __name__=="__main__":\n ans = main()\n print(ans)']
|
['Wrong Answer', 'Accepted']
|
['s446254841', 's846812356']
|
[9108.0, 21648.0]
|
[21.0, 50.0]
|
[269, 433]
|
p02658
|
u978789527
| 2,000 | 1,048,576 |
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 itertools\nimport operator\n\nn = int(input())\nms = list(map(int, input().split()))\n\nif 0 in ms:\n r = 0\nelse:\n r = itertools.reduce(operator.mul, li)\nif r > 10 ** 18:\n r = -1\nprint(r)', 'n = int(input())\nms = list(map(int, input().split()))\niter_ms = iter(ms) \nr = 1\nif 0 in ms:\n r = 0\nelse:\n for i in range(n):\n x = next(iter_ms)\n r *= x\n if r > 10 ** 18:\n r = -1\n break\n \nprint(r)']
|
['Runtime Error', 'Accepted']
|
['s713858919', 's874183285']
|
[22676.0, 21736.0]
|
[55.0, 65.0]
|
[190, 249]
|
p02658
|
u979605701
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['def solve():\n n = int(input())\n a = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n x = 1\n for tmp in a:\n x *= tmp\n if x > 1000000000000000000:\n print(-1)\n return\n print(x)\n\nsolve()', 'def solve():\n n = int(input())\n a = list(map(int, input().split()))\n if 0 in a:\n print(0)\n return\n x = 1\n for tmp in a:\n x *= tmp\n if x > 1000000000000000000:\n print(-1)\n return\n print(x)\n\nsolve()']
|
['Runtime Error', 'Accepted']
|
['s054323396', 's243260764']
|
[21592.0, 21740.0]
|
[55.0, 50.0]
|
[264, 264]
|
p02658
|
u980932400
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n=int(input())\na=list(map(int,input().split()))\nres=-1\n\nz=10**18\nfor i in a:\n if(i > z/res):\n res=-1\n break\n res*=i\n if(i>z):\n res=-1\n break\nprint(res)', 'n=int(input())\na=list(map(int,input().split()))\nres=1\n\nz=10**18\nfor i in a:\n if(i > z/res):\n res=-1\n break\n res*=i\n if(i>z):\n res=-1\n break\n print(res)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\ni=n-1\nres=1\nz=10**18\nfor i in a:\n if(i==0):\n res=0\n break\nwhile(i>=0):\n if(res>z/a[i]):\n res=z+1\n break\n res*=a[i]\n if(a[i]>z):\n break\n i-=1\nif(res>z):\n res=-1\nprint(res)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nres=1\nz=10**18\nfor i in a:\n if(i==0):\n res=0\n break\ni=n-1\nwhile(i>=0):\n if(a[i]==0):\n res=0\n break\n if(res>z/a[i]):\n res=z+1\n break\n res*=a[i]\n if(a[i]>z):\n break\n i-=1\nif(res>z):\n res=-1\nprint(res)']
|
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s169470507', 's384293859', 's950126949', 's454700683']
|
[21588.0, 21556.0, 21568.0, 21452.0]
|
[46.0, 76.0, 74.0, 128.0]
|
[188, 179, 280, 325]
|
p02658
|
u981884699
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['import numpy as np\nimport functools\nimport operator\n\nprod2 = functools.partial(functools.reduce, operator.mul)\n\nn = int(input())\nnums = list(map(int, input().split()))\nprint(nums)\n\nval = prod2(nums)\n\nif val > 1e18:\n val = -1\n\nprint(val)\n', 'import numpy as np\nimport functools\nimport operator\n\nprod2 = functools.partial(functools.reduce, operator.mul)\n\nn = int(input())\nnums = list(map(int, input().split()))\n\n# val = prod2(nums)\n\nval = 1\nif 0 in nums:\n val = 0\n\nelse:\n for num in nums:\n val *= num\n \n if val > 1e18:\n val = -1\n break\n\n\nprint(val)\n']
|
['Wrong Answer', 'Accepted']
|
['s049940682', 's585412756']
|
[39912.0, 39920.0]
|
[2207.0, 134.0]
|
[240, 351]
|
p02658
|
u984529214
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['a, b = map(float,input().split())\nprint(int((a*b)//1))', 'n = int(input())\na = list(map(int,input().split()))\nans = 1\nfor i in range(n):\n if a[i] == 0:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 1e18:\n print(-1)\n exit()\nif ans > 1e18:\n print(-1)\nelse:\n print(ans)\n']
|
['Runtime Error', 'Accepted']
|
['s932932143', 's821013420']
|
[9088.0, 21688.0]
|
[23.0, 60.0]
|
[54, 266]
|
p02658
|
u984592063
| 2,000 | 1,048,576 |
Given N integers 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 range(n):\n result *= a[i]\nif result>100000000000000000:\n result = -1\nprint(result)\n', 'n = int(input())\na=list(map(int,input().split()))\nif 0 in a:\n result=0\nelse:\n result = 1\n for i in range(n):\n result *= a[i]\n print(result)\n if result>1000000000000000000:\n result = -1\n break\nprint(result)\n', 'n = int(input())\na=list(map(int,input().split()))\nif 0 in a:\n result=0\nelse:\n result = 1\n for i in range(n):\n result *= a[i]\n print(result)\n if result>1000000000000000000:\n result = -1\nprint(result)\n', 'n = int(input())\na=list(map(int,input().split()))\nif 0 in a:\n result=0\nelse:\n result = 1\n for i in range(n):\n result *= a[i]\n if result>1000000000000000000:\n result = -1\n break\nprint(result)\n\n']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s332380360', 's401704254', 's835279225', 's302467870']
|
[21780.0, 21780.0, 21692.0, 21784.0]
|
[2206.0, 81.0, 2234.0, 51.0]
|
[159, 258, 232, 237]
|
p02658
|
u988975120
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int()\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s*= i\nif s > pow(10, 18):\n print(-1)\nelse:\n print(s)\n', 'n = input()\na = list(map(int, input().split()))\n\ns = 1\nmod = pow(10, 18)\nfor i in a:\n s = s*i\n if s < mod:\n print(-1)\n exit()\nelse:\n print(s)\n', 'n = input()\na = list(map(int, input().split()))\n\ns = 1\nmod = pow(10, 18)\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a:\n s = s*i\n if s > mod:\n print(-1)\n exit()\nelse:\n print(s)\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s199505143', 's546734143', 's224211215']
|
[9068.0, 21640.0, 21632.0]
|
[23.0, 53.0, 50.0]
|
[127, 165, 202]
|
p02658
|
u990339766
| 2,000 | 1,048,576 |
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;\n\nint main ()\n{\n\tlong n, a;\n\tlong ret = 1;\n\tbool flag = true;\n\n\tcin >> n;\n\n\tfor (int i=0; i<n; i++) {\n\t\tcin >> a;\n\t\tif (a == 0) {\n\t\t\tcout << 0 << endl;\n\t\t\treturn 0;\n\t\t}\n\t\tret *= a;\n\t\tif (ret <= 0 || 1000000000000000000 < ret) {\n\t\t\tflag = false;\n\t\t}\n\t}\n\n\tif (flag == false) {\n\t\tcout << -1 << endl;\n\t} else {\n\t\tcout << ret << endl;\n\t}\n\n\treturn 0;\n}\n', 'n = int(input())\nMX = 10 **18\na = list(map(int, input().split()))\nfor x in a:\n if x == 0:\n print(0)\n exit(0)\nans = 1\nfor x in a:\n ans *= x\n if ans > MX:\n print(-1)\n exit(0)\nprint(ans)\n']
|
['Runtime Error', 'Accepted']
|
['s719715543', 's390158777']
|
[9012.0, 21700.0]
|
[23.0, 51.0]
|
[387, 221]
|
p02658
|
u993622994
| 2,000 | 1,048,576 |
Given N integers 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()\nans = 1\n\nif '0' in A:\n ans = 0\n print(ans)\n exit()\n\nfor i in range(N):\n num = int(A[i])\n ans *= num\n if ans >= 10**18:\n ans = -1\n break\n\nprint(ans)\n", 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nans = 1\n\nfor i in range(N):\n num = A[i]\n ans *= num\n if ans <= 0:\n break\n elif ans >= 10**18:\n ans = -1\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nans = 1\ncheck = 10 ** 18\n\nfor i in range(N):\n num = A[i]\n ans *= num\n if ans > check:\n ans = -1\n break\n elif ans == 0:\n break\n\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s178641374', 's795675702', 's595953384']
|
[19500.0, 21652.0, 21660.0]
|
[51.0, 79.0, 76.0]
|
[217, 203, 232]
|
p02658
|
u994865749
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
["N=int(input)\ns=list(map(int,input().split()))\nans=1\nfor i in s:\n ans*=i\n if ans>10e18:\n print('-1')\n break\nprint(ans)", "N=int(input)\ns=list(map(input().split()))\nans=1\nfor i in s:\n ans*=i\n if ans>10e18:\n print('-1')\n break\nprint(ans)", "N=int(input())\ns=list(map(int,input().split()))\nans=1\nif s.count(0)>0:\n print('0')\n exit()\nfor i in s:\n ans*=i\n if ans>1000000000000000000:\n print('-1')\n exit()\n\nprint(ans)"]
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s557820029', 's723706116', 's666022193']
|
[9000.0, 9036.0, 21648.0]
|
[26.0, 26.0, 54.0]
|
[125, 121, 182]
|
p02658
|
u995062424
| 2,000 | 1,048,576 |
Given N integers 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(len(A)):\n if(len(str(ans)) >= 18):\n ans = -1\n break\n ans *= A[i]\nif(len(str(ans)) >= 18):\n print(-1)\nelse:\n print(ans)', 'import decimal\nN = int(input())\nA = list(input().split())\n\nans = 1\nfor i in range(len(A)):\n ans *= decimal.Decimal(A[i])\n \nif(len(str(ans)) >= 18):\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\naa = set(A)\nans = 1\nfor i in range(len(A)):\n if(len(str(ans)) >= 18):\n if(0 not in aa):\n ans = -1\n break\n else:\n ans = 0\n ans *= A[i]\n\nif(len(str(ans)) >= 18):\n print(-1)\nelse:\n print(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\naa = set(A)\nans = 1\nfor i in range(len(A)):\n if(ans > 10**18):\n if(0 not in aa):\n ans = -1\n break\n else:\n ans = 0\n ans *= A[i]\n\nif(ans > 10**18):\n print(-1)\nelse:\n print(ans)']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s410201730', 's499846479', 's560000483', 's766053574']
|
[21544.0, 21040.0, 21640.0, 21576.0]
|
[65.0, 84.0, 94.0, 80.0]
|
[221, 188, 301, 287]
|
p02658
|
u995163736
| 2,000 | 1,048,576 |
Given N integers 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(map(int,input().split()), reverse = True)\nprint(A)\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for i in A:\n ans *= i\n if ans >10**18:\n print(-1)\n else:\n print(ans)', 'n = int(input())\nA = sorted(map(int,input().split()), reverse = True)\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for i in A:\n ans *= i\n if ans >10**18:\n print(-1)\n break\n else:\n print(ans)']
|
['Wrong Answer', 'Accepted']
|
['s990255708', 's520181694']
|
[21516.0, 21672.0]
|
[2208.0, 80.0]
|
[228, 238]
|
p02658
|
u996480565
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['N = int(input())\nvals = [int(v) for v in input().split()]\n\nrslt = 1\n\nfor v in vals:\n rslt = rslt * v\n \n if rslt > 10 ** 18:\n print(-1)\n\timport sys\n sys.exit()\n \nprint(rslt)\n \n', 'N = int(input())\nvals = [int(v) for v in input().split()]\n\nrslt = 1\n\nif 0 in vals:\n rslt = 0\n\nfor v in vals:\n rslt = rslt * v\n \n if rslt > 10 ** 18:\n rslt = -1\n break\n\nprint(rslt)\n \n']
|
['Runtime Error', 'Accepted']
|
['s800181384', 's453268695']
|
[8968.0, 21788.0]
|
[22.0, 60.0]
|
[190, 195]
|
p02658
|
u998008108
| 2,000 | 1,048,576 |
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 __future__ import division, print_function\nimport os,sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n from __builtin__ import xrange as range\n from future_builtins import ascii, filter, hex, map, oct, zip\ndef dmain():\n sys.setrecursionlimit(1000000)\n threading.stack_size(1024000)\n thread = threading.Thread(target=main)\n thread.start()\n#from collections import deque, Counter, OrderedDict,defaultdict\n#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace\n#from math import log,sqrt,factorial,cos,tan,sin,radians\n\n#from decimal import *\n#import threading\n#from itertools import permutations\nabc=\'abcdefghijklmnopqrstuvwxyz\'\nabd={\'a\': 0, \'b\': 1, \'c\': 2, \'d\': 3, \'e\': 4, \'f\': 5, \'g\': 6, \'h\': 7, \'i\': 8, \'j\': 9, \'k\': 10, \'l\': 11, \'m\': 12, \'n\': 13, \'o\': 14, \'p\': 15, \'q\': 16, \'r\': 17, \'s\': 18, \'t\': 19, \'u\': 20, \'v\': 21, \'w\': 22, \'x\': 23, \'y\': 24, \'z\': 25}\nmod=1000000007\n#mod=998244353\ninf = float("inf")\nvow=[\'a\',\'e\',\'i\',\'o\',\'u\']\ndx,dy=[-1,1,0,0],[0,0,1,-1]\ndef getKey(item): return item[1] \ndef sort2(l):return sorted(l, key=getKey,reverse=True)\ndef d2(n,m,num):return [[num for x in range(m)] for y in range(n)]\ndef isPowerOfTwo (x): return (x and (not(x & (x - 1))) )\ndef decimalToBinary(n): return bin(n).replace("0b","")\ndef ntl(n):return [int(i) for i in str(n)]\ndef ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))\ndef ceil(x,y):\n if x%y==0:\n return x//y\n else:\n return x//y+1\ndef powerMod(x,y,p):\n res=1\n x%=p\n while y>0:\n if y&1:\n res=(res*x)%p\n y=y>>1\n x=(x*x)%p\n return res\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\ndef isPrime(n):\n if(n<=1): return False\n if(n<=3): return True\n if(n%2==0 or n%3==0): return False\n i=5\n while(i*i<=n) : \n if(n%i==0 or n%(i+2)==0) : \n return False\n i=i+6\n return True\ndef read():\n sys.stdin = open(\'input.txt\', \'r\') \n sys.stdout = open(\'output.txt\', \'w\') \n\ndef main():\n n=int(input())\n prod = 1\n arr=list(map(int,input().split()))\n for i in arr:\n prod = prod*i\n if(prod>=1e18):\n print(-1)\n return\n print(prod)\n\nBUFSIZE = 8192\nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = "x" in file.mode or "r" not in file.mode\n self.write = self.buffer.write if self.writable else None\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b"\\n") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode("ascii"))\n self.read = lambda: self.buffer.read().decode("ascii")\n self.readline = lambda: self.buffer.readline().decode("ascii")\ndef print(*args, **kwargs):\n """Prints the values to a stream, or to sys.stdout by default."""\n sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop("end", "\\n"))\n if kwargs.pop("flush", False):\n file.flush()\nif sys.version_info[0] < 3:\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\nelse:\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip("\\r\\n")\nif __name__ == "__main__":\n main()', 'from __future__ import division, print_function\nimport os,sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n from __builtin__ import xrange as range\n from future_builtins import ascii, filter, hex, map, oct, zip\ndef dmain():\n sys.setrecursionlimit(1000000)\n threading.stack_size(1024000)\n thread = threading.Thread(target=main)\n thread.start()\n#from collections import deque, Counter, OrderedDict,defaultdict\n#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace\n#from math import log,sqrt,factorial,cos,tan,sin,radians\n\n#from decimal import *\n#import threading\n#from itertools import permutations\nabc=\'abcdefghijklmnopqrstuvwxyz\'\nabd={\'a\': 0, \'b\': 1, \'c\': 2, \'d\': 3, \'e\': 4, \'f\': 5, \'g\': 6, \'h\': 7, \'i\': 8, \'j\': 9, \'k\': 10, \'l\': 11, \'m\': 12, \'n\': 13, \'o\': 14, \'p\': 15, \'q\': 16, \'r\': 17, \'s\': 18, \'t\': 19, \'u\': 20, \'v\': 21, \'w\': 22, \'x\': 23, \'y\': 24, \'z\': 25}\nmod=1000000007\n#mod=998244353\ninf = float("inf")\nvow=[\'a\',\'e\',\'i\',\'o\',\'u\']\ndx,dy=[-1,1,0,0],[0,0,1,-1]\ndef getKey(item): return item[1] \ndef sort2(l):return sorted(l, key=getKey,reverse=True)\ndef d2(n,m,num):return [[num for x in range(m)] for y in range(n)]\ndef isPowerOfTwo (x): return (x and (not(x & (x - 1))) )\ndef decimalToBinary(n): return bin(n).replace("0b","")\ndef ntl(n):return [int(i) for i in str(n)]\ndef ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))\ndef ceil(x,y):\n if x%y==0:\n return x//y\n else:\n return x//y+1\ndef powerMod(x,y,p):\n res=1\n x%=p\n while y>0:\n if y&1:\n res=(res*x)%p\n y=y>>1\n x=(x*x)%p\n return res\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\ndef isPrime(n):\n if(n<=1): return False\n if(n<=3): return True\n if(n%2==0 or n%3==0): return False\n i=5\n while(i*i<=n) : \n if(n%i==0 or n%(i+2)==0) : \n return False\n i=i+6\n return True\ndef read():\n sys.stdin = open(\'input.txt\', \'r\') \n sys.stdout = open(\'output.txt\', \'w\') \n\ndef main():\n n=int(input())\n prod = 1\n arr=list(map(int,input().split()))\n if(0 in arr):\n print(0)\n return\n for i in arr:\n prod = prod*i\n if(prod>1e18):\n print(-1)\n return\n print(prod)\n\nBUFSIZE = 8192\nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = "x" in file.mode or "r" not in file.mode\n self.write = self.buffer.write if self.writable else None\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b"\\n") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode("ascii"))\n self.read = lambda: self.buffer.read().decode("ascii")\n self.readline = lambda: self.buffer.readline().decode("ascii")\ndef print(*args, **kwargs):\n """Prints the values to a stream, or to sys.stdout by default."""\n sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop("end", "\\n"))\n if kwargs.pop("flush", False):\n file.flush()\nif sys.version_info[0] < 3:\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\nelse:\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip("\\r\\n")\nif __name__ == "__main__":\n main()']
|
['Wrong Answer', 'Accepted']
|
['s561181067', 's309160858']
|
[24236.0, 24112.0]
|
[62.0, 59.0]
|
[4490, 4539]
|
p02658
|
u998867748
| 2,000 | 1,048,576 |
Given N integers 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\ns = 1\nfor i in a:\n s = s*i\nif s > 10**18:\n print('-1')\nelse:\n print(s)", "n = int(input())\n\na = list(map(int,input()split())\n\ns = 1\nfor i in a:\n s = s*i\nif s > 10**18:\n print('-1')\nelse:\n print(s)", "n = int(input())\n\na = list(map(int,input().split()))\n\ns = 1\nfor i in a:\n s = s*i\n s = min(s,10**18+1)\nif s == 10**18+1:\n print('-1')\nelse:\n print(s)"]
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s036171986', 's900531786', 's304296647']
|
[8948.0, 9012.0, 21684.0]
|
[22.0, 24.0, 76.0]
|
[132, 131, 160]
|
p02658
|
u999287037
| 2,000 | 1,048,576 |
Given N integers 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 A:\n ans *= i\n\nif ans > 1000000000000000000:\n print(-1) \nelif ans < 1000000000000000000:\n print(ans)', 'def main():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A:\n print(0)\n return\n\n ans = 1\n for i in A:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n return\n print(ans)\nmain()']
|
['Wrong Answer', 'Accepted']
|
['s863839066', 's097916303']
|
[21776.0, 21508.0]
|
[2206.0, 48.0]
|
[181, 265]
|
p02658
|
u999503965
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(inut())\nx = [input() for i in range(n)]\n\nans = 1\nfor i in x:\n ans = ans*i\n \nprint(ans)\n', 'from functools import reduce\nfrom operator import add, mul\n \nn=int(input())\nx=list(map(int, input().split()))\n \nans=reduce(mul, x)\n \nif ans>=1000000000000000000:\n ans=-1\nprint(ans)\n', 'n=int(input())\nx=list(int(input().split())\n \nans = 1\nfor i in x:\n ans = ans*i\n \nif ans > 1000000000000000000:\n ans = -1\nprint(ans)\n', 'n=int(input())\nx=[int(input()) for i in range(n)]\n \nans=1\nfor i in x:\n ans = ans*i\n \nif ans > 1000000000000000000:\n ans=-1\nprint(ans)', 'n=int(input())\nx=list(map(int, input().split()))\n\nans=1\nif 0 in x:\n print(0)\n break\n for i in x:\n ans=ans*i \nif ans>=1000000000000000000:\n ans=-1\nprint(ans)', 'n = int(input())\nx = [int(input().split()) for i in range(n)]\n \nans = 1\nfor i in x:\n ans = ans*i\n \nif ans > 1000000000000000000:\n ans = -1\nprint(ans)', 'n=int(input())\nx=list(map(int, input().split()))\n \nans=1\nif 0 in x:\n ans=0\nelse:\n for i in x:\n ans*=i \n if ans>=10**18:\n ans=-1\n break\nprint(ans)', 'n = int(input())\nx = [int(input()) for i in range(n)]\n\nans = 1\nfor i in x:\n ans = ans*i\n \nif ans > 1000000000000000000:\n ans = -1\n\nprint(ans)\n', 'n=int(input())\nx=list(map(int, input().split()))\n \nans=1\nif 0 in x:\n ans=0\nelse:\n for i in x:\n ans*=i \n if ans>=1000000000000000000:\n ans=-1\n break\nprint(ans)', 'n = int(input())\nx = [input() for i in range(n)]\n\nans = 1\nfor i in x:\n ans = ans*i\n \nif ans > 1000000000000000000:\n ans = -1\n\nprint(ans)', 'n = int(inut())\nx = [input() for i in range(n)]\n\nans = 1\nfor i in x:\n ans*i\n \nprint(ans)', 'n=int(input())\nx=list(map(int, input().split()))\n \nans=1\nif 0 in x:\n ans=0\nelse:\n for i in x:\n ans=ans*i\n if ans>10**18:\n ans=-1\n break\nprint(ans)']
|
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s003072922', 's080023983', 's085454209', 's085472963', 's183129320', 's239124105', 's264782158', 's715600900', 's761984847', 's868219216', 's876465177', 's685317646']
|
[9096.0, 22952.0, 9016.0, 12592.0, 9112.0, 19428.0, 21632.0, 12740.0, 21476.0, 12700.0, 9036.0, 21780.0]
|
[22.0, 2206.0, 22.0, 33.0, 24.0, 31.0, 46.0, 32.0, 48.0, 27.0, 22.0, 50.0]
|
[97, 183, 134, 136, 164, 152, 163, 145, 176, 139, 90, 164]
|
p02658
|
u999529302
| 2,000 | 1,048,576 |
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
|
['n = int(input())\na = list(map(int, input().split()))\nresult = 1\n\nfor i in a:\n result = i * result\n \nif result >= 1000000000000000000:\n result = -1\n\nprint(result)\n', 'N = int(input())\nA = list(map(int,input().split()))\nA = sorted(A)\ncount = 1\nfor i in A:\n count *= i\n if count > 10**18:\n print(-1)\n break\nelse:\n print(count)']
|
['Wrong Answer', 'Accepted']
|
['s948498754', 's631392194']
|
[21648.0, 21468.0]
|
[2206.0, 91.0]
|
[165, 178]
|
p02660
|
u000037600
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['import math\na=int(input())\nb=[]\nans=0\nfor i in range(1,int(math.sqrt(a)),1):\n if a%i==0:\n b=b+[i]+[int(a/i)]\nb.remove(1)\nfor i in b:\n cnt=0\n if a%i==0:\n while a%i==0:\n cnt+=1\n a=a/i\n ans+=(math.sqrt(2*cnt+0.25)-0.5)//1\nprint(int(ans))', 'import math\na=int(input())\nans=0\nfor i in range(1,int(math.sqrt(a)),1):\n if a%i==0 and not i==1:\n cnt=0\n while a%i==0:\n cnt+=1\n a=a/i\n ans+=(math.sqrt(2*cnt+0.25)-0.5)//1\nif not a==1:\n print(int(ans+1))\nelse:\n print(int(ans))']
|
['Runtime Error', 'Accepted']
|
['s721875462', 's569415023']
|
[9208.0, 9244.0]
|
[150.0, 147.0]
|
[256, 247]
|
p02660
|
u000085263
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['from functools import reduce\ndef divgame(n): \n r=set(reduce(list.__add__, \n ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))\n r=len(r)\n if r%2==0:\n return r/2\n else:\n return (r-1)/2\ninp=int(input())\nprint(int(divgame(inp)))', 'import math \ndef prime(n):\n d = {}\n if n%2==0:\n d[2]=0\n while n % 2 == 0: \n d[2]+=1\n n = n / 2\n for i in range(3,int(math.sqrt(n))+1,2):\n if n%i==0:\n d[i]=0\n while n % i== 0: \n d[i]+=1\n n = n / i \n if n > 2:\n d[n]=1\n return d\ndef maxsum(di):\n ans = 0\n for i in di.items():\n c = 1\n x = 0\n y = i[1]\n while y-c>=0:\n #print(y, c, x)\n y-=c\n c+=1\n x+=1\n ans+=x\n return ans\ndi = prime(int(input()))\n#print(di)\nprint(maxsum(di))\n']
|
['Wrong Answer', 'Accepted']
|
['s399339228', 's747862901']
|
[9960.0, 9092.0]
|
[118.0, 123.0]
|
[281, 602]
|
p02660
|
u010178026
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['n = int(input())\nb = n\ndef pf(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nl = list(set(pf(n)))\ncnt = 0\nfor i in l:\n n = b\n t = 1\n j = i\n while i <= n:\n if n % i == 0:\n cnt += 1\n n = n // i\n a.append(i)\n i *= j\nprint(cnt)', 'n = int(input())\nb = n\ndef pf(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nl = list(set(pf(n)))\ncnt = 0\nfor i in l:\n n = b\n t = 1\n j = i\n while i <= n:\n if n % i == 0:\n cnt += 1\n n = n // i\n i *= j\nprint(cnt)']
|
['Runtime Error', 'Accepted']
|
['s999812646', 's699858568']
|
[9256.0, 9224.0]
|
[92.0, 90.0]
|
[488, 464]
|
p02660
|
u013864607
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['import os\n\nN = int(input())\n\ndef prime_fact(value):\n \n import math\n prime_list = {}\n prime = 2\n loop_num = 0\n while 1:\n loop_num+=1\n if math.sqrt(value)<loop_num:\n prime_list[int(value)] = 1\n break\n if value%prime==0:\n value/=prime\n if prime in prime_list.keys():\n prime_list[prime]+=1\n else:\n prime_list[prime]=1\n else:\n prime+=1\n if value == 1:\n break\n return prime_list\n\ndef sieve(max_num):\n \n droped = []\n uniqued = []\n prime_list = list(range(2, max_num+1))\n for i, current_num in enumerate(prime_list):\n if current_num in droped:\n continue\n else:\n uniqued.append(current_num)\n if i+1>=len(prime_list):\n break\n for num in prime_list[i+1:]:\n if num in droped:\n continue\n if num%current_num==0:\n droped.append(num)\n return uniqued\n\ntmp = prime_fact(N)\nresult = 0\nfor prime, num in tmp.items():\n diff = 1\n while num>0:\n num-=diff\n if num<0:\n break\n diff+=1\n result+=1\nprint(result)\n', 'import os\n\nN = int(input())\n\ndef prime_fact(value):\n \n import math\n prime_list = {}\n prime = 2\n loop_num = 0\n while 1:\n if int(math.sqrt(value))+100<loop_num:\n prime_list[int(value)] = 1\n break\n if value%prime==0:\n value/=prime\n if prime in prime_list.keys():\n prime_list[prime]+=1\n else:\n prime_list[prime]=1\n else:\n prime+=1\n if value == 1:\n break\n loop_num+=1\n return prime_list\n\ndef sieve(max_num):\n \n droped = []\n uniqued = []\n prime_list = list(range(2, max_num+1))\n for i, current_num in enumerate(prime_list):\n if current_num in droped:\n continue\n else:\n uniqued.append(current_num)\n if i+1>=len(prime_list):\n break\n for num in prime_list[i+1:]:\n if num in droped:\n continue\n if num%current_num==0:\n droped.append(num)\n return uniqued\n\ntmp = prime_fact(N)\nresult = 0\nfor prime, num in tmp.items():\n diff = 1\n while num>0:\n num-=diff\n if num<0:\n break\n diff+=1\n result+=1\nprint(result)\n']
|
['Wrong Answer', 'Accepted']
|
['s745128151', 's662160837']
|
[9224.0, 9292.0]
|
[270.0, 355.0]
|
[1551, 1560]
|
p02660
|
u014958112
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n \nimport sys \nN = int(input())\nif N == 1:\n print(0)\n sys.exit()\n# if isPrime(N)==True:\n# print(0)\nfact = factorization(N)\nfact_num = []\nfact_num2 = []\n \n \nfor i in range(len(fact)):\n fact_num.append(fact[i][0])\n fact_num2.append(fact[i][1])\n \ncnt=0\n \nfor j in range(10**12):\n for i in range(len(fact)):\n if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:\n N = N/(fact_num[i]*(j+1))\n cnt+=1\n \nprint(cnt) \n ', '\nN = int(input())\nfact = factorization(N)\nfact_num = []\nfact_num2 = []\n\n \nfor i in range(len(fact)):\n fact_num.append(fact[i][0])\n fact_num2.append(fact[i][1])\n\ncnt=0\n\nfor j in range(1000000):\n for i in range(len(fact)):\n if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:\n N = N/(fact_num[i]*(j+1))\n cnt+=1\n\nprint(cnt) \n \n\n\n', 'import sys \nN = int(input())\nif N == 1:\n print(0)\n sys.exit()\n# if isPrime(N)==True:\n# print(0)\nfact = factorization(N)\nfact_num = []\nfact_num2 = []\n\n \nfor i in range(len(fact)):\n fact_num.append(fact[i][0])\n fact_num2.append(fact[i][1])\n\ncnt=0\n\nfor j in range(1000000):\n for i in range(len(fact)):\n if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:\n N = N/(fact_num[i]*(j+1))\n cnt+=1\n\nprint(cnt) \n \n\n ', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n \nimport sys \nN = int(input())\nif N == 1:\n print(0)\n sys.exit()\n\nfact = factorization(N)\nfact_num = []\nfact_num2 = []\n \n\nfor i in range(len(fact)):\n fact_num.append(fact[i][0])\n fact_num2.append(fact[i][1])\n\ncnt=0\n\nfor j in range(max(fact_num2)):\n for i in range(len(fact)):\n if N%fact_num[i]==0 and N%(fact_num[i]**(j+1))==0:\n N = N/(fact_num[i]**(j+1))\n cnt+=1\n print(N)\n if N==1:\n print(cnt)\n sys.exit()\nprint(cnt)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n \nimport sys \nN = int(input())\nif N == 1:\n print(0)\n sys.exit()\n\nfact = factorization(N)\nfact_num = []\nfact_num2 = []\n \n\nfor i in range(len(fact)):\n fact_num.append(fact[i][0])\n fact_num2.append(fact[i][1])\n\ncnt=0\n\nfor j in range(max(fact_num2)+1):\n for i in range(len(fact)):\n if N%fact_num[i]==0 and N%(fact_num[i]**(j+1))==0:\n N = N/(fact_num[i]**(j+1))\n cnt+=1\n\n if N==1:\n print(cnt)\n sys.exit()\nprint(cnt)']
|
['Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s488740730', 's833358470', 's839868572', 's955194046', 's672860103']
|
[9432.0, 9204.0, 9196.0, 9532.0, 9472.0]
|
[2206.0, 25.0, 22.0, 111.0, 111.0]
|
[822, 384, 483, 872, 854]
|
p02660
|
u018168283
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['n = int(input())\nans = 0\ni = 2\n\nwhile n>1 and i*i<=n:\n if n % i == 0:\n c = 0\n while n % i == 0:\n n = n / i\n c += 1\n Y=1\n U=2\n while c>=Y:\n ans=ans+1\n Y=Y+U\n U=U+1\n\n i = i + 1\n \n \nif n > 1:\n ans = 1\n\nprint(ans)', 'n = int(input())\nans = 0\ni = 2\n\nwhile n>1 and i*i<=n:\n if n % i == 0:\n c = 0\n while n % i == 0:\n n = n / i\n c = c + 1\n Y=1\n U=2\n while c>=Y:\n ans=ans+1\n Y=Y+U\n U=U+1\n\n i = i + 1\n \n \nif n > 1:\n ans = 1\n\nprint(ans)', 'n = int(input())\nif n > 1:\n ans = 1\nelse:\n ans = 0\ni = 2\nwhile i<=10**6:\n \n if n % i == 0:\n ans+=1\n n //= i\n\n i += 1\nprint(ans)', 'n = int(input())\nN = n\nans = 0\nd = 0\ni = 2\nwhile n>1 and i*i<=N:\n c = 0\n if n % i == 0:\n d == 1\n while n % i == 0:\n n = int(n / i)\n c += 1\n\n while c>=Y:\n ans=ans+1\n Y=Y+U\n U=U+1\n\n i += 1\n \n \nif n > 1:\n ans = 1\nprint(ans)', 'n = int(input())\nans = 0\nN = n\n\nfor i in range(2,int(n**0.5//1 + 2)):\n if n % i == 0:\n c = 0\n while n%i == 0:\n n//=i\n c += 1\n j = 1\n while c-j >= 0:\n ans += 1\n c -= j\n j += 1\n \nif n > 1:\n ans = ans + 1\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s067500754', 's413947531', 's450499851', 's785494551', 's551745287']
|
[9080.0, 9268.0, 9180.0, 9200.0, 9460.0]
|
[253.0, 268.0, 187.0, 297.0, 146.0]
|
[260, 263, 140, 266, 254]
|
p02660
|
u020472025
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['N = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\ndef check(S):\n for i in range(S):\n if S != 1 and S != 2:\n if (i**2+i) > S:\n return i\n else:\n return 1\n\nif N != 1:\n result = factorization(N) \n print(result)\n\n a = 0\n for r in result:\n b = check(r[1])\n a += b\n\nelse:\n print(0)', 'N = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\ndef check(S):\n for i in range(S):\n if S != 1 and S != 2:\n if (i**2+i) > S:\n return i\n else:\n return 1\n\nif N != 1:\n result = factorization(N) \n print(result)\n\n a = 0\n for r in result:\n b = check(r[1])\n a += b\n print(a)\n\nelse:\n print(0)', 'N = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\ndef check(S):\n if S ==1:\n return 1\n elif S == 2:\n return 1\n elif S == 3:\n return 2\n else:\n for i in range(S):\n if i <= S:\n S -= i\n else:\n return i-1\n\nif N != 1:\n result = factorization(N) \n\n a = 0\n for r in result:\n b = check(r[1])\n a += b\n print(a)\n\nelse:\n print(0)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s025493113', 's582135655', 's875569882']
|
[9528.0, 9476.0, 9496.0]
|
[112.0, 110.0, 114.0]
|
[630, 641, 712]
|
p02660
|
u021387650
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['from decimal import Decimal\nA,B = map(str,input().split())\nA = Decimal(A)\nB = Decimal(B)\nprint(int(A*B))', '# ABC169 D Div Game\n\nn = int(input())\n\ndef factorization(n):\n arr = []\n if n == 1:\n return arr\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nf_list = factorization(n)\ncnt = 0\nfor i in range(len(f_list)):\n _tmp = f_list[i][1]\n j = 1\n while _tmp >= 0:\n _tmp -= j\n j += 1\n cnt += 1\n cnt -= 1\n\nprint(cnt)']
|
['Runtime Error', 'Accepted']
|
['s091329652', 's012174398']
|
[9852.0, 9472.0]
|
[27.0, 109.0]
|
[104, 618]
|
p02660
|
u022215787
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['n = int(input())\narr = []\ntemp = n\nfor i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\nif temp!=1:\n arr.append([temp, 1])\nif arr==[]:\n arr.append([n, 1])\nz = []\nfor i in arr:\n for j in range(1,i[1]+1):\n z.append(i[0]**j)\nz = sorted(set(z))\nc = 0\nfor i in z:\n if n%i == 0:\n c += 1\n n = int(n/i)\nif n == 1:\n c = 0\nprint(c) ', 'n = int(input())\n\nif n == 1:\n c = 0\nelse:\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n z = []\n for i in arr:\n for j in range(1,i[1]+1):\n z.append(i[0]**j)\n z = sorted(set(z))\n c = 0\n for i in z:\n if n%i == 0:\n c += 1\n n = int(n/i)\nprint(c) ']
|
['Wrong Answer', 'Accepted']
|
['s616804261', 's522238519']
|
[9496.0, 9504.0]
|
[150.0, 140.0]
|
[474, 573]
|
p02660
|
u022979415
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
["from math import log, floor, sqrt\n\n\ndef main():\n n = int(input())\n prime = [2]\n i = 3\n while i * i <= pow(10, 9) + 10:\n if all(i % pp != 0 for pp in prime):\n prime.append(i)\n i += 1\n ans = 1\n is_one = n == 1\n for p in prime:\n if n % p == 0:\n d = floor(log(n * (p - 1) + p, p))\n ans += floor(sqrt(d))\n print(ans, n, d, p)\n n //= p * (pow(p, d) - 1) // (p - 1)\n if n <= 1:\n break\n print(ans if not is_one else 0)\n\n\nif __name__ == '__main__':\n main()\n\n", "from collections import Counter\n\n\ndef main():\n n = int(input())\n m = n\n factorization_p = []\n while m % 2 == 0:\n factorization_p.append(2)\n m //= 2\n prime_num = 3\n while prime_num * prime_num <= m:\n if m % prime_num == 0:\n factorization_p.append(prime_num)\n m //= prime_num\n else:\n prime_num += 2\n if m != 1:\n factorization_p.append(m)\n factorization_p = Counter(factorization_p)\n answer = 0\n for _, p in factorization_p.items():\n i = 1\n p *= 2\n while i * (i + 1) <= p:\n answer += 1\n i += 1\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n\n"]
|
['Wrong Answer', 'Accepted']
|
['s202930631', 's859859495']
|
[9288.0, 9436.0]
|
[519.0, 96.0]
|
[570, 691]
|
p02660
|
u023762741
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['\nimport collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nc = collections.Counter(prime_factorize(int(input())))\n\na = 0\nprint(c)\nfor i in c.values():\n # print(i)\n x = 1\n while i > 0:\n i -= x\n a += 1\n x += 1\n print(i,x,a)\n if i < 0 :\n a -= 1\n\n\n\n\n\n# else :\n\n# a += 1\nprint(a)', '\nimport collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nc = collections.Counter(prime_factorize(int(input())))\n\na = 0\nprint(c)\nfor i in c.values():\n # print(i)\n x = 1\n while i > 0:\n i -= x\n a += 1\n x += 1\n print(i,x,a)\n if i < 0 :\n a -= 1\n\n\n\n\n\n# else :\n\n# a += 1\nprint(a)', 'import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nc = collections.Counter(prime_factorize(int(input())))\n\na = 0\n# print(c)\nfor i in c.values():\n # print(i)\n x = 1\n while i > 0:\n i -= x\n a += 1\n x += 1\n # print(i,x,a)\n if i < 0 :\n a -= 1\n\n\n\n\n\n# else :\n\n# a += 1\nprint(a)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s165766835', 's493374260', 's181994901']
|
[9468.0, 9472.0, 9468.0]
|
[96.0, 94.0, 98.0]
|
[682, 682, 685]
|
p02660
|
u026788530
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['n=int(input())\n_n=n\nans=0\nfor i in range(2,1000002):\n if n%i==0:\n ans+=1\n n/=i\n # print(i,ans)\n if n==1:\n break\n\nif n==_n:\n ans+=1\nif n==1:\n ans-=1\nprint(ans)', 'n=int(input())\n_n=n\nif n==1:\n print(0)\n exit()\nans=0\nfor i in range(2,10**6+9):\n c=i\n while(n%c==0):\n n//=c\n ans+=1\n c*=i\n while(n%i==0):\n n//=i\n if n==1:\n break\nif i<n:\n ans+=1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s936606726', 's289028554']
|
[9240.0, 9200.0]
|
[198.0, 287.0]
|
[198, 244]
|
p02660
|
u029056424
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['Number=int(input())\n\ntimes=0\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n \n if n==1:\n return []\n else:\n return arr\n\n\nFactors=factorization(Number)\n#print(Factors)\n\nfor i in Factors:\n times+=i[1]\nprint(times)\n', 'Number=int(input())\n#Number=997764507000\n\ntimes=0\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n \n if n==1:\n return []\n else:\n return arr\n\n\nFactors=factorization(Number)\nprint(Factors)\n\nfor i in Factors:\n Power=i[1]\n BiggerThan=0\n MinusPower=1\n \n while Power>BiggerThan:\n times+=1\n Power-=MinusPower\n MinusPower+=1\n BiggerThan+=1\n\nprint(times)', 'Number=int(input())\n\ntimes=0\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n \n if n==1:\n return []\n else:\n return arr\n\n\nFactors=factorization(Number)\n#print(Factors)\n\nfor i in Factors:\n Power=i[1]\n BiggerThan=0\n MinusPower=1\n \n while Power>BiggerThan:\n times+=1\n Power-=MinusPower\n MinusPower+=1\n BiggerThan+=1\n\nprint(times)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s193783431', 's607937335', 's945958247']
|
[9312.0, 9476.0, 9408.0]
|
[116.0, 117.0, 115.0]
|
[527, 700, 680]
|
p02660
|
u036514535
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['import math\nN = int(input())\nif N == 1:\n print(0)\n exit()\nans = 0\nfor i in range(2, int(math.sqrt(N))+1):\n if N % i == 0:\n N = N // i\n print(N,i)\n ans += 1\n if N == 1:\n break\nprint(ans)\n', 'import math\nN = int(input())\nif N == 1:\n print(0)\n exit()\ndiv = {}\nfor i in range(2, int(math.sqrt(N))+1):\n while N % i == 0:\n N = N // i\n if i in div:\n div[i] += 1\n else:\n div[i] = 1\n if N == 1:\n break\nif N != 1:\n div[N] = 1\nans = 0\nfor v in div.values():\n i = 1\n while v >= i:\n v -= i\n i += 1\n ans += 1\nprint(ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s052348078', 's217701957']
|
[8948.0, 9204.0]
|
[170.0, 169.0]
|
[226, 408]
|
p02660
|
u044220565
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['# coding: utf-8\nimport sys\n\n# from operator import itemgetter\nsysread = sys.stdin.readline\nread = sys.stdin.read\n#from heapq import heappop, heappush\n#from collections import defaultdict\n\nsys.setrecursionlimit(10 ** 7)\n# import math\n# from itertools import product, accumulate, combinations, product\n\n#import numpy as np\n# from copy import deepcopy\n#from collections import deque\n#import numba\nimport math\n\ndef run():\n N = int(input())\n\n primes = []\n p = [0] * 1000000\n\n for i in range(2, 1000000):\n done = False\n m = int(i ** (1/2))\n for k in primes:\n if k > m:break\n if i % k == 0:\n done = True\n break\n if not done:\n primes.append(i)\n p[i] = 1\n\n\n count = 0\n\n for i in primes:\n if p[2]:\n s = i\n while True:\n if not N % s:\n\n N = N // s\n count += 1\n s *= i\n\n else:break\n s = s // i\n while s > 0:\n if not N % s:\n N = N // s\n else:\n s = s // i\n\n if count == 0 and N != 1:\n print(1)\n elif N != 1:\n print(count + 1)\n else:\n print(count)\n\n\n\nif __name__ == "__main__":\n run()', '# coding: utf-8\nimport sys\n\n# from operator import itemgetter\nsysread = sys.stdin.readline\nread = sys.stdin.read\n#from heapq import heappop, heappush\n#from collections import defaultdict\n\nsys.setrecursionlimit(10 ** 7)\n# import math\n# from itertools import product, accumulate, combinations, product\n\n#import numpy as np\n# from copy import deepcopy\n#from collections import deque\n#import numba\nimport math\n\ndef run():\n N = int(input())\n\n primes = []\n p = [0] * 1000000\n\n for i in range(2, 1000000):\n done = False\n m = int(i ** (1/2))\n for k in primes:\n if k > m:break\n if i % k == 0:\n done = True\n break\n if not done:\n primes.append(i)\n p[i] = 1\n\n\n count = 0\n\n for i in primes:\n if p[2]:\n s = i\n while True:\n if not N % s:\n\n N = N // s\n count += 1\n s *= i\n\n else:break\n s = s // i\n while s > 1:\n if not N % s:\n N = N // s\n else:\n s = s // i\n\n\n if count == 0 and N != 1:\n print(1)\n elif N != 1:\n print(count + 1)\n else:\n print(count)\n\n\n\nif __name__ == "__main__":\n run()']
|
['Time Limit Exceeded', 'Accepted']
|
['s982401719', 's710545308']
|
[20552.0, 20536.0]
|
[2206.0, 1132.0]
|
[1359, 1360]
|
p02660
|
u049979154
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['import math\nn = int(input())\n\nans = 0\n\nfor i in range(2, math.floor(math.sqrt(n + 1))):\n if n == 1:\n break\n if n % i == 0:\n n = n // i\n ans += 1\n\nif n == 1:\n print(0)\nelif ans == 0:\n print(1)\nelse:\n print(ans)', 'import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nn = int(input())\n\nans = 0\n\nc = collections.Counter(prime_factorize(n))\n\nfor key in c.keys():\n for i in range(1, c[key] + 1):\n if n % (key ** i) == 0:\n n //= (key ** i)\n ans += 1\n\n\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s734361597', 's463533361']
|
[9188.0, 9464.0]
|
[172.0, 93.0]
|
[245, 516]
|
p02660
|
u050584166
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\n\nn = int(input())\nans = factorization(n)\ncnt = 0\nif n == 1:\n print("0")\n exit()\nfor i in ans:\n print(i)\n num = i[1]\n j = 1\n while num - j >= 0:\n num = num - j\n j +=1\n cnt +=1\nprint(cnt)', '\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\n\nn = int(input())\nans = factorization(n)\ncnt = 0\nif n == 1:\n print("0")\n exit()\nfor i in ans:\n num = i[1]\n j = 1\n while num - j >= 0:\n num = num - j\n j +=1\n cnt +=1\nprint(cnt)']
|
['Wrong Answer', 'Accepted']
|
['s114270357', 's570756079']
|
[9480.0, 9436.0]
|
[109.0, 112.0]
|
[595, 582]
|
p02660
|
u053035261
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nn = int(input())\n\nitm = collections.Counter(prime_factorize(n))\n\n# print(itm)\n\nans = 0\n\nfor i in itm.keys():\n num = 1\n while True:\n if itm[i] - num < 0:\n break\n else:\n ans+=1\n itm[i] -= num\n num += 1\n\n# print(itm)\n\ncounter = 0\n\nfor i in itm.keys():\n if itm[i] != 0:\n counter += 1\n\nif counter != 1:\n ans += 1 \n \n \nprint(ans)', 'import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nn = int(input())\n\nitm = collections.Counter(prime_factorize(n))\n\nans = 0\n\nfor i in itm.keys():\n num = 1\n while True:\n if itm[i] - num < 0:\n break\n else:\n ans+=1\n itm[i] -= num\n num += 1\n\ncounter = 0\n\nfor i in itm.keys():\n if itm[i] != 0:\n counter += 1\n\n# if counter != 1:\n# ans += 1 \n \nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s872518189', 's680242409']
|
[9468.0, 9472.0]
|
[95.0, 95.0]
|
[705, 672]
|
p02660
|
u056358163
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['N = int(input())\n\nans = 0\ntemp = N\nfact = []\n\nif N == 1:\n print(0)\n exit()\nfor i in range(2, int(N ** 0.5 + 2)):\n if temp % i == 0:\n n = 0\n while temp % i == 0:\n temp //= i\n n += 1\n fact.append(n)\nif temp != 1:\n fact.append(1)\nprint(fact)\n\nans = 0\nfor f in fact:\n n = f\n i = 1\n while True:\n n -= i\n i += 1\n if n < 0:\n break\n ans += 1\n\nprint(max(ans, 1))', 'N = int(input())\n\nans = 0\ntemp = N\nfact = []\n\nif N == 1:\n print(0)\n exit()\nfor i in range(2, int(N ** 0.5 + 2)):\n if temp % i == 0:\n n = 0\n while temp % i == 0:\n temp //= i\n n += 1\n fact.append(n)\nif temp != 1:\n fact.append(1)\n\nans = 0\nfor f in fact:\n n = f\n i = 1\n while True:\n n -= i\n i += 1\n if n < 0:\n break\n ans += 1\n\nprint(max(ans, 1))']
|
['Wrong Answer', 'Accepted']
|
['s807716750', 's870151154']
|
[9364.0, 9264.0]
|
[153.0, 148.0]
|
[456, 444]
|
p02660
|
u057668615
| 2,000 | 1,048,576 |
Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chosen in previous operations. * Then, replace N with N/z. Find the maximum number of times the operation can be applied.
|
['def p_facto(n):\n ret = []\n nc = n\n for i in range(2, nc):\n if i*i > nc:\n break\n if n % i == 0:\n ex = 0\n while n % i == 0:\n ex += 1\n n //= i\n ret.append([i, ex])\n if n != 1:\n ret.append([n, 1])\n return ret\n\n\ndef main(N):\n ans = 0\n for p, e in pf:\n ex = 1\n while true:\n z = p**ex\n if N % z == 0:\n ans += 1\n N //= z\n else:\n break\n ex += 1\n print(ans)\n\n\nif __name__ == "__main__":\n N = int(input())\n pf = p_facto(N)\n main(N)\n\n', 'import math\ndef get_prime(n):\n if n <= 1:\n return []\n prime = [2]\n if n > 2:\n limit = int(math.sqrt(n))\n odd = [i for i in range(3, n + 1, 2)]\n while limit >= odd[0]:\n prime.append(odd[0])\n odd = [j for j in odd if j % odd[0] != 0]\n prime += odd\n return prime\n\nfrom collections import defaultdict\ndef prime_factorization(n):\n if n <= 1:\n return {}\n else:\n # print(int(math.sqrt(n)))\n prime = get_prime(int(math.sqrt(n)))\n dct = defaultdict(int)\n for p in prime:\n while n % p == 0:\n dct[p] += 1\n n //= p\n if n != 1:\n dct[n] += 1\n dct = dict(dct)\n return dct\n\nn = int(input())\npf = prime_factorization(n)\n\nZ = []\nfor k, v in pf.items():\n for i in range(1, v + 1):\n Z.append(k ** i)\nZ.sort()\ncount = 0\nfor z in Z:\n if n < z:\n count += 1\n n //= z\n if n == 1:\n break\n\nprint(count)', 'import math\ndef get_prime(n):\n if n <= 1:\n return []\n prime = [2]\n if n > 2:\n limit = int(math.sqrt(n))\n odd = [i for i in range(3, n + 1, 2)]\n while limit >= odd[0]:\n prime.append(odd[0])\n odd = [j for j in odd if j % odd[0] != 0]\n prime += odd\n return prime\n\nfrom collections import defaultdict\ndef prime_factorization(n):\n if n <= 1:\n return {}\n else:\n # print(int(math.sqrt(n)))\n prime = get_prime(int(math.sqrt(n)))\n dct = defaultdict(int)\n for p in prime:\n while n % p == 0:\n dct[p] += 1\n n //= p\n if n != 1:\n dct[n] += 1\n dct = dict(dct)\n return dct\n\nn = int(input())\npf = prime_factorization(n)\n\nZ = []\nfor k, v in pf.items():\n for i in range(1, v + 1):\n Z.append(k ** i)\nZ.sort()\ncount = 0\nfor z in Z:\n if n < z:\n count += 1\n n //= z\n\n\nprint(count)', 'def p_facto(n):\n ret = []\n nc = n\n for i in range(2, nc):\n if i*i > nc:\n break\n if n % i == 0:\n ex = 0\n while n % i == 0:\n ex += 1\n n //= i\n ret.append([i, ex])\n if n != 1:\n ret.append([n, 1])\n return ret\n\n\ndef main(N):\n ans = 0\n for p, e in pf:\n ex = 1\n while True:\n z = p**ex\n if N % z == 0:\n ans += 1\n N //= z\n else:\n break\n ex += 1\n print(ans)\n\n\nif __name__ == "__main__":\n N = int(input())\n pf = p_facto(N)\n main(N)\n\n']
|
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s560345736', 's721928383', 's781621619', 's046643448']
|
[9220.0, 31628.0, 31720.0, 9116.0]
|
[156.0, 1403.0, 1365.0, 153.0]
|
[653, 995, 967, 653]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.