Datasets:
Dataset Preview
Full Screen Viewer
Full Screen
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code: DatasetGenerationCastError Exception: DatasetGenerationCastError Message: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 1 new columns ({'p_ user'}) This happened while the json dataset builder was generating data using hf://datasets/qyliang/CodeNanoFix/valid.json (at revision c6af78d3ed9e00fd6015846d23132a4cf00d291a) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations) Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1870, in _prepare_split_single writer.write_table(table) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 622, in write_table pa_table = table_cast(pa_table, self._schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2292, in table_cast return cast_table_to_schema(table, schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2240, in cast_table_to_schema raise CastError( datasets.table.CastError: Couldn't cast problem_id: string p_user: string n_user: string pos: string neg: string jacc_sim: double nl: string before_after_length: list<item: int64> child 0, item: int64 pos_test_status: int64 neg_test_status: int64 p_ user: string to {'problem_id': Value(dtype='string', id=None), 'p_user': Value(dtype='string', id=None), 'n_user': Value(dtype='string', id=None), 'pos': Value(dtype='string', id=None), 'neg': Value(dtype='string', id=None), 'jacc_sim': Value(dtype='float64', id=None), 'nl': Value(dtype='string', id=None), 'before_after_length': Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), 'pos_test_status': Value(dtype='int64', id=None), 'neg_test_status': Value(dtype='int64', id=None)} because column names don't match During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1417, in compute_config_parquet_and_info_response parquet_operations = convert_to_parquet(builder) File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1049, in convert_to_parquet builder.download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 924, in download_and_prepare self._download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1000, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1741, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1872, in _prepare_split_single raise DatasetGenerationCastError.from_cast_error( datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 1 new columns ({'p_ user'}) This happened while the json dataset builder was generating data using hf://datasets/qyliang/CodeNanoFix/valid.json (at revision c6af78d3ed9e00fd6015846d23132a4cf00d291a) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
problem_id
string | p_user
string | n_user
string | pos
string | neg
string | jacc_sim
float64 | nl
string | before_after_length
sequence | pos_test_status
int64 | neg_test_status
int64 |
---|---|---|---|---|---|---|---|---|---|
p02658 | u307622233 | u307622233 | import sys
input = sys.stdin.readline
def main():
n = int(input())
a = [int(i) for i in input().split()]
limit = 10 ** 18
if 0 in a:
print(0)
exit()
ans = 1
for i in a:
ans *= i
if ans > limit:
ans = -1
break
print(ans)
if __name__ == '__main__':
main()
| import sys
input = sys.stdin.readline
def main():
n = int(input())
a = [int(i) for i in input().split()]
limit = 10 ** 18
ans = 1
for i in a:
ans *= i
if ans > limit:
ans = -1
break
print(ans)
if __name__ == '__main__':
main() | 0.945946 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
125,
105
] | 1 | 0 |
p02658 | u382407432 | u382407432 | import sys
N=int(input())
A=list(map(int,(input().split())))
A.sort()
ans=1
for i in range(N):
ans*=A[i]
if(ans>10**18):
print(-1)
sys.exit()
print(ans) | import sys
N=int(input())
A=list(map(int,(input().split())))
ans=1
for i in range(N):
ans*=A[i]
if(ans>10**18):
print(-1)
sys.exit()
print(ans) | 0.96875 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
77,
72
] | 1 | 0 |
p02658 | u949210009 | u949210009 | N = int(input())
A = list(map(int,input().split()))
answer = 1
if not 0 in A:
for i in A:
answer = answer * i
if answer > 10**18:
print("-1")
break
if answer <= 10**18:
print(answer)
else:
print("0") | N = int(input())
A = list(map(int,input().split()))
answer = 1
for i in A:
answer = answer * i
if answer > 10**18:
break
if answer <= 10**18 :
print(answer)
else:
print("-1") | 0.935484 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
88,
73
] | 1 | 0 |
p02658 | u568789901 | u568789901 | N=int(input())
A=[int(a) for a in input().split()]
ans=1
if 0 in A:
print(0)
exit()
for i in range(N):
ans=ans*A[i]
if ans>10**18:
print(-1)
exit()
print(ans)
| N=int(input())
A=[int(a) for a in input().split()]
ans=1
for i in range(len(A)):
ans=ans*A[i]
if ans>10**18:
print(-1)
exit()
elif ans==0:
print(0)
exit()
print(ans)
| 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
84,
88
] | 1 | 0 |
p02658 | u021019433 | u021019433 | input()
r = 1
for x in map(int, input().split()):
if x == 0:
r = 0
break
if r > 0:
r *= x
if r > 1e18:
r = -1
print(r) | input()
r = 1
for x in map(int, input().split()):
if x == 0:
r = 0
break
r *= int(x)
if r > 1e18:
r = -1
break
print(r)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
66,
66
] | 1 | 0 |
p02658 | u862959195 | u862959195 | N=int(input())
A = [int(x) for x in input().split()]
ans=1
if 0 in A:
ans = 0
else:
A.sort(reverse=True)
for a in A:
if a > 10**18:
ans = -1
break
else:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans)
| N=int(input())
A = [int(x) for x in input().split()]
ans=1
if 0 in A:
ans = 0
else:
for a in A:
A.sort(reverse=True)
if a > 10**18:
ans = -1
break
else:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
112,
112
] | 1 | 0 |
p02658 | u875291233 | u875291233 | # coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read
n,*a = map(int,read().split())
x = 1
INF = 10**18
if 0 in a:
print(0)
exit()
for i in a:
x *= i
if x > INF:
print(-1)
break
else:
print(x)
| # coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read
n,*a = map(int,read().split())
x = 1
INF = 10**18
for i in a:
x *= i
if x > INF:
print(-1)
break
else:
print(x)
| 0.95122 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
116,
96
] | 1 | 0 |
p02658 | u831651889 | u831651889 | n=int(input())
A=list(map(int,input().split(" ")))
ans=1
POW=pow(10,18)
check=False
answer=1
for i in range(n):
ans*=A[i]
if ans>POW:
ans=0
check=True
answer=-1
if A[i]==0:
answer=0
if answer<1:
print(answer)
else:
print(ans) | n=int(input())
A=list(map(int,input().split(" ")))
ans=1
POW=pow(10,18)
check=False
for i in range(n):
ans*=A[i]
if ans>POW:
print(-1)
check=True
ans=0
if check==False:
print(ans) | 0.921053 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
119,
92
] | 1 | 0 |
p02658 | u017089477 | u017089477 | n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
zeroexist=0
for i in range(n):
zeroexist+=(l[i]==0)
if zeroexist>0:
print("0")
else:
for i in range(n):
dap*=l[i]
if dap>1000000000000000000:
nodap+=1
break
if nodap==1:
print("-1")
else:
print(dap)
| n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
for i in range(n):
dap*=l[i]
if dap>1000000000000000000:
nodap++
break
if nodap:
print("-1")
else:
print(dap) | 0.970588 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
138,
87
] | 1 | 0 |
p02658 | u099187672 | u099187672 | n = int(input())
a = list(map(int,input().split()))
new = 1
if 0 in a:
print(0)
exit()
for i in a:
new *= i
if new > (10**18):
new = -1
break
print(new)
| n = int(input())
a = list(map(int,input().split()))
new = 1
for i in a:
new *= a
if new > (10**18):
new = -1
break
print(new)
| 0.928571 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
81,
68
] | 1 | 0 |
p02658 | u957872856 | u957872856 | N = int(input())
ans = 1
A = [int(i) for i in input().split()]
if 0 in A:
print(0)
exit()
for a in A:
ans *= a
if ans > 10**18:
print(-1)
exit()
print(ans)
| N = int(input())
ans = 1
A = [int(i) for i in input().split()]
for a in A:
ans *= a
if ans > 10**18:
print(-1)
exit()
print(ans)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
78,
62
] | 1 | 0 |
p02658 | u474137393 | u474137393 | n = int(input())
a = [int(i) for i in input().split()]
number =1
if 0 in a:
print(0)
exit()
for i in a:
number *= i
if number > 10**18:
print(-1)
exit()
print(number) | n = int(input())
a = [int(i) for i in input().split()]
number =1
for i in a:
if i==0:
print(0)
exit()
number *= i
if number > 10**18:
print(-1)
exit()
print(number) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
80,
80
] | 1 | 0 |
p02658 | u904331908 | u904331908 | n = int(input())
p = list(map(int,input().split()))
ans = 1
dotira = False
s = 10**18
if 0 in p :
print(0)
else:
for x in p:
ans = ans * x
if ans > s:
dotira = True
break
if dotira:
print(-1)
else:
print(ans)
| n = int(input())
p = list(map(int,input().split()))
ans = 1
dotira = False
for x in p:
ans = ans * x
if ans > 10 ** 18:
dotira = True
break
if dotira:
print(-1)
else:
print(ans)
| 0.9375 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
110,
85
] | 1 | 0 |
p02658 | u355213193 | u355213193 | N=int(input())
A=list(map(int,input().split()))
A.sort()
B=1
for i in range(0,len(A)):
B=A[i]*B
if(B>10**18):
B=-1
break
print(B) | N=int(input())
A=list(map(int,input().split()))
B=1
for i in range(0,len(A)):
B=A[i]*B
if(B>10**18):
B=-1
break
print(B) | 0.96875 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
74,
69
] | 1 | 0 |
p02658 | u382639013 | u382639013 | N = int(input())
A = list(map(int, input().split()))
ans = 1
if any([i ==0 for i in A]):
ans =0
for i in range(N):
ans = ans * A[i]
if ans == 0:
ans = 0
break
if ans >10**18:
ans= -1
break
else:
pass
print(ans) | N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
ans = ans * A[i]
if ans >=10**18:
ans= -1
break
else:
pass
if ans == 0:
ans = 0
break
print(ans) | 0.969697 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
110,
88
] | 1 | 0 |
p02658 | u021387650 | u021387650 | N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A:
print(0)
exit()
for i in range(N):
ans *= A[i]
if ans > 10**18:
print(-1)
exit()
print(ans)
| N = int(input())
A = list(map(int,input().split()))
ans = 1
for i in range(len(A)):
ans *= A[i]
if ans >= 10**18:
ans = -1
print(ans) | 0.903226 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
86,
67
] | 1 | 0 |
p02658 | u347134705 | u347134705 | import sys
N = int(input())
x = list(map(int,input().split()))
z = 1
if 0 in x:
print(0)
sys.exit()
for a in x:
z = a*z
if z > 10**18:
print(-1)
sys.exit()
print(z) | N = input()
x = list(map(int,input().split()))
z = 1
if N == 0:
print(0)
for a in x:
z = a*z
if z > 10**18:
print(-1)
exit()
print(z) | 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
90,
75
] | 1 | 0 |
p02658 | u731603651 | u731603651 | n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
res = 1
for i in a:
res *= i
if res > 10 ** 18:
print(-1)
exit()
print(res)
| n = int(input())
a = list(map(int, input().split()))
res = 1
for i in a:
res *= i
if res > 10 ** 18:
print(-1)
exit()
print(res)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
67,
60
] | 1 | 0 |
p02658 | u871867619 | u871867619 | N = int(input())
A = list(map(int, input().split()))
result = 1
A.sort()
for i in A:
result *= i
if result > 10**18:
result = -1
break
print(result)
| N = int(input())
A = list(map(int, input().split()))
result = 1
for i in A:
result *= i
if result > 10**18:
result = -1
break
print(result)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
66,
61
] | 1 | 0 |
p02658 | u267727566 | u744695362 | n=int(input())
a=list(map(int,input().split()))
if 0 in a:
print(0)
exit()
ans=1
for i in range(n):
ans*=a[i]
if ans>10**18:
print(-1)
exit()
print(ans) | n = int(input())
a = list(map(int, input().split()))
f = 1
for i in range(n):
f = f*a[i]
if f>10**18:
print(-1)
exit()
print(f) | 0.903226 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
81,
70
] | 1 | 0 |
p02658 | u975116284 | u975116284 | LI = lambda: list(map(int, input().split()))
n = int(input())
a = LI()
prod = 1
if 0 in a:
print(0)
else:
for x in a:
prod *= x
if prod > 10**18:
print(-1)
break
else:
print(prod) | LI = lambda: list(map(int, input().split()))
n =int(input())
a = LI()
prod = 1
for x in a:
prod *= x
if prod > 10**18:
print(-1)
break
else:
print(prod) | 0.966667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
87,
70
] | 1 | 0 |
p02658 | u531427291 | u531427291 | n = int(input())
a = list(map(int, input().split()))
if 0 in a:
print(0)
else:
ans = 1
for i in range(n):
ans *= a[i]
if ans > 10**18:
print(-1)
break
else:
print(ans) | n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
ans *= a[i]
if ans > 10**18:
print(-1)
break
else:
print(ans) | 0.967742 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
86,
69
] | 1 | 0 |
p02658 | u007808656 | u007808656 | def main():
n=int(input())
anums=list(map(int,input().split()))
res=1
if 0 in anums:
return 0
for anum in anums:
res*=anum
if res>10**18:
return -1
return res
print(main()) | def main():
n=int(input())
anums=list(map(int,input().split()))
res=1
for anum in anums:
res*=anum
if res>10**18:
return -1
return res
print(main())
| 0.965517 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
86,
75
] | 1 | 0 |
p02658 | u200527996 | u200527996 | N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
print(0)
exit()
for i in range(N):
ans *= A[i]
if ans > 10**18:
print(-1)
exit()
print(ans) | N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
ans *= A[i]
if ans == 0:
print(0)
exit()
elif ans >= 10**18:
print(-1)
exit()
print(ans)
| 0.967742 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
80,
82
] | 1 | 0 |
p02658 | u836939578 | u836939578 | import sys
input = lambda: sys.stdin.readline().rstrip()
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
exit()
upto = 10 ** 18
ans = 1
for num in A:
ans *= num
if ans > upto:
print("-1")
exit()
print(ans) | import sys
input = lambda: sys.stdin.readline().rstrip()
N = int(input())
A = list(map(int, input().split()))
upto = 10 ** 18
ans = 1
for num in A:
ans *= num
if ans > upto:
print(-1)
exit()
print(ans) | 0.942857 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
104,
86
] | 1 | 0 |
p02658 | u421664751 | u421664751 | input()
A = list(map(int, input().split()))
ans = 1
if 0 in A:
print(0)
exit()
for a in A:
ans *= a
if 1000000000000000000 < ans:
print(-1)
exit()
print(ans)
| input()
A = map(int, input().split())
ans = 1
if 0 in A:
print(0)
exit()
for a in A:
ans *= a
if 1000000000000000000 < ans:
print(-1)
exit()
print(ans) | 0.96 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
75,
71
] | 1 | 0 |
p02658 | u532955973 | u532955973 | MAX = 10 ** 18
N = int(input())
liste = list(map(int, input().split()))
res = 1
for i in range(N):
if(liste[i] == 0):
print(0)
exit(0)
for i in range(N):
res *= liste[i]
#print(res, liste[i])
if(res > MAX):
print(-1)
exit(0)
if(res > MAX):
print(-1)
else:
print(res)
| MAX = 10 ** 18
N = int(input())
liste = list(map(int, input().split()))
res = 1
for i in range(N):
#if(res*2 > MAX):
# print(-1)
# exit(0)
res *= liste[i]
if(res > MAX):
print(-1)
exit(0)
if(res > MAX):
print(-1)
else:
print(res)
| 0.970588 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
137,
121
] | 1 | 0 |
p02658 | u102305348 | u102305348 | N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
else:
ans = 1
for a in A:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans) | N = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans) | 0.928571 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
78,
60
] | 1 | 0 |
p02658 | u941407962 | u941407962 | N, = map(int, input().split())
X = sorted(list(map(int, input().split())))
R = 1
for x in X:
if x == 0:
print(0)
break
R*=x
if R >10**18:
print(-1)
break
else:
print(R)
| N, = map(int, input().split())
X = list(map(int, input().split()))
R = 1
for x in X:
R*=x
if R >10**18:
print(-1)
break
else:
print(R)
| 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
87,
69
] | 1 | 0 |
p02658 | u608007704 | u608007704 | N=int(input())
X=list(map(int,input().split()))
result=1
for i in X:
result*=i
if result>10**18:
result=-1
break
for i in X:
if i==0:result=0
print(result)
| N=int(input())
X=list(map(int,input().split()))
result=1
for i in X:
result*=i
if result>10**18:
result=-1
break
print(result) | 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
78,
60
] | 1 | 0 |
p02658 | u087118202 | u087118202 | n=int(input())
l=list(map(int,input().split()))
c=1
if not 0 in l:
for li in l:
c*=li
if c > 10**18:
break
if c > 10**18:
print('-1')
else:
print(c)
else:
print(0) | n=int(input())
l=list(map(int,input().split()))
c=1
if not 0 in l:
for li in l:
c*=li
if c > 10**18:
print('-1')
break
print(c)
else:
print(0) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
93,
78
] | 1 | 0 |
p02658 | u983234117 | u983234117 | n = int(input())
a = list(map(int,input().split()))
if 0 in a:
print(0)
else:
s = 1
for i in range(n):
s *= a[i]
if s > 10**18:
break
elif a[i] == 0:
break
if s > 10**18:
print(-1)
else:
print(s)
| n = int(input())
a = list(map(int,input().split()))
s = 1
for i in range(n):
s *= a[i]
if s > 1000000000000000000:
break
elif a[i] == 0:
break
if s > 1000000000000000000:
print(-1)
else:
print(s) | 0.909091 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
111,
90
] | 1 | 0 |
p02658 | u755830696 | u755830696 | n = int(input())
a = list(map(int, input().split()))
printed = False
if 0 in a:
print(0)
printed = True
ans = 1
for x in a:
ans *= x
if ans > 1e18:
if not printed:
print(-1)
printed = True
break
if not printed:
print(ans) | n = int(input())
a = list(map(int, input().split()))
ans = 1
printed = False
for x in a:
ans *= x
if ans > 1e18:
print(-1)
printed = True
if not printed:
print(ans) | 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
103,
78
] | 1 | 0 |
p02658 | u638970023 | u638970023 | MX = 10**18
def fun(a,n):
if max(a) > MX:
return -1
if 0 in a:
return 0
res = a[0]
for i in range(1,n):
res = res * a[i]
if res > MX:
return -1
return res
n = int(input())
a = list(map(int,input().split()))
print(fun(a,n)) | MX = 10**18
def fun(a,n):
res = a[0]
for i in range(1,n):
res = res * a[i]
if res > MX:
return -1
return res
n = int(input())
a = list(map(int,input().split()))
print(fun(a,n)) | 0.970588 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
120,
92
] | 1 | 0 |
p02658 | u029056424 | u029056424 | N=input()
Alist=list(map(int, input().split()))
MultipliedNum=1
index=0
if min(Alist)==0:
print(0)
index=1
else:
for i in Alist:
MultipliedNum*=i
if MultipliedNum>10**18:
print(-1)
index=1
break
if index==0:
print(MultipliedNum) | N=input()
Alist=list(map(int, input().split()))
MultipliedNum=1
index=0
for i in Alist:
MultipliedNum*=i
if MultipliedNum>10**18:
print(-1)
index=1
break
if index==0:
print(MultipliedNum) | 0.935484 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
114,
89
] | 1 | 0 |
p02658 | u984529214 | u984529214 | n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
if a[i] == 0:
print(0)
exit()
for i in range(n):
ans *= a[i]
if ans > 1e18:
print(-1)
exit()
if ans > 1e18:
print(-1)
else:
print(ans)
| n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
ans *= a[i]
if ans > 1e18:
print(-1)
exit()
if ans > 1e18:
print(-1)
else:
print(ans)
| 0.966667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
111,
83
] | 1 | 0 |
p02658 | u697559326 | u697559326 | N = int(input())
A = list(map(int, input().split()))
limit = 10**18+1
mul = 1
if 0 in A:
print("0")
else:
for i in A:
mul *= i
if mul >= limit:
print("-1")
break
if mul < limit:
print(mul)
| N = int(input())
A = map(int, input().split())
limit = 10**18+1
mul = 1
for i in A:
mul *= i
if mul >= limit:
print("-1")
break
if mul < limit:
print(mul)
| 0.90625 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
91,
72
] | 1 | 0 |
p02658 | u419963262 | u419963262 | n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
if ans>10**18:
check=1
break
else:
ans*=a[i]
if ans>10**18:
check=1
print([ans,-1][check]) | n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
if ans>=10**18:
check=1
break
else:
ans*=a[i]
print([ans,-1][check])
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
91,
80
] | 1 | 0 |
p02658 | u297109012 | u297109012 |
def solve(N, As):
ans = 1
for a in sorted(As):
ans *= a
if ans == 0:
return 0
if ans > 10 ** 18:
return -1
return ans
if __name__ == "__main__":
N = int(input())
As = list(map(int, input().split(" ")))
print(solve(N, As))
|
def solve(N, As):
ans = 1
for a in As:
ans *= a
if ans > 10 ** 18:
return -1
return ans
if __name__ == "__main__":
N = int(input())
As = list(map(int, input().split(" ")))
print(solve(N, As))
| 0.939394 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
105,
91
] | 1 | 0 |
p02658 | u095094246 | u095094246 | import sys
n=int(input())
a=list(map(int,input().split()))
x = 1
if 0 in a:
print(0)
sys.exit()
for i in a:
x = x * i
if x > 10**18:
print(-1)
sys.exit()
print(x) | import sys
n=int(input())
a=list(map(int,input().split()))
x = 1
for i in a:
x *= i
if x > 10**18:
print('-1')
sys.exit()
print(x)
| 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
84,
67
] | 1 | 0 |
p02658 | u049191820 | u049191820 | n = int(input())
x = list(map(int, input().split()))
ans = 1
if 0 in x: ans=0
for i in x:
ans*=i
if ans > 1000000000000000000:
print(-1)
exit()
print(ans) | n = int(input())
x = list(map(int, input().split()))
ans = 1
if 0 in x: ans=0
for i in x:
ans*=i
print(i,ans)
if ans > 1000000000000000000:
print(-1)
exit()
print(ans) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
72,
80
] | 1 | 0 |
p02658 | u291988695 | u291988695 | n=int(input())
l=list(map(int,input().split()))
l.sort()
a=1
for i in l:
a=a*i
if a>1000000000000000000:
a=-1
break
if a==0:
break
print(a)
| n=int(input())
l=list(map(int,input().split()))
a=1
for i in l:
a=a*i
if a>1000000000000000000:
a=-1
break
print(a) | 0.925926 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
76,
60
] | 1 | 0 |
p02658 | u039355749 | u039355749 | import sys
n = int(input())
As = list(map(int, input().split()))
if 0 in As:
print(0)
sys.exit()
ans = 1
for i in range(n):
ans = ans*As[i]
if ans > 10**18:
print(-1)
sys.exit()
print(ans) | n = int(input())
As = list(map(int, input().split()))
ans = 1
for i in range(n):
ans = ans * As[i]
if (ans > 10**18):
print(-1)
sys.exit()
print(ans) | 0.9375 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
95,
72
] | 1 | 0 |
p02658 | u959340534 | u959340534 | n = int(input())
an = list(map(int, input().split()))
s = 1
flg = False
for a in an:
s = s * a
if s > 10**18 or s< 0:
flg = True
break
if 0 in an:
print(0)
elif flg:
print(-1)
else:
print(s)
| n = int(input())
an = list(map(int, input().split()))
s = 1
flg = False
for a in an:
s = s * a
if s > 10**8 or s< 0:
flg = True
break
if flg:
print(-1)
else:
print(s) | 0.914286 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
98,
84
] | 1 | 0 |
p02658 | u695079172 | u695079172 |
def main():
n = int(input())
a = list(map(int,input().split()))
temp = 1
if 0 in a:
temp = 0
for n in a:
if temp == -1:
break
temp *= n
if temp > 10 ** 18:
temp = -1
break
print(temp)
if __name__ == '__main__':
main()
|
def main():
n = int(input())
a = list(map(int,input().split()))
temp = 1
for n in a:
temp *= n
if temp > 10 ** 18:
temp = -1
break
print(temp)
if __name__ == '__main__':
main()
| 0.967742 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
108,
84
] | 1 | 0 |
p02658 | u975652044 | u975652044 | n = int(input())
v = [int(i) for i in input().split()]
if v.count(0) > 0:
print(0)
exit(0)
res = 1
for i in v:
res *= i
if (res > 10**18):
print(-1)
exit(0)
print(res)
| n = int(input())
v = [int(i) for i in input().split()]
res = 1
for i in v:
res *= i
if (res > 10**18):
print(-1)
exit(0)
print(res)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
88,
65
] | 1 | 0 |
p02658 | u536685012 | u536685012 | n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in range(n):
ans *= a[i]
if ans == 0:
break
if ans > 10**18:
ans = -1
break
print(ans)
| n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
ans *= a[i]
if ans >= 10**18:
for j in range(i, n):
if a[j] == 0:
ans = 0
break
else:
ans = -1
print(ans) | 0.909091 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
87,
97
] | 1 | 0 |
p02658 | u513519822 | u513519822 | N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
exit()
prod = 1
for i in range(len(A)):
prod *= A[i]
if prod > 10 ** 18:
print(-1)
exit()
print(prod) | N = int(input())
A = list(map(int, input().split()))
if A in 0:
print(0)
exit()
prod = 1
for i in range(len(A)):
prod *= A[i]
if prod > 10 ** 18:
print(-1)
exit()
print(prod) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
86,
86
] | 1 | 0 |
p02658 | u613920660 | u613920660 | N=int(input())
A=list(map(int,input().strip().split()))
INF=1000000000000000000
if 0 in A:
print(0)
else:
ans=1
for n in range(N):
ans*=A[n]
if ans>INF:
break
if ans>INF:
print(-1)
else:
print(ans) | N=int(input())
A=list(map(int,input().strip().split()))
INF=1000000000000000000
ans=1
for n in range(N):
ans*=A[n]
if ans>INF:
break
if ans>INF:
print(-1)
else:
print(ans)
| 0.96875 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
102,
84
] | 1 | 0 |
p02658 | u378332068 | u378332068 | import math
n=int(input())
arr=list(map(int,input().split()))
if 0 in arr:
print("0")
exit()
ans=1
for i in range(n):
ans *= arr[i]
if math.log10(ans) >= 18 and ans!=1000000000000000000:
print("-1")
exit()
print(ans) | import math
n=int(input())
arr=list(map(int,input().split()))
if 0 in arr:
print("0")
exit()
ans=1
for i in range(n):
ans *= arr[i]
if math.log10(ans) >= 18:
print("-1")
exit()
print(ans) | 0.916667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
98,
90
] | 1 | 0 |
p02658 | u507456172 | u507456172 | N=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0) >= 1:
print(0)
else:
B=[i for i in A if i != 1]
if len(B) >= 100:
print("-1")
else:
for k in range(len(B)):
ans=ans*B[k]
if ans > 1000000000000000000:
print("-1")
else:
print(ans) | N=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0) >= 1:
print(0)
else:
B=[i for i in A if i != 1]
if len(B) >= 100:
print("-1")
else:
for k in range(len(B)-1):
ans=ans*B[k]
if ans > 1000000000000000000:
print("-1")
else:
print(ans) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
127,
128
] | 1 | 0 |
p02658 | u631579948 | u631579948 | import sys
a=int(input())
b=list(map(int,input().split()))
c=b.count(0)
if c>0:
print('0')
sys.exit()
ans=1
for i in range(a):
ans=ans*b[i-1]
if ans>10**18:
print('-1')
sys.exit()
print(ans)
| import sys
a=int(input())
b=list(map(int,input().split()))
ans=1
for i in range(1,a):
ans=ans*b[i-1]
if ans>10**18:
print('-1')
sys.exit()
if ans==0:
print('0')
sys.exit()
print(ans)
| 0.942857 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
105,
99
] | 1 | 0 |
p02658 | u299599133 | u299599133 | N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)
if 0 in A:
print(0)
else:
val = 1
for a in A:
val *= a
if val > 10**18:
val = -1
break
print(val) | N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)
if 0 in A:
print(0)
else:
val = 1
for a in A:
val *= a
if val >= 10**18:
val = -1
break
print(val) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
82,
82
] | 1 | 0 |
p02658 | u661764795 | u661764795 | N = int(input())
A = list(map(int, input().split(' ')))
if A.count(0):
print(0)
else:
ans = 1
for i in range(N):
ans *= A[i]
if ans > 10 ** 18:
break
if ans > 10 ** 18:
print(-1)
else:
print(ans) | N = int(input())
A = list(map(int, input().split(' ')))
ans = 1
for i in range(N):
ans *= A[i]
if ans > 10 ** 18:
break
if ans > 10 ** 18:
print(-1)
else:
print(ans)
| 0.939394 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
99,
79
] | 1 | 0 |
p02658 | u609814378 | u609814378 | import sys
N = int(input())
A = list(map(int, input().split()))
ans = 1
if A.count(0) != 0:
print(0)
sys.exit()
for i in A:
ans = ans*i
if ans > int(10**18):
print(-1)
sys.exit()
if ans > int(10**18):
print(-1)
else:
print(ans) | import sys
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in A:
ans = ans*i
if ans > int(10**18):
print(-1)
sys.exit()
if ans > int(10**18):
print(-1)
else:
print(ans) | 0.90625 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
118,
91
] | 1 | 0 |
p02658 | u073057072 | u073057072 | n=int(input())
cnt=1
a=sorted(list(map(int,input().split())))
for it in a:
cnt*=it
if cnt>1000000000000000000:
print(-1)
exit()
if cnt>1000000000000000000:
print(-1)
else:
print(cnt)
| n=int(input())
cnt=1
a=list(map(int,input().split()))
for it in a:
cnt*=it
if cnt>1000000000000000000:
print(-1)
exit()
if cnt>1000000000000000000:
print(-1)
else:
print(cnt)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
83,
81
] | 1 | 0 |
p02658 | u023229441 | u023229441 | n=int(input())
A=list(map(int,input().split()))
ans=1
if 0 in A:
print(0);exit()
for i in range(n):
ans*=A[i]
if ans>10**18:
print(-1);exit()
print(ans)
| n=int(input())
A=list(map(int,input().split()))
ans=1
for i in range(n):
ans*=A[i]
if ans>10**18:
print(-1); exit()
print(ans) | 0.967742 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
78,
66
] | 1 | 0 |
p02658 | u623601489 | u623601489 | i=input;i();l=i().split();x=not '0' in l
for j in l:
x*=int(j)
if x>1e18:
print(-1);quit()
print(x)
| i = input
i()
x = 1
l = i().split()
if '0' in l:
print(0)
quit()
for j in l:
x *= int(j)
if x >= 1e18:
print(-1)
quit()
print(x)
| 0.923077 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
58,
74
] | 1 | 0 |
p02658 | u133129810 | u133129810 | N = int(input())
A = list(map(int, input().split()))
for i in range(N):
if A[i] == 0:
print(0)
exit(0)
ans = 1
for i in range(N):
if ans * A[i] > 1000000000000000000:
ans = -1
break
ans *= A[i]
print(ans) | N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
if ans * A[i] > 1000000000000000000:
ans = -1
break
ans *= A[i]
print(ans) | 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
100,
69
] | 1 | 0 |
p02658 | u376754170 | u376754170 | _ = input()
nums = list(map(int, input().split()))
ans = 1
for num in nums:
if num==0 or ans <= 10 ** 18:
ans *= num
else:
pass
print(ans if ans <= 10 ** 18 else -1) | _ = input()
nums = list(map(int, input().split()))
ans = 1
for num in nums:
if num==0 or ans <= 10 ** 18:
ans *= num
else:
break
print(ans if ans <= 10 ** 18 else -1) | 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
71,
69
] | 1 | 0 |
p02658 | u623601489 | u623601489 | i=input;i();l=i().split();x=1-('0'in l)
for j in l:
x*=int(j)
if x>1e18:
x=-1;break
print(x)
| i=input;i();l=i().split();x=1-('0'in l)
for j in l:
x*=int(j);if x>1e18:x=-1;break
print(x)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
59,
55
] | 1 | 0 |
p02658 | u769870836 | u769870836 | n=int(input())
l=list(map(int,input().split()))
ans=1
if min(l)==0:
print(0)
quit()
for x in l:
ans=ans*x
if ans>10**18:
print(-1)
quit()
print(ans) | n=int(input())
l=list(map(int,input().split()))
ans=1
for x in l:
ans=ans*x
if ans>10**18:
print(-1)
quit()
print(ans) | 0.928571 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
80,
62
] | 1 | 0 |
p02658 | u075595666 | u075595666 | n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
for i in a:
ans *= i
if ans > 10**18:
ans = -1
break
print(ans) | n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in a:
ans *= i
if ans > 10**18:
ans = -1
break
print(ans) | 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
63,
58
] | 1 | 0 |
p02658 | u884339744 | u884339744 | n=int(input())
arr=list(map(int,input().split()))
mul=1
mx=10**18
for i in arr:
if(i==0):
print("0")
exit(0)
for i in range(n):
mul=mul*arr[i]
if(mul>mx):
print("-1")
exit(0)
print(mul) | n=int(input())
arr=list(map(int,input().split()))
mul=1
for i in range(n):
mul=mul*arr[i]
if(mul>10**18):
print("-1")
exit(0)
print(mul) | 0.96875 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
104,
72
] | 1 | 0 |
p02658 | u678505520 | u678505520 | n = int(input())
A = list(map(int,input().split()))
total = 1
count = 0
for i in range(n):
total *= A[i]
if total > 10**18:
count += 1
break
if 0 in A:
print('0')
elif count == 1:
print('-1')
else:
print(total) | n = int(input())
A = list(map(int,input().split()))
total = 1
count = 0
for i in range(n):
total *= A[i]
if total > 10**18:
count += 1
break
if count == 1:
print('-1')
else:
print(total) | 0.971429 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
97,
83
] | 1 | 0 |
p02658 | u961288441 | u961288441 | n = int(input())
l = list(map(int, input().split()))
l.sort()
a = 1
for i in l:
a *= i
if a > 10**18:
a = -1
break
print(a) | n = int(input())
l = list(map(int, input().split()))
a = 1
l.sort(reverse=True)
for i in l:
a *= i
if a > 10**18:
a = -1
break
print(a) | 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
65,
70
] | 1 | 0 |
p02658 | u900848560 | u900848560 | a=int(input())
b=input().split(" ")
sum1=1
if "0" in b:
print("0")
else:
for i in range(a):
sum1=sum1*int(b[i])
if sum1>10**18:
sum1=-1
break
print(sum1)
| a=input()
b=input().split(" ")
sum1=1
for i in range(int(a)):
sum1=sum1*int(b[i])
if sum1>=10**18:
print("-1")
else:
print(sum1)
| 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
91,
72
] | 1 | 0 |
p02658 | u676933207 | u676933207 | import sys
MAX = 10**18
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
print("0")
else:
res = 1
for a in reversed(sorted(A)):
if a == 1:
break
res *= a
if res > MAX:
print("-1")
sys.exit()
print(res)
| import sys
MAX = 10**18
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
print("0")
else:
res = 1
for a in reversed(sorted(A)):
if res == 1:
break
res *= a
if res > MAX:
print("-1")
sys.exit()
print(res)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
106,
106
] | 1 | 0 |
p02658 | u541017633 | u541017633 | _ = input()
A = list(map(int, input().split()))
ans = 1
for a in A:
ans *= a
if ans > 10 ** 18:
break
ans = 0 if 0 in A else ans
ans = ans if ans <= 10 ** 18 else -1
print(ans)
| _ = input()
A = list(map(int, input().split()))
ans = 1
for a in A:
ans *= a
if ans <= 10 ** 18:
break
ans = ans if ans <= 10 ** 18 else -1
print(ans)
| 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
76,
66
] | 1 | 0 |
p02658 | u494741995 | u494741995 | n = int(input())
a = list(map(int, input().split()))
x = 1
if 0 in a:
x = 0
else:
for i in range(n):
x = x * a[i]
if x > 10 ** 18:
x = -1
break
print(x) | n = int(input())
a = list(map(int, input().split()))
x = 1
for i in range(n):
x = x * a[i]
if x > 10 ** 18:
print(-1)
break
if x < 10 ** 18:
print(x) | 0.90625 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
80,
74
] | 1 | 0 |
p02658 | u785415976 | u785415976 |
n = input()
a = list(map(int,input().split()))
a.sort()
ans=1
for i in a:
ans *= i
if ans > 10**18:
ans = "-1"
break
print(ans) |
n = input()
a = list(map(int,input().split()))
ans=1
for i in a:
ans *= i
if ans > 10**18:
ans = -1
break
print(ans) | 0.928571 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
65,
60
] | 1 | 0 |
p02658 | u604839890 | u652656291 | n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
print(0)
exit()
for i in range(len(a)):
ans *= a[i]
if ans > 10**18:
print(-1)
exit()
print(ans) | n = int(input())
A = list(map(int,input().split()))
ans = 1
if A[0] == 0:
print(0)
exit()
for i in range(n):
ans *= A[-i]
if ans >= 10**18:
print(-1)
exit()
print(ans)
| 0.90625 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
83,
85
] | 1 | 0 |
p02658 | u104386856 | u104386856 | N = int(input())
A = list(map(int, input().split()))
A.sort()
def nhan(A):
multi = 1
for i in A:
multi *= i
if multi > 10**18: return -1
return multi
print(nhan(A))
| N = int(input())
A = list(map(int, input().split()))
A.sort()
def nhan(A):
multi = 1
for i in A:
if i > 10**18:
return -1
elif i == 0: return 0
else: multi *= i
return multi
print(nhan(A))
| 0.90625 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
75,
88
] | 1 | 0 |
p02658 | u831081653 | u831081653 | n = int(input())
a_list = list(map(int,input().split()))
if 0 in a_list:
print(0)
exit()
ans = 1
for i in a_list:
ans *= i
if ans > 10**18:
print(-1)
exit()
print(ans) | n = int(input())
a_list = list(map(int,input().split()))
ans = 1
for i in a_list:
ans *= i
if ans > 10**18:
print(-1)
exit()
print(ans) | 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
81,
63
] | 1 | 0 |
p02658 | u617225232 | u617225232 | # -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
if 0 in a:
print(0)
quit()
for i in range(n):
out = Decimal(out * a[i])
if out > Decimal(10**18):
print(-1)
quit()
print(out) | # -*- coding: utf-8 -*-
from decimal import *
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
for i in range(n):
out = Decimal(out * a[i])
if out == 0:
print(out)
quit()
elif out >= Decimal(10**18):
print(-1)
quit()
print(out)
| 0.974359 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
107,
109
] | 1 | 0 |
p02658 | u806976856 | u806976856 | import sys
n=int(input())
a=list(map(int,input().split()))
x=1
if 0 in a:
print(0)
sys.exit()
for i in range(len(a)):
x=a[i]*x
if x>10**18:
print(-1)
sys.exit()
print(x if x<=10**18 else -1)
| n=int(input())
a=list(map(int,input().split()))
x=1
if 0 in a:
print(0)
exit()
for i in range(len(a)):
x=a[i]*x
if x>10^18:
print(-1)
exit()
print(x if x<=10**18 else -1)
| 0.916667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
104,
96
] | 1 | 0 |
p02658 | u464823755 | u464823755 | def pyn():
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
print(0)
return
ans=1
for i in a:
ans *= i
if ans>10**18:
print(-1)
return
print(ans)
pyn() | def pyn():
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
print(0)
return
ans=1
for i in a:
ans *= i
if ans>10**18:
print(-1)
return
print(ans)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
91,
91
] | 1 | 0 |
p02658 | u789199177 | u789199177 | n = int(input())
A = list(map(int, input().split()))
if 0 in A:
print('0')
else:
threshold = 10**18
res = 1
for x in A:
res *= x
if res > threshold:
res = -1
break
print(res) | n = int(input())
A = list(map(int, input().split()))
if 0 in A:
print('0')
else:
threshold = 10**18
res = 1
for x in A:
res *= x
if res >= threshold:
res = -1
break
print(res) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
81,
81
] | 1 | 0 |
p02658 | u797798686 | u797798686 | from sys import stdin
data = stdin.readlines()
a = int(data[0])
b = [int(s) for s in data[1].split()]
if 0 in b:
print(0)
else:
ans = 1
for i in range(0,a):
ans = ans * b[i]
if ans > 10**18:
print(-1)
break
else:
continue
else:
print(ans) | from sys import stdin
data = stdin.readlines()
a = int(data[0])
b = [int(s) for s in data[1].split()]
ans = 1
for i in range(0,a):
ans = ans * b[i]
print(i)
if ans > 10 ** 18:
ans = -1
print(ans) | 0.916667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
117,
91
] | 1 | 0 |
p02658 | u685684561 | u685684561 | N=int(input())
a=list(map(int,input().split()))
import sys
for i in range(N):
if a[i]==0:
print (0)
sys.exit()
p=1
for i in range(N):
p=p*a[i]
if p>10**18:
print (-1)
sys.exit()
if p>10**18:
print (-1)
else:
print(p) | N=int(input())
a=list(map(int,input().split()))
import sys
p=1
for i in range(N):
p=p*a[i]
if p>10**18:
print (-1)
sys.exit()
if p>10**18:
print (-1)
else:
print(p) | 0.969697 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
123,
91
] | 1 | 0 |
p02658 | u390727364 | u390727364 | from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 1
for ai in a:
ans *= ai
if ans == 0:
print(0)
exit()
elif ans > 10 ** 18:
print(-1)
exit()
print(ans)
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
ans = 1
for ai in a:
ans *= ai
if ans > 10 ** 18:
print(-1)
exit()
else:
print(ans)
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| 0.906977 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
137,
119
] | 1 | 0 |
p02658 | u504836877 | u504836877 | N = int(input())
A = [int(a) for a in input().split()]
A.sort()
ans = 1
for a in A:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans) | N = int(input())
A = [int(a) for a in input().split()]
ans = 1
for a in A:
ans *= a
if ans > 10**18:
ans = -1
break
print(ans) | 0.961538 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
66,
61
] | 1 | 0 |
p02658 | u538632589 | u538632589 | n = int(input())
a = list(map(int, input().split()))
m = 10**18
if 0 in a:
print(0)
exit()
res = 1
for i in a:
res *= i
if res > m:
print(-1)
exit()
print(res) | n = int(input())
a = list(map(int, input().split()))
m = 10**18
if 0 in a:
print(0)
exit()
res = 1
for i in a:
res *= i
print(res)
if res > m:
print(-1)
exit()
print(res) | 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
80,
86
] | 1 | 0 |
p02658 | u357120030 | u357120030 |
_ = input()
N = sorted([int(v) for v in input().split()])
s = 1
for n in N:
s *= n
if s == 0 or s > 10**18:
break
print(s if s <= 10**18 else -1) |
_ = input()
N = [int(v) for v in input().split()]
s = 1
for n in N:
s *= n
if s > 10**18:
break
print(s if s <= 10**18 else -1) | 0.903226 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
68,
63
] | 1 | 0 |
p02658 | u779386690 | u779386690 | n = input()
a = input()
a = a.split()
x = 0;
mul = 1;
for num in a:
if(int(num) == 0):
mul = 0;
break;
for num in a:
mul *= int(num)
if(mul > 1000000000000000000):
mul = -1;
break;
print(mul);
| n = input()
a = input()
a = a.split()
x = 0;
mul = 1;
for num in a:
if(int(num) == 0):
mul = 0;
break;
else:
mul *= int(num)
if(mul > 1000000000000000000):
mul = -1;
break;
print(mul);
| 0.961538 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
104,
102
] | 1 | 0 |
p02658 | u697386253 | u697386253 | n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
print(0)
quit()
for i in range(n):
ans *= a[i]
if ans > 1e18:
ans = -1
break
print(ans) | n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
print(0)
quit()
for i in range(n):
ans *= a[i]
if ans >= 1e18:
print(-1)
else:
print(ans) | 0.935484 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
83,
84
] | 1 | 0 |
p02658 | u845148770 | u845148770 | N = int(input())
A = list(map(int,input().split()))
sum_A = 1
for i in range(0,len(A)):
if(A[i] == 0):
print(0)
exit()
for i in range(0,len(A)):
if(sum_A > 1000000000000000000):
break
sum_A *= A[i]
if(sum_A > 1000000000000000000):
print("-1")
exit()
print(sum_A)
| N = int(input())
A = list(map(int,input().split()))
sum_A = 1
for i in range(0,len(A)):
if(A[i] == 0):
print(0)
exit()
if(sum_A > 1000000000000000000):
break
sum_A *= A[i]
if(sum_A > 1000000000000000000):
print("-1")
exit()
print(sum_A)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
131,
116
] | 1 | 0 |
p02658 | u901466816 | u901466816 | n = int(input())
MAX_NUM = 10 ** 18
nums = list(map(int, input().split()))
for num in nums:
if num == 0:
print(0)
exit()
ans = 1
for num in nums:
ans *= num
if ans > MAX_NUM:
print(-1)
exit()
print(ans)
| n = int(input())
MAX_NUM = 10 ** 18
nums = map(int, input().split())
for num in nums:
if num == 0:
print(0)
exit()
ans = 1
for num in nums:
ans *= num
if ans > MAX_NUM:
print(-1)
exit()
print(ans)
| 0.964286 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
96,
94
] | 1 | 0 |
p02658 | u285436211 | u285436211 | n=int(input())
A=[int(_) for _ in input().split()]
ans=1
if A.count(0)>0:
print(0)
else:
for i in range(n):
ans=ans*A[i]
if ans>10**18:
print(-1)
exit()
print(ans)
| n=int(input())
A=[int(_) for _ in input().split()]
ans=1
if A.count(0)>0:
print(0)
else:
for i in range(n):
ans=ans*A[i]
if ans>10**18:
print(-1)
else:
print(ans) | 0.966667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
90,
88
] | 1 | 0 |
p02658 | u173072656 | u173072656 | n = int(input())
a = list(map(int, input().split()))
ans = 1
i = 0
while i<=n-1 and ans<= 10**18:
ans *= a[i]
i += 1
if 0 in a:
print('0')
elif ans <= 10**18:
print(ans)
else:
print('-1') | n = int(input())
a = list(map(int, input().split()))
ans = 1
i = 0
while i<=n-1 and ans<= 10**18:
ans *= a[i]
i += 1
if ans <= 10**18:
print(ans)
else:
print('-1') | 0.939394 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
94,
82
] | 1 | 0 |
p02658 | u143223369 | u143223369 | from sys import stdin
MAX = 10**18
def main():
line_count = 0
for line in stdin:
line_count += 1
factors_str = line.split()
if line_count == 2:
break
factors = [int(factor) for factor in factors_str]
if 0 in factors:
print(0)
return
product = 1
for factor in factors:
product *= factor
if product > MAX:
print(-1)
return
print(product)
main() | from sys import stdin
MAX = 10^18
def main():
line_count = 0
for line in stdin:
line_count += 1
factors_str = line.split()
if line_count == 2:
break
factors = [int(factor) for factor in factors_str]
if 0 in factors:
print(0)
return
product = 1
for factor in factors:
product *= factor
if product > MAX:
print(-1)
return
print(product)
main() | 0.973684 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
139,
139
] | 1 | 0 |
p02658 | u126236540 | u126236540 | def main():
n = int(input())
arr = list(map(int, input().split()))
if 0 in arr:
print(0)
return
a = 1
for i in arr:
a*=i
if a>10**18:
print("-1")
return
print(a)
main()
| def main():
n = int(input())
arr = list(map(int, input().split()))
a = 1
for i in arr:
a*=i
if a>10**18:
print("-1")
return
print(a)
| 0.966667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
91,
72
] | 1 | 0 |
p02658 | u479641507 | u479641507 | n = int(input())
mod = 10**18
li = list(map(int, input().split()))
li.sort()
ans = 1
for i in range(n):
ans *= li[i]
if ans > mod:
ans = -1
break
print(ans)
| n = int(input())
mod = 10**18
li = list(map(int, input().split())).sort()
ans = 1
for i in range(n):
ans = ans * li[i]
if ans > mod:
ans = -1
break
print(ans)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
73,
72
] | 1 | 0 |
p02658 | u531456543 | u531456543 | n = int(input())
List = [int(i) for i in input().split()]
lst = sorted(List, reverse=True)
if lst[-1] == 0:
print(0)
exit()
total = 1
for i in lst:
total = total*i
if total > 1000000000000000000:
print(-1)
exit()
print(total)
| n = int(input())
List = [int(i) for i in input().split()]
sorted(List, reverse=True)
if List[-1] == 0:
print(-1)
exit()
total = 1
for i in List:
total = total*i
if total > 1000000000000000000:
print(-1)
exit()
print(total)
| 0.966667 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
96,
94
] | 1 | 0 |
p02658 | u079783022 | u079783022 | n = int(input())
a = list(map(int,input().split()))
ans = 1
mark = False
if 0 in a:
print(0)
mark = True
if mark==False:
for i in range(n):
ans *= a[i]
if ans > 1000000000000000000:
mark = True
print(-1)
break
if not mark: print(ans)
| n = int(input())
a = list(map(int,input().split()))
ans = 1
mark = False
for i in range(n):
if i==0:
ans = 0
mark = True
break
ans *= a[i]
if ans > 1000000000000000000:
print(-1)
mark = True
break
if not mark: print(ans)
| 1 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
101,
97
] | 1 | 0 |
p02658 | u284262180 | u284262180 | n = int(input())
num_list = list(map(int, input().split()))
ans = 1;
for num in num_list:
ans *= num
if ans > 1000000000000000000:
ans = -1
break
if 0 in num_list:
ans = 0
print(ans)
| n = int(input())
num_list = list(map(int, input().split()))
ans = 1;
for num in num_list:
ans *= num
if ans > 1000000000000000000:
ans = -1
break
print(ans)
| 0.962963 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
81,
67
] | 1 | 0 |
p02658 | u329407311 | u329407311 | N = int(input())
List = list(map(int,input().split()))
ans = 1
c=0
for i in range(N):
a = List[i]
ans *= a
if ans > 10**18:
c=1
break
d =0
for i in range(N):
a = List[i]
if a == 0:
d = 1
if d == 1:
print(0)
elif c ==1:
print(-1)
else:
print(int(ans)) | N = int(input())
List = list(map(int,input().split()))
ans = 1
c=0
for i in range(N):
a = List[i]
ans *= a
if ans > 10**18:
c=1
break
if c ==1:
print(-1)
else:
print(int(ans)) | 0.942857 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
137,
93
] | 1 | 0 |
p02658 | u771538568 | u771538568 | n=int(input())
a = list(map(int, input().split()))
k=1
if 0 in a:
print(0)
else:
for i in a:
k*=i
if k>10**18:
break
if k>10**18:
print(-1)
else:
print(k) | n=int(input())
a = list(map(int, input().split()))
k=1
for i in a:
k*=i
if k>10**18:
break
if k>10**18:
print(-1)
else:
print(k) | 0.964286 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
89,
72
] | 1 | 0 |
p02658 | u271469978 | u271469978 | N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
exit()
mul = A.pop()
for a in A:
mul *= a
if mul > 10**18:
print(-1)
exit()
print(mul) | N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
exit()
mul = A.pop()
for a in A:
mul *= a
if mul > 10**8:
print(-1)
exit()
print(mul) | 0.931034 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
78,
78
] | 1 | 0 |
p02658 | u176582473 | u176582473 | def main():
n = int(input())
ps = [int(x) for x in input().split()]
ps.sort()
a = 1
for p in ps:
a *= p
if a == 0:
print(0)
return
if a > 10 ** 18:
print(-1)
return
print(a)
main()
| def main():
n = int(input())
ps = [int(x) for x in input().split()]
a = 1
for p in ps:
a *= p
if a > 10 ** 18:
print(-1)
return
print(a)
main()
| 0.933333 | You are given N integers A_1 through A_N. Compute the product of these integers. If the result exceeds 10^18, print -1. Constraints: 2 ≤ N ≤ 10^5, 0 ≤ A_i ≤ 10^18. Input is given as N followed by A_1 through A_N. Output the product as an integer or -1 if it exceeds 10^18. | [
100,
78
] | 1 | 0 |
End of preview.
CodeNanoFix consists of tuples of problem description, buggy code, and correct code, designed to evaluate human-written code with subtle differences.
Paper: https://arxiv.org/abs/2412.17429
problem_id: problme index;
pos: correct code;
neg: buggy code;
nl: natural language description;
Citation:
@article{liang2024condor,
title={Condor: A Code Discriminator Integrating General Semantics with Code Details},
author={Liang, Qingyuan and Zhang, Zhao and Liu, Chen and Sun, Zeyu and Zhang, Wenjie and Chen, Yizhou and Zhao, Zixiao and Luo, Qi and Wang, Wentao and Jiang, Yanjie and others},
journal={arXiv preprint arXiv:2412.17429},
year={2024}
}
- Downloads last month
- 31