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 | u440161695 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['mod=10**18\nN=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\n exit()\nans=1\nfor i in A:\n ans*=i\n print(ans)\n if ans>mod:\n print(-1)\n exit()\nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nans=1\nfor i in A:\n ans*=i\n if ans>=10**18:\n print(-1)\n exit()\nprint(ans)', 'mod=10**18\nN=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\n exit()\nans=1\nfor i in A:\n ans*=i\n if ans>mod:\n print(-1)\n exit()\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s269391954', 's597001884', 's757200809'] | [21772.0, 21648.0, 21788.0] | [75.0, 51.0, 50.0] | [179, 128, 167] |
p02658 | u440478998 | 2,000 | 1,048,576 | 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\ntemp = 1\n\nfor i in a:\n temp *= i\n \nif temp >= 10**18:\n print(-1)\nelse:\n print(temp)', 'import sys\nn = int(input())\na = list(map(int, input().split()))\n\ntemp = 1\n\nif 0 in a:\n print(0)\n\nelse:\n for i in a:\n temp *= i\n if temp >= 10**18:\n print(-1)\n sys.exit()\n print(temp)', 'import sys\nn = int(input())\na = list(map(int, input().split()))\n\ntemp = 1\n\nif 0 in a:\n print(0)\n\nelse:\n for i in a:\n temp *= i\n if temp > 10**18:\n print(-1)\n sys.exit()\n print(temp)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s688385615', 's929357391', 's879934812'] | [21544.0, 21776.0, 21572.0] | [2206.0, 56.0, 58.0] | [149, 227, 226] |
p02658 | u441254033 | 2,000 | 1,048,576 | 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())\n\na = map(int,input().split())\n\n \n\n \n\nmaxa = 10 **18\n\nans = 1\nif min(a) == 0:\n ans = 0\n\nfor i in a:\n ans = ans * i\n if ans > maxa:\n print(-1)\n break\nelse:\n print(ans)\n', '# B\nn = int(input())\n\na = list(map(int,input().split()))\n\n \n\n \n\nmaxa = 10 **18\n\nans = 1\nif min(a) == 0:\n ans = 0\n\nfor i in a:\n ans = ans * i\n if ans > maxa:\n print(-1)\n break\nelse:\n print(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s628708121', 's659807936'] | [19496.0, 21780.0] | [49.0, 56.0] | [199, 205] |
p02658 | u441320782 | 2,000 | 1,048,576 | 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())\ntotal=1\nA=list(map(int,input().split()))\nif A.count(0)>=1:\n total=0\nelse:\n for i in range(x):\n total*=A[i]\n\nif 1*(10**18)+1<=total:\n print("-1")\nelse:\n print(total)', 'N=int(input())\ntotal=1\nA=list(map(int,input().split()))\nflag=True\nhigh=1*(10**18)+1\nif A.count(0)>=1:\n total=0\nelse:\n for i in range(N):\n total*=A[i]\n if high<=total:\n flag=False\n break\n\nif not flag:\n print("-1")\nelse:\n print(total)'] | ['Runtime Error', 'Accepted'] | ['s506922537', 's484027413'] | [21572.0, 21660.0] | [47.0, 49.0] | [186, 252] |
p02658 | u442030035 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['// #include <bits/stdc++.h>\n\n#include <map>\n#include <cmath>\n\n#include <iomanip>\n#include <algorithm>\n\n#include <stack>\n#include <numeric>\n// #include <windows.h>\nusing namespace std;\ntemplate<class T> using V = vector<T>;\ntemplate<class T> using VV = V<V<T>>;\ntemplate<class T> using VVV = V<VV<T>>;\ntemplate<class T1, class T2> using P = pair<T1, T2>;\nusing I = int;\nusing D = double;\nusing B = bool;\nusing C = char;\nusing S = string;\nusing LL = long long;\nusing LD = long double;\nusing ULL = unsigned long long;\nusing PII = P<I, I>;\nusing VPII = V<PII>;\nusing PLL = P<LL, LL>;\nusing VPLL = V<PLL>;\nusing VI = V<I>;\nusing VVI = VV<I>;\nusing VLL = V<LL>;\nusing VVLL = VV<LL>;\nusing VC = V<C>;\nusing VVC = VV<C>;\nusing VS = V<S>;\nusing VVS = VV<S>;\nusing VB = V<B>;\nusing VVB = VV<B>;\n\n\n\n\n#define REPx(x, a) for(auto x : a)\n#define ALL(a) a.begin(), a.end()\n#define SORT(a) sort(ALL(a))\n#define SORTR(a, type) sort(ALL(a), G<type>())\n#define REVERSE(a) reverse(ALL(a))\n#define SIZE(a, type) ((type)(a).size())\n#define bit_search(bit, n) REP(LL, bit, 1LL<<(n))\n#define bit_check(bit, i) ((bit>>(i)) & 1)\n\n#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)\n#define MAX(a) *max_element(ALL(a))\n#define MIN(a) *min_element(ALL(a))\n\n\n#define INPUT(a) REPx(&x, a) cin >> x;\n#define INPUTP(a) REPx(&x, a) cin >> x.first >> x.second;\n#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);\n\n#define ENDL cout << endl;\n\nconst int INF = 2e9;\nconst LL MOD = 1e9 + 7;\n\ntemplate<class T> using PRIORITY_QUEUE = priority_queue< T, V<T>, greater<T> >;\ntemplate<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true;} return false;}\ntemplate<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true;} return false;}\ntemplate<class T> inline void debug1(V<T> A){REP(int, i, SIZE(A, int)){if (A[i] == INF) cout << "I ";else cout << A[i] << " ";}ENDL}\ntemplate<class T> inline void debug2(VV<T> A){REP(int, i, SIZE(A, int)){REP(int, j, SIZE(A[i], int)){if (A[i][j] == INF) cout << "I "; else cout << A[i][j] << " ";}ENDL}}\n\nint main()\n{\n cin.tie(0);\n ios::sync_with_stdio(false);\n int n;\n cin >> n;\n VLL A(n);\n INPUT(A);\n if (MIN(A) == 0)\n {\n cout << 0 << endl;\n return 0;\n }\n LL s = 1;\n REP(int, i, n)\n {\n s *= A[i];\n if (s > 1000000000000000000)\n {\n cout << -1 << endl;\n return 0;\n }\n }\n cout << s << endl;\n\n return 0;\n}\n', 'n = int(input())\nA = list(map(int, input().split()))\ns = 1\nif min(A) == 0:\n print(0)\n exit(0)\nfor i in range(n):\n s *= A[i]\n if s > 1e18:\n print(-1)\n exit(0)\nprint(s)\n'] | ['Runtime Error', 'Accepted'] | ['s876162961', 's818493824'] | [8896.0, 21428.0] | [29.0, 60.0] | [3219, 177] |
p02658 | u442855260 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nAlist=list(map(int,input().split()))\nmulti=Alist[0]\nibreak=0\nif(Alist.count(0)>=0):\n print(0)\nelse:\n for i in range (N-1):\n multi*=Alist[i+1]\n if(multi>1e18):\n print(-1)\n ibreak=1\n break;\n if(ibreak==0):\n print(multi)', 'N=int(input())\nAlist=list(map(int,input().split()))\nmulti=Alist[0]\nibreak=0\nif(Alist.count(0)>0):\n print(0)\nelse:\n for i in range (N-1):\n multi*=Alist[i+1]\n if(multi>1e18):\n print(-1)\n ibreak=1\n break;\n if(ibreak==0):\n print(multi)'] | ['Wrong Answer', 'Accepted'] | ['s388197567', 's193531480'] | [21572.0, 21476.0] | [47.0, 53.0] | [295, 294] |
p02658 | u444739070 | 2,000 | 1,048,576 | 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 = []\nproduct = 1\n# while i < N:\narr = ((input().split(' ')))\n\nfor i in arr:\n if( i == 0):\n print(0)\n return\n product = product * int(i)\n\nif product <= (10**18):\n print(product)\nelse:\n print(-1)", 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A: \n print (0)\n \treturn\n prod = 1 \n for a in A:\n prod *= a\n \tif prod > 1000000000000000000:\n \t\tprint(-1) \n return\n\tprint(prod)\n \nmain()', "N = int(input())\narr = []\nproduct = 1\n# while i < N:\narr = ((input().split(' ')))\n\nfor i in arr:\n if( int(i) == 0):\n print(0)\n return\n product = product * int(i)\n\nif product <= (10**18):\n print(product)\nelse:\n print(-1)", 'def main ():\n N = int(input())\n A = list(map(int,input().split()))\n if 0 in A: \n print (0)\n return\n prod = 1 \n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod) \n\nmain ()\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s115957093', 's119522439', 's634120994', 's610536951'] | [8988.0, 8892.0, 9028.0, 21712.0] | [22.0, 23.0, 23.0, 46.0] | [240, 234, 245, 276] |
p02658 | u446711904 | 2,000 | 1,048,576 | 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())\nif min(a)==0:\n print(0)\nelse:\n s=1\n for i in range(len(a)):\n s=s*a[i]\n if s>10*18:\n print(-1)\n break\n else:\n print(s)', 'n,*a=map(int,open(0).read().split())\nif min(a)==0:\n print(0)\nelse:\n s=1\n for i in range(len(a)):\n s=s*a[i]\n if s>10**18:\n print(-1)\n break\n else:\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s273725442', 's835004003'] | [21644.0, 21612.0] | [47.0, 50.0] | [205, 206] |
p02658 | u447352341 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nsum = 1\nfor num in input().split():\n sum *= int(num)\n if sum == 0:\n print(0)\n exit()\nif len(str(sum)) > 19:\n print(-1)\n exit()\nelif len(str(sum)) == 19 and str(sum).count("1") == 1 and str(sum).count("0") == 18:\n print(-1)\n exit()\nprint(sum)', 'N = int(input())\nsum = 1\nfor num in input().split():\n sum *= int(num)\n if sum == 0:\n print(0)\n exit()\nif len(str(sum)) > 19:\n print(-1)\n exit()\nelif len(str(sum)) == 19 and sum == 10**18:\n print(-1)\n exit()\nprint(sum)', 'N = int(input())\nsum = 1\nketa = 0\n\nnumbers = input().split()\nif not ("0" in numbers):\n for num in numbers:\n keta += len(num) - 1\n if keta > 19:\n print(-1)\n exit()\n sum *= int(num)\n if len(str(sum)) > 19:\n print(-1)\n exit()\n \n if len(str(sum)) == 19:\n if str(sum).count("1") == 1 and str(sum).count("0") == 18:\n pass\n else:\n print(-1)\n exit()\nelse:\n print(0)\n exit()\nprint(sum)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s261333013', 's929926613', 's737372391'] | [19388.0, 19452.0, 20008.0] | [2206.0, 2206.0, 81.0] | [290, 249, 514] |
p02658 | u448203679 | 2,000 | 1,048,576 | 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())\narr = list(map(int, input().split()))\nif 0 in arr:\n\tprint(0)\n\tsys.exit(0)\nans = 1\nfor i in arr:\n\tans *= i\n\tprint(ans)\n\tif ans > 10**18:\n\t\tans = -1\n\t\tbreak\nprint(ans)', 'import sys\nn = int(input())\narr = list(map(int, input().split()))\nif 0 in arr:\n\tprint(0)\n\tsys.exit(0)\nans = 1\nfor i in arr:\n\tans *= i\n\tif ans > 10**18:\n\t\tans = -1\n\t\tbreak\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s898053716', 's085124035'] | [21636.0, 21596.0] | [73.0, 50.0] | [193, 181] |
p02658 | u449237691 | 2,000 | 1,048,576 | 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()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\nprint(-1)\n exit()\nelse:\n print(A)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\n print(-1)\n exit()\nprint(A)', 'N=int(input())\nL=list(map(int,input().split()))\nB=-1\nA=0\nfor i in range(N):\n A=A*L[i]\nif 10^18>=A:\n print(A)\nelse:\n print(B)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\nprint(-1)\n exit()\nprint(A)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\n print(-1)\n exit()\nprint(A)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\nprint(-1)\n else:\nprint(A)\n exit()', 'N=int(input())\nL=list(map(int,input().split()))\nB=-1\nA=1\nfor i in range(N):\n A=A*L[i]\nif 10^18>=A:\n print(A)\nelse:\n print(B)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\nprint(-1)\n exit()\n print(A)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\n print(-1)\n exit()\n else:\n print(A)', 'N=int(input())\nL=list(map(int,input().split()))\nA=1\nif 0 in L:\n print(0)\n exit()\nfor i in range(N):\n A=A*L[i]\n if 10**18<A:\n print(-1)\n exit()\nprint(A)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s012388001', 's018536651', 's056365868', 's153348372', 's345924399', 's510619481', 's523692881', 's534049019', 's857352230', 's024078433'] | [8956.0, 8960.0, 21776.0, 8904.0, 8952.0, 8920.0, 21584.0, 8940.0, 8912.0, 21424.0] | [27.0, 25.0, 64.0, 24.0, 24.0, 28.0, 2206.0, 29.0, 25.0, 59.0] | [132, 126, 127, 124, 133, 132, 127, 126, 136, 161] |
p02658 | u449863068 | 2,000 | 1,048,576 | 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\nans = 1\nketa = 0\nfor x in A:\n ans *= x\n keta += len(str(x))\n if keta > 18:\n print(-1)\n exit()\n\nprint(ans)\n', 'N = int(input())\n\nA = list(map(int, input().split()))\n\nans = 1\nketa = 0\nif 0 in A:\n print(0)\n exit()\n\nfor x in A:\n ans *= x\n keta += len(str(x))\n if keta > 18:\n print(-1)\n exit()\n\nprint(ans)\n', 'N = int(input())\n\nA = list(map(int, input().split()))\n\nans = 1\nketa = 0\nif 0 in A:\n print(0)\n exit()\n\nfor x in A:\n ans *= x\n keta += len(str(x))\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s152589229', 's965463309', 's502443452'] | [21644.0, 21624.0, 21524.0] | [49.0, 54.0, 72.0] | [170, 202, 218] |
p02658 | u450147945 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\nif np.prod(A)>=10**18:\n print(-1)\nelse:\n print(np.prod(A))', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\na = 1\nfor i in A:\n a *= i\n if a > 10**18:\n a = -1\n break\nprint(a)'] | ['Wrong Answer', 'Accepted'] | ['s980636416', 's054424206'] | [39912.0, 21528.0] | [157.0, 98.0] | [136, 147] |
p02658 | u450199470 | 2,000 | 1,048,576 | 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 * code generated by JHelper\n * More info: https://github.com/AlexeyDmitriev/JHelper\n * @author apurba_debnath\n */\n\n#include <bits/stdc++.h>\n\n\n#define DEBUG(x) cout << \'>\' << #x << \':\' << x << endl\n\nusing namespace std;\n\nclass BMultiplication2 {\npublic:\n void solve(std::istream &in, std::ostream &out) {\n int n;\n in >> n;\n ll a[101010];\n ll zero = 0;\n for (int i = 0; i < n; ++i) {\n in >> a[i];\n if (a[i] == 0)\n zero++;\n }\n if (zero)\n out << 0;\n else {\n ll p = 1;\n for (int i = 0; i < n; ++i) {\n if (a[i] <= 1e18 / p)\n p *= a[i];\n else {\n out << "-1";\n return;\n }\n }\n out << p;\n }\n }\n};\n\n\nint main() {\n ios_base::sync_with_stdio(false);\n cin.tie(nullptr);\n\n BMultiplication2 solver;\n std::istream &in(std::cin);\n std::ostream &out(std::cout);\n solver.solve(in, out);\n\n return 0;\n}\n', 'def func():\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 item in A:\n prod *= item\n if prod > 1e18:\n print(-1)\n return\n print(prod)\n\nfunc()'] | ['Runtime Error', 'Accepted'] | ['s560220058', 's204732602'] | [8940.0, 21492.0] | [24.0, 56.0] | [1090, 261] |
p02658 | u450288159 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["import numpy as np\nn = int(input())\nnums = list(map(int, input().split(' ')))\nans = np.prod(nums)\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)", "n = int(input())\nans = 1\nnums = map(int, input().split(' '))\nif 0 in nums:\n print(0)\n exit()\nelse:\n for i in nums:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)", "n = int(input())\nans = 1\nnums = map(int, input().split(' '))\nif 0 in nums:\n print(0)\n exit()\nelse:\n for i in nums:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n exit()\nprint(ans)", 'def main ():\nN = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\n print(0)\n return\nprod = 1\nfor a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n åçreturn\nprint(prod)\nmain ()', 'def main():\n n = int(input())\n a = list(map(int, input().split()))\n if 0 in a:\n print(0)\n return\n prod = 1\n for i in a:\n prod *= i\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s613027709', 's707217962', 's876186989', 's880511137', 's747841536'] | [40004.0, 19468.0, 19160.0, 9000.0, 21608.0] | [134.0, 45.0, 42.0, 22.0, 48.0] | [150, 217, 230, 228, 269] |
p02658 | u450956662 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = map(int, input().split())\nif 0 in A:\n print(0)\n exit()\nres = 1\nfor a in A:\n res *= a\n if res > 10 ** 18:\n res = -1\n break\nprint(res)', 'N = int(input())\nA = list(map(int, input().split()))\nres = 1\nif 0 in A:\n res = 0\nfor a in A:\n if res > 10 ** 18 // max(1, a):\n res = -1\n break\n res *= a\nprint(res)\n'] | ['Wrong Answer', 'Accepted'] | ['s274147837', 's181342593'] | [19352.0, 21704.0] | [46.0, 81.0] | [179, 187] |
p02658 | u450983668 | 2,000 | 1,048,576 | 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())\nres = 1\nif 0 in a:\n print(0)\n exit()\nfor a in a:\n res *= a\n if res >= 1e18:\n res = -1\n break\nprint(res)', 'n, *a = map(int, open(0).read().split())\nres = 1\nfor a in a:\n res *= a\n if res >= 1e18:\n res = -1\n break\nprint(res)', 'n, *a = map(int, open(0).read().split())\nres = 1\nif 0 in a:\n print(0)\n exit()\nfor a in a:\n res *= a\n if res > 1e18:\n res = -1\n break\nprint(res)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s544362570', 's631637526', 's852117596'] | [21400.0, 21576.0, 21532.0] | [57.0, 56.0, 59.0] | [154, 123, 154] |
p02658 | u451507303 | 2,000 | 1,048,576 | 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 a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n', 'N = int(input())\na = list(map(int, input().split()))\nans = 1\n\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nif a.count(0) > 0:\n ans = 0\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s358409559', 's542482018'] | [8964.0, 21780.0] | [23.0, 49.0] | [143, 183] |
p02658 | u451618391 | 2,000 | 1,048,576 | 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 = map(int,input().split())\ntotal = 1\nfor i in l:\n total *= i\n\nif total >= 1000000000000000000 :\n total = -1\n\nprint(total)', 'n = int(input())\nl = map(int,input().split())\ntotal = 1\nif 0 in l:\n total = 0\nelse:\n for i in l:\n total *= i\n if total >= 1000000000000000000:\n total = -1\n \n \nprint(total)', "n = int(input())\nl = map(int, input().split())\ntotal = 1\n\nif __name__ == '__main__':\n for i in l:\n total *= i\n if total > 1000000000000000000:\n total = -1\n break\n\n if 0 in l :\n total = 0\n print(total)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s299337062', 's600971758', 's517519138'] | [19364.0, 19508.0, 19512.0] | [2206.0, 49.0, 47.0] | [146, 212, 252] |
p02658 | u452885705 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = input()\nlist = [int(x) for x in input().split(" ")]\nresult = 1\nfor i in range(len(list)):\n result = result*list[i]\n if result > 10**8:\n result = -1\n break\nprint(result)', 'n = input()\nlist = [int(x) for x in input().split(" ")]\nresult = 1\nfor i in range(len(list)):\n result = result*list[i]\n\nif result > 10**8:\n print(-1)\nelse:\n print(result)', 'n = input()\nlist = [int(x) for x in input().split(" ")]\nresult = 1\nif 0 in list:\n print(0)\nelse:\n for i in range(len(list)):\n result = result*list[i]\n if result > 10**18:\n result = -1\n break\n print(result)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s398162388', 's619944561', 's346264710'] | [21628.0, 21636.0, 21768.0] | [51.0, 2206.0, 52.0] | [192, 179, 250] |
p02658 | u454329159 | 2,000 | 1,048,576 | 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()\na=list(map(int,a))\ni=0\nans=1\nfor calc in a:\n if(0 in a==True):\n print(0)\n exit()\n ans=ans*calc[i]\n i+=1\n if(i==n):\n break\nif(ans>1000000000000000000):\n print(-1)\nelse:\n print(ans)\n', 'n=int(input())\na=input().split()\na=list(map(int,a))\ni=0\nans=1\nfor calc in a:\n if(0 in a==True):\n print(0)\n exit()\n ans=ans*ch\n i+=1\n if(i==n):\n break\nif(ans>1000000000000000000):\n print(-1)\nelse:\n print(ans)\n', 'n=int(input())\na=input().split()\na=list(map(int,a))\nans=1\nif(0 in a):\n print(0)\n exit()\n\nfor calc in a:\n ans*=calc\n if(ans>10**18):\n print(-1)\n exit()\nif(ans>10**18):\n print(-1)\nelse:\n print(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s173598053', 's365049702', 's909930854'] | [21640.0, 21644.0, 21668.0] | [48.0, 53.0, 47.0] | [252, 247, 228] |
p02658 | u454524105 | 2,000 | 1,048,576 | 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 exit()\na = sorted(a, reverse=True)\nres = a[0]\nfor ai in a[1:]:\n res *= ai\n if res > 10**18:\n print(-1)\n exit()', 'n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\n exit()\na = sorted(a, reverse=True)\nres = a[0]\nfor ai in a[1:]:\n res *= ai\n if res > 10**18:\n print(-1)\n exit()\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s413142943', 's331406557'] | [21676.0, 21760.0] | [61.0, 62.0] | [211, 222] |
p02658 | u454557108 | 2,000 | 1,048,576 | 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 n in range(n) :\n ans *= a[i]\n if ans > 10**18 :\n ans = -1\n break\n \nprint(ans)', 'import sys\n\nn = int(input())\na = list(map(int,input().split()))\n\nif 0 in a :\n print(0)\n sys.exit()\n\nans = 1\nfor i in range(n) :\n ans *= a[i]\n if ans > 10**18 :\n ans = -1\n break\n \nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s777142136', 's716970764'] | [21404.0, 21644.0] | [52.0, 59.0] | [153, 203] |
p02658 | u455354923 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0', 'N=int(input())\nA=list(map(int,input().split()))\nA.sort(reverse=True)\nans = 1\nfor i in range(N):\n ans *= A[i]\n if ans >> 10**18:\n flg = False\n break\nif flg == False:\n print(-1)\nelse:\n print(ans)\n', 'N=int(input())\nA=list(map(int,input().split()))\nA.sort(reverse=True)\nans = 1\nflg = True\nfor i in range(N):\n ans *= A[i]\n if A[-1] != 0:\n if ans > 10**18:\n flg = False\n break\n if A[-1] == 0:\n ans = 0\n break\nif flg == False:\n print(-1)\nelse:\n print(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s180452558', 's758341360', 's043304662'] | [9008.0, 21492.0, 21620.0] | [24.0, 2206.0, 82.0] | [64, 220, 310] |
p02658 | u455957070 | 2,000 | 1,048,576 | 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 = 0\nfor i in a:\n if(a[i] == 0):\n print(0)\n exit\n else:\n ans += a[0]\n for i in range(1,n):\n ans *= a[i]\n if(ans > 10**18):\n ans *= a[i]\n print(-1)\n exit\n else:\n print(sum(a))', 'N = int(input())\nA = sorted(list(map(int, input().split())))\nans = 1\n\nfor i in A:\n ans *= i\n if ans > 10 ** 18:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s904129138', 's166185306'] | [8868.0, 21592.0] | [26.0, 91.0] | [288, 163] |
p02658 | u456342056 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import operator\nnum = int(input())\na = list(map(int, input().split()))\nresult = reduce(operator.mul,a)\nif result > 1000000000000000000:\n print(-1)\nelse:\n print(result)', 'ans = 1\nflag = 0\n\nn = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n flag = 1\n print(-1)\n break\n \n if flag == 0:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s402847489', 's811497457'] | [22200.0, 21784.0] | [49.0, 49.0] | [173, 285] |
p02658 | u457437854 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\nnums = list(map(int, input().split()))\nans = 1\n\nif nums.count(0) > 0:\n ans = 0\nelse:\n for i in range(n):\n ans *= nums[i]\n if ans >= 10**18:\n ans = -1\n break\n \nprint(ans)', 'n = int(input())\nnums = list(map(int, input().split()))\nans = 1\n\nfor i in range(n):\n ans *= nums[i]\n \nif ans >= 10**18:\n ans = -1\n\nprint(ans)\n', 'n = int(input())\nnums = list(map(int, input().split()))\nans = 1\n\nif nums.count(0) > 0:\n ans = 0\nelse:\n for i in range(n):\n ans *= nums[i]\n if ans >= 10**18:\n ans = -1\n break\n else:\n break\n \nprint(ans)', 'n = int(input())\nnums = list(map(int, input().split()))\nans = 1\n\nif nums.count(0) > 0:\n ans = 0\nelse:\n for i in range(n):\n ans *= nums[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s198871599', 's847381632', 's986519486', 's349404162'] | [21652.0, 21648.0, 9116.0, 21788.0] | [49.0, 2206.0, 24.0, 54.0] | [204, 145, 222, 203] |
p02658 | u457802431 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["import numpy as np\n\nn = int(input())\na = [list(map(int,input().split())) for i in range(1)]\narr = np.array(a[0])\nsum = arr.cumprod()\nans = sum[-1]\nif ans >= 10**18:\n ans = str('-1')\nprint(ans)", 'import numpy as np\n\nn = int(input())\na = [list(map(int,input().split())) for i in range(1)]\narr = np.array(a[0])\nsum = arr.cumprod()\nans = sum[-1]\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', "import numpy as np\n\nn = int(input())\na = [list(map(int,input().split())) for i in range(1)]\narr = np.array(a[0])\nlog_arr = np.log10(arr)\nsum = log_arr.cumsum()\nans = 10**(sum[-1])\nif ans >= 10**18:\n ans = str('-1')\nprint(ans)", 'import numpy as np\nimport sys\n\nn = int(input())\na = [list(map(int,input().split())) for i in range(1)]\narr = a[0]\nlist.sort(arr, reverse=True)\n\nif arr[-1] == 0:\n print(arr[-1])\n sys.exit()\n\nans = 1\nfor i in range(n):\n ans = ans * arr[i]\n if ans > 10**18:\n print(-1)\n sys.exit()\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062950899', 's134908283', 's472399957', 's696547897'] | [40032.0, 40060.0, 40176.0, 40124.0] | [142.0, 140.0, 150.0, 165.0] | [195, 199, 228, 314] |
p02658 | u458725980 | 2,000 | 1,048,576 | 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()))\nprint(A)\n\njudge=10**18\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor i in A:\n ans *= i\n if ans > judge:\n print('-1')\n exit()\nprint(ans)\n \n", "N = int(input())\nA = list(map(int, input().split()))\n\njudge=10**18\nans = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in A:\n ans *= i\n if ans > judge:\n print('-1')\n exit()\n\nprint(ans)\n\n"] | ['Wrong Answer', 'Accepted'] | ['s216433953', 's114307283'] | [21648.0, 21636.0] | [65.0, 53.0] | [197, 189] |
p02658 | u459215900 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["import numpy as np\nN = int(input())\nnum_list = np.array(list(map(int, input().split())))\n\nans = np.prod(num_list)\n\nif ans >= 10**18:\n print('-1')\nelse:\n print(ans)", 'import numpy as np\nN = int(input())\nnum_list = np.array(list(map(int, input().split())))\n\nans = np.prod(num_list)\n\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'import numpy as np\nN = int(input())\nnum_list = list(map(int, input().split()))\n\n# ans = np.prod(num_list)\nans = num_list[0]\nfor i in range(1, N):\n if ans > 10**18:\n break\n ans *= num_list[i]\n\n\nif 0 in num_list:\n print(0)\nelif ans > 10**18:\n print("-1")\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s101886367', 's706137690', 's814550902'] | [39884.0, 40080.0, 39876.0] | [139.0, 139.0, 141.0] | [169, 167, 293] |
p02658 | u460542889 | 2,000 | 1,048,576 | 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=1000000000000000000\nres=1\nfor i in range(n):\n res=res*int(input())\nif(res>x):\n print("-1")\nelse:\n print(res)', 'n=int(input())\nx=1000000000000000000\nres=1\nfor i in range(n):\n x=int(input())\n res=res*x\nif(res>x):\n print("-1")\nelse:\n print(res)\n', 'n=int(input())\nx=1000000000000000000\nres=1\nfor i in range(n):\n\tres=res*int(input())\nif(res>x):\n\tprint("-1")\nelse:\n\tprint(res)\n', 'n=int(input())\na=list(map(int,input().split()))\nres=1\nif 0 in a:\n print("0")\nelse:\n for x in a:\n res=res*x\n if(res>1000000000000000000):\n res=-1\n break\n print(res)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s186278186', 's369903166', 's517443364', 's939978723'] | [12752.0, 12792.0, 12716.0, 21576.0] | [33.0, 33.0, 35.0, 50.0] | [128, 135, 126, 183] |
p02658 | u460745860 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**9 + 7:\n ans %= 10 ** 9 + 7\n\nif ans > 10**18:\n print('-1')\n exit()\n\nprint(ans)\n", "N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor a in A:\n ans *= a\n print(ans)\n if ans > 10**18:\n print('-1')\n exit()\n\nprint(ans)\n", "# ABC169\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n print(0)\n exit()\nfor a in A:\n ans *= a\n if ans > 10**18:\n print('-1')\n exit()\n\nprint(ans)\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s598580760', 's745142146', 's611407584'] | [21540.0, 21544.0, 21428.0] | [71.0, 79.0, 59.0] | [195, 205, 199] |
p02658 | u462192060 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from sys import stdin\n\ndef main():\n read = stdin.readline\n N = int(read())\n data = list(map(int,read().split(" ")))\n ans = 1\n flg = False\n for i in data:\n if ans >= (10**18)/i:\n print("-1")\n flg = True\n break\n else:\n ans *= i\n \n if not flg: \n print(ans)\n \n \nif __name__ == "__main__":\n main()', 'from sys import stdin\n\ndef main():\n read = stdin.readline\n N = int(read())\n data = list(map(int,read().split(" ")))\n ans = 1\n flg = False\n for i in data:\n if ans*i >= 10**18:\n print("-1")\n flg = True\n break\n else:\n ans *= i\n \n if not flg: \n print(ans)\n \n \nif __name__ == "__main__":\n main()', 'from sys import stdin\n\ndef main():\n read = stdin.readline\n N = int(read())\n data = list(map(int,read().split(" ")))\n ans = 1\n flg = False\n if 0 in data:\n print("0")\n flg = True\n exit()\n for i in data:\n \n if ans*i > 10**18:\n print("-1")\n flg = True\n break\n else:\n ans *= i\n \n if not flg: \n print(ans)\n \n \nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s598607057', 's900677018', 's254890207'] | [21912.0, 21600.0, 21720.0] | [46.0, 46.0, 46.0] | [337, 335, 396] |
p02658 | u462577180 | 2,000 | 1,048,576 | 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 mult(m):\n s = 1\n for x in m:\n s = s*x\n if s == 0:\n return 0\n if s > 10**18:\n return -1\n return s\nn = int(input())\na = list(map(int,input().split()))\na.sort()\nz = mult(a)\nprint(z)\n', 'def mult(m):\n s = 1\n for x in m:\n s = s*x\n if s == 0:\n return 0\n if s > 10**18:\n return -1\n return s\nn = int(input())\na = list(map(int,input.split()))\na.sort()\nz = mult(m)\nprint(z)\n', 'def mult(m):\n s = 1\n for x in m:\n s = s*x\n if s == 0:\n return 0\n if s > 10**18:\n return -1\n return s\nn = int(input())\na = list(map(int,input().split()))\na.sort()\nz = mult(a)\nprint(z)\n', 'def mult(m):\n s = 1\n for x in m:\n s = s*x\n if s == 0:\n return 0\n if s > 10**18:\n return -1\n return s\nn = int(input())\na = list(map(int,input.split()))\na.sort()\nz = mult(a)\nprint(z)\n', 'def mult(m):\n s = 1\n for x in m:\n s = s * x\n if s == 0:\n return 0\n if s > 10**18:\n return -1\n return s\nn = int(input())\na = list(map(int,input().split()))\na.sort()\nz = mult(m)\nprint(z)', 'def mul(m) : \n \n # Multiply elements one by one \n res = 1\n for x in m: \n res = res * x\n if res == 0:\n return 0 \n if res > 10**18:\n return -1\n return res\n \nn = int(input())\na = list(map(int, input().split()))\na.sort()\nz = mul(a)\nprint(z)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s078133815', 's089999103', 's811220475', 's896326941', 's998696581', 's386658313'] | [8960.0, 9028.0, 9020.0, 8964.0, 9028.0, 21664.0] | [24.0, 22.0, 23.0, 24.0, 25.0, 74.0] | [206, 204, 206, 204, 207, 298] |
p02658 | u463068683 | 2,000 | 1,048,576 | 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())\nla = list(map(int, input().split()))\nimport sys\nif la.index(0) > 0:\n print(0)\n sys.exit()\n\nans = 1\nfor i in la:\n ans *= i\n if ans > 10**18:\n print(-1)\n sys.exit()\nprint(ans)', 'n = int(input())\nla = list(map(int, input().split()))\nla.sort()\nans = 1\nfor i in la:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s554640467', 's820366570'] | [21652.0, 21476.0] | [48.0, 84.0] | [200, 148] |
p02658 | u464626513 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['lines = []\nfor i in range(2):\n lines.append(input())\nnum = int(lines[0])\n\nout = 1\nsplit = lines[1].split()\nif "0" in split:\n out = 0\nfor i in range(num):\n print(out)\n out = int(split[i]) * out \n if out > 1000000000000000000:\n out = - 1\n break \nprint(out)', 'lines = []\nfor i in range(2):\n lines.append(input())\nnum = int(lines[0])\n\nout = 1\nsplit = lines[1].split()\nfor i in range(num):\n print(out)\n out = int(split[i]) * out \nif out > 1000000000000000000:\n out = - 1 \nprint(out)', 'lines = []\nfor i in range(2):\n lines.append(input())\nnum = int(lines[0])\n\nout = 1\nsplit = lines[1].split()\nif "0" in split:\n out = 0\nfor i in range(num):\n out = int(split[i]) * out \n if out > 1000000000000000000:\n out = - 1 \n break\nprint(out)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s121869386', 's917327418', 's606796217'] | [19564.0, 25488.0, 19344.0] | [91.0, 2225.0, 63.0] | [283, 235, 271] |
p02658 | u464823755 | 2,000 | 1,048,576 | 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 pyn():\n\tn = int(input())\n\ta = list(map(int, input().split()))\n if 0 in a:\n print(0)\n return\n \n\tans=1\n\tfor i in a:\n \t \tans *= i\n\t\tif ans>10**18:\n \t\t\tprint(-1)\n return\n\tprint(ans)\n', 'def pyn():\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>10**18:\n print(-1)\n return\n print(ans)\n\npyn()'] | ['Runtime Error', 'Accepted'] | ['s868287786', 's945484481'] | [8932.0, 21592.0] | [26.0, 57.0] | [210, 212] |
p02658 | u465246274 | 2,000 | 1,048,576 | 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\nr = a[0]\n\nfor i in a[1:]:\n r *= i\n if r > 10**8:\n r = -1\n break\n\nif 0 in a:\n r = 0\n \nprint(r)', 'n = int(input())\n \na = list(map(int, input().split()))\n \nr = a[0]\n \nfor i in a[1:]:\n r *= i\n if r > 10**18:\n r = -1\n break\n \nif 0 in a:\n r = 0\n \nprint(r)'] | ['Wrong Answer', 'Accepted'] | ['s349970693', 's627184734'] | [21592.0, 21652.0] | [51.0, 52.0] | [160, 163] |
p02658 | u465652095 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from operator import mul\nfrom functools import reduce\n\nN = int(input())\nx = [int(input()) for i in range(N)]\ny = reduce(mul, x)\n\nif y > 10**18:\n print(-1)\nelse:\n print(y)', 'N = int(input())\nA = list(map(int, input().split()))\n\nnum = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in A:\n num = num * i\n if num > 10**18:\n print(-1)\n exit()\n\nprint(num)'] | ['Runtime Error', 'Accepted'] | ['s349978302', 's158602423'] | [13576.0, 21592.0] | [41.0, 53.0] | [176, 194] |
p02658 | u465900169 | 2,000 | 1,048,576 | 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 = input()\nA = list(map(int,input().split()))\nB = False\ntotal = 1\nfor a in A:\n total *= a\n if a==0:\n B = True\n break\nif total>10**18 or not B:\n print(-1)\n sys.exit()\nprint(total)', 'import sys\nN = input()\nA = list(map(int,input().split()))\nB = False\ntotal = 1\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n elif total <=10**18:\n total *= a\n else:\n B = True\nif B or total>10**18:\n print(-1)\nelse:\n print(total)\n \n\n'] | ['Wrong Answer', 'Accepted'] | ['s017182441', 's677886622'] | [21636.0, 21776.0] | [2206.0, 59.0] | [216, 281] |
p02658 | u466419548 | 2,000 | 1,048,576 | 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\nN = int(input())\nlst = list(map(int,input().split()))\nif N == len(lst) :\n output = numpy.prod(lst)\n if output <= 10**8 :\n print(output)\n else :\n print(-1)\nelse :\n exit()\n', 'A,B = map(float, input().split())\nprint(int(A * B))\nN = int(input())\nlst = list(map(int, input().split()))\nres = 1\nif 0 in lst:\n res = 0\nfor x in lst:\n res *= x\n if res > 10**18:\n res = -1\nprint(res)', 'a, b = map(float, input().split())\nprint(int(a * b))\nn = int(input())\nls = list(map(int, input().split()))\nres = 1\nif 0 in ls:\n res = 0\nfor x in ls:\n res *= x\n if res > 10**18:\n res = -1\nprint(res)', 'N = int(input())\nlst = list(map(int,input().split())\noutput = 1\nif 0 in lst :\n\tprint(0)\n quit()\nfor x in lst :\n\toutput = output * x \n if output > 10**8 :\n \tprint(-1)\n quit()\nprint(output)', 'N = int(input())\nlst = list(map(int, input().split()))\nlst = sorted(A,reverse=True)\noutput = 1\nif 0 in lst:\n print(0)\n quit()\nelse:\n for i in range(N):\n output = output*A[i]\n if output>= 10**18:\n print(-1)\n quit()\nprint(output)', 'N = int(input())\nlst = list(map(int, input().split()))\noutput = 1\nif 0 in lst:\n print(0)\n quit()\nfor i in ls:\n output *= i\n if output > 10**18:\n print(-1)\n quit()\nprint(output)', 'n = int(input())\nlst = list(map(int, input().split()))\noutput = 1\nif 0 in lst:\n print(0)\n quit()\nfor x in lst:\n output = output * x\n if res > 10**18:\n print(-1)\n quit()\nprint(output)\n', 'a, b = map(float, input().split())\nprint(int(a * b))\nn = int(input())\nls = list(map(int, input().split()))\nres = 1\nif 0 in ls:\n res = 0\nfor x in ls:\n res *= x\n if res > 10**18:\n res = -1\nprint(res)', 'from functools import reduce\nN = int(input())\nlst = list(map(int,input().split()))\nif N == len(lst) :\n output = reduce((lambda x,y: x*y),lst)\n if output <= 10**8 :\n print(output)\n else :\n print(-1)\nelse :\n exit()', 'n = int(input())\nls = list(map(int, input().split()))\nres = 1\nif 0 in ls:\n print(0)\n quit()\nfor x in ls:\n res *= x\n if res > 10**18:\n print(-1)\n quit()\nprint(res)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s007379341', 's213434266', 's340368315', 's415061344', 's685034431', 's690052259', 's776239171', 's877553582', 's942239896', 's541534959'] | [40172.0, 9076.0, 9140.0, 9020.0, 21636.0, 21792.0, 21584.0, 9140.0, 22756.0, 21780.0] | [139.0, 23.0, 23.0, 22.0, 53.0, 47.0, 49.0, 23.0, 2206.0, 48.0] | [209, 216, 213, 213, 272, 202, 209, 213, 238, 188] |
p02658 | u467881696 | 2,000 | 1,048,576 | 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)\nfor num in range(n):\n x *= a[num]\n if x > 10**18:\n print(-1)\n sys.exit()\nprint(x)\n\n', 'import numpy as np\nn = int(input())\na = list(map(int,input().split()))\naProd = np.prod(a)\nif (aProd >= 10**18):\n print(-1)\nelse:\n print(aProd)\n ', 'n = int(input())\na = list(map(int,input().split()))\nx = 0\nfor num in range(n):\n x *= a[num]\n if x > 10**18:\n print(-1)\n sys.exit()\nprint(x)\n\n', ' n = int(input())\na = list(map(int,input().split()))\nif 0 in a:\n print(0)\n sys.exit()\nfor num in range(n):\n x *= a[num]\n if x > 10**18:\n print(-1)\n sys.exit()\nprint(x)\n\n', 'import numpy as np\nn = int(input())\na = list(map(int,input().split()))\nif (aProd > 10**18):\n print(-1)\nelse:\n print(aProd)\n ', 'import numpy as np\nn = int(input())\na = list(map(int,input().split()))\naProd = np.prod(a)\nif 0 in a:\n print(0)\nelif aProd >= np.power(10, 18):\n print(-1)\nelse:\n print(aProd)\n ', 'import sys\nn = int(input())\na = list(map(int,input().split()))\nx = 1\nif 0 in a:\n print(0)\n sys.exit()\nfor num in range(n):\n x *= a[num]\n if x > 10**18:\n print(-1)\n sys.exit()\nprint(x)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s064838962', 's316212865', 's333411646', 's380395421', 's810000209', 's811718511', 's531824020'] | [8948.0, 40264.0, 21792.0, 9008.0, 40052.0, 40088.0, 21708.0] | [21.0, 140.0, 68.0, 23.0, 140.0, 142.0, 52.0] | [180, 153, 161, 195, 133, 187, 210] |
p02658 | u468972478 | 2,000 | 1,048,576 | 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 a:\n s *= i\n if s => 10 ** 8:\n s = -1\n break\nif 0 in a:\n s = 0\nprint(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nif 0 in a:\n print(0)\n \nfor i in a:\n if i >= 10 ** 8:\n print(-1)\n break\n s *= i\n if s >= 10 ** 8:\n print(-1)\n break\nelse:\n print(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s => 10 ** 18:\n s = -1\n break\nif 0 in n:\n s = 0\nprint(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s => 10 ** 8:\n ans = -1\n break\nif 0 in n:\n ans = 0\nprint(ans)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s => 10 ** 8:\n s = -1\n break\nif 0 in n:\n s = 0\nprint(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s => 10 ** 8:\n print(-1)\n break\nelse:\n print(s)', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nif 0 in a:\n print(0)\nfor i in a:\n if \nfor i in a:\n if i >= 10 ** 8:\n print(-1)\n break\n s *= i\n if s >= 10 ** 8:\n print(-1)\n break\nelse:\n print(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s => 10 ** 18:\n s = -1\n break\nif 0 in a:\n s = 0\nprint(s)\n ', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor _ in range(0):\n if 0 in a:\n print(0)\n break\n for i in a:\n if i >= 10 ** 8:\n print(-1)\n break\n s *= i\n if s >= 10 ** 8:\n print(-1)\n break\n else:\n print(s)\n', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\n if 0 in a:\n print(0)\n exit()\n for i in a:\n if i >= 10 ** 8:\n print(-1)\n break\n s *= i\n if s >= 10 ** 8:\n print(-1)\n break\n else:\n print(s)\n', 'n = int(input())\na = list(map(int, input().split()))\ns = 1\nfor i in a:\n s *= i\n if s > 10 ** 18:\n s = -1\n break\nif 0 in a:\n s = 0\nprint(s)\n '] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s001280850', 's120410663', 's311836515', 's313251407', 's367853664', 's401654265', 's498712492', 's803722320', 's953053679', 's960595455', 's216173906'] | [8928.0, 21608.0, 8984.0, 9020.0, 9020.0, 8840.0, 9012.0, 8940.0, 21624.0, 8976.0, 21596.0] | [32.0, 56.0, 31.0, 23.0, 23.0, 25.0, 24.0, 27.0, 53.0, 26.0, 59.0] | [149, 210, 150, 155, 149, 139, 225, 150, 258, 266, 149] |
p02658 | u469685228 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\np=input().split()\np=list(map(int,p))\n\nmul=1\ni=0\n\nif 0 in p:\n print(0)\nelse:\n while mul<=100000000000000000 and i!=n:\n mul=mul*p[i]\n i+=1\n if mul>100000000000000000 or i!=n:\n print(-1)\n else:\n print(mul)', "n=int(input())\np=input().split()\np=list(map(int,p))\n\nmul=1\ni=0\n\nif '0' in p:\n print(0)\nelse:\n while mul<=100000000000000000 and i!=n:\n mul=mul*p[i]\n i+=1\n if mul>100000000000000000 or i!=n:\n print(-1)\n else:\n print(mul)", 'n=int(input())\np=input().split()\np=list(map(int,p))\n\nmul=1\n\nfor i in p:\n mul=mul*i\n \nif mul>100000000000000000:\n print(-1)\nelse:\n print(mul)', 'n=int(input())\np=input().split()\np=list(map(int,p))\n\nmul=1\ni=0\n\nif 0 in p:\n print(0)\nelse:\n while mul<=1000000000000000000 and i!=n:\n mul=mul*p[i]\n i+=1\n if mul>1000000000000000000 or i!=n:\n print(-1)\n else:\n print(mul)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s152883604', 's416720153', 's705444474', 's951349506'] | [21648.0, 21796.0, 21648.0, 21596.0] | [52.0, 52.0, 2206.0, 51.0] | [233, 235, 144, 235] |
p02658 | u471342385 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA = map(int, input().split())\n\nA.sort()\n\nans = 1\nfor a in A:\n ans = ans * a\n if ans > 1000000000000000000:\n print -1\n quit()\n\nprint(ans)\n', 'import sys\ninput = sys.stdin.readline\n\nN = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\n\nans = 1\nfor a in A:\n ans = ans * a\n if ans > 1000000000000000000:\n print(-1)\n quit()\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s911448893', 's558020452'] | [19496.0, 21772.0] | [37.0, 85.0] | [201, 208] |
p02658 | u471885677 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['limit = 1E18\nn = input()\ntotal = 0\nfor i in range(n):\n x = input()\n total += x\n if total > limit:\n print(-1)\n exit()\n \nprint(total)', 'limit = 1E18\nn = int(input())\ntotal = 1\n# A string\nline = str(input())\n\nif line.startswith("0 ") or " 0" in line:\n print(0)\n exit()\n\nfor i in line.split():\n x = int(i)\n total *= x\n if total > limit:\n print(-1)\n exit()\n\nprint(-1 if total > limit else total)\n'] | ['Runtime Error', 'Accepted'] | ['s888135083', 's726161380'] | [9052.0, 19428.0] | [21.0, 55.0] | [143, 286] |
p02658 | u472039178 | 2,000 | 1,048,576 | 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\nN = input()\nAn = input().split()\nAnS = numpy.prod(An)\nprint(AnS)\n', 'import sys\nN = int(input())\nAn = list(map(int,input().split()))\na = 1\nif 0 in An:\n print("0")\n sys.exit()\nelse:\n for i in range(N):\n a *= An[i]\n if a > 10**18:\n print("-1")\n sys.exit()\n if a <= 10**18:\n print(a)\n sys.exit()\n'] | ['Runtime Error', 'Accepted'] | ['s502726262', 's862268328'] | [51440.0, 21760.0] | [142.0, 63.0] | [78, 286] |
p02658 | u472279714 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\np=list(map(int, input().split()))\ni=0\nans=1\nflag=0\nk=1e18\nwhile(n>i):\n\tans*=p[i]\n\tn-=1\n\tif(p[i]==0):\n\t\tbreak\n\tif(ans>k):\n\t\tbreak\n\ti+=1\t\t\nif(ans>k):\n\t\tprint(-1)\nelse:\n\t\tprint(ans)\n\t\t\n', 'n=int(input())\np=list(map(int, input().split()))\ni=0\nans=1\nflag=0\nwhile(n>i):\n\tans*=p[i]\n\tn-=1\n\tif(p[i]==0):\n\t\tbreak\n\tif(ans>1000000000000000000):\n\t\tbreak\n\ti+=1\t\t\nif(ans>1000000000000000000):\n\t\tprint(-1)\nelse:\n\t\tprint(ans)\n\t\t\n', '#include <bits/stdc++.h>\nusing namespace std; \ntypedef long long int ll;\n#pragma GCC optimize("O3")\n#define pb push_back\n\nint32_t main() {\n ios::sync_with_stdio(false);\n cin.tie(0);\n\tint n ;\n\tcin >> n ;\n\tll ans = 1;\n\tll k = 1000000000000000000;\n\tint fl =0;\n\twhile ( n--)\n\t{\n\t\tll in ;\n\t\tcin >> in;\n\t\tans=ans*in;\n\t\tif(ans>k) {\n\t\t\tfl=1;}\n\t\tif(in==0){\n\t\t\tans=0;\n\t\t}\n\t\tif(ans!=0)\t\n\t\tif((k/ans)>in) {\n\t\t\tfl=1;\n\t\t}\t\n\t}\n\tif(\tfl==1 and ans!=0)\n\tcout<<-1<<endl;\n\telse\n\tcout << ans;\n}\n', 'n=int(input())\np=list(map(int, input().split()))\ni=0\nans=1\nflag=0\nk=1e18\nwhile(n>i):\n\tif(p[i]==0):\n\t\tflag=1\n\ti+=1\nif(flag==1):\n\tprint(0)\nelse:\n\tflag=0\n\ti=0\t\t\t\n\twhile(n>i):\n\t\tans*=p[i]\n\t\tif(ans>k):\n\t\t\tflag=1\n\t\t\tbreak\n\t\ti+=1\t\t\n\tif( flag==1):\n\t\tprint(-1)\n\telse:\n\t\tprint(ans)\n\t\t\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s730548636', 's829521156', 's835639937', 's361138715'] | [21664.0, 21652.0, 8800.0, 21788.0] | [52.0, 48.0, 21.0, 70.0] | [197, 226, 482, 275] |
p02658 | u473092610 | 2,000 | 1,048,576 | 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\nketa=1\na.sort()\nfor i in a:\n keta+=(len(str(i))-1)\n #print(keta)\n if(i==0):\n ans=0\n break\n if(keta>18):\n ans=-1\n break\n ans=ans*i\n if(ans>1000000000000000000):\n ans=-1\n break\n\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nans=1\nketa=1\na.sort()\nfor i in a:\n \n #print(keta)\n if(i==0):\n ans=0\n break\n \n ans=ans*i\n if(ans>1000000000000000000):\n ans=-1\n break\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s126747640', 's955084838'] | [21648.0, 21640.0] | [76.0, 74.0] | [300, 238] |
p02658 | u474137393 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\na = (int(x) for x in input().split())\nnumber =1\n\nif 0 in a:\n print(0)\n exit(0)\n \nfor i in a:\n number *= i\n if number > 10**18:\n print(-1)\n exit(0)\n\nprint(number)', 'N = int(input())\na = (int(x) for x in input().split())\nnumber = 1\nfor i in a:\n number *= i\n \nif number>10*18:\n number = -1\n\nif N <2 or N >1*5:\n number = -1\nprint(number)', 'N = int(input())\na = (int(x) for x in input().split())\nnumber = 1\nfor i in a:\n number *= i\n \nif number>10^18:\n number = -1\n\n\nprint(number)', 'N = int(input())\na = (int(x) for x in input().split())\nnumber = 1\nfor i in a:\n number *= i\n \nif number>10^18:\n number = -1\n\n\n\nprint(number)', 'N = int(input())\na = (int(x) for x in input().split())\nnumber = 1\nfor i in a:\n number *= i\n \nif number>10*18:\n number = -1\n\nif N <2 or N >10*5:\n number = -1\nprint(number)', 'N = int(input())\na = (int(x) for x in input().split())\nnumber = 1\nfor i in a:\n number *= i\n \nif number>10*18:\n number = -1\n \nprint(number)', 'from sys import exit\nn = int(input())\na = [int(i) for i in input().split()]\nnumber =1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in a[:n]:\n number *= i\n if number > 10**18:\n print(-1)\n exit()\n\nprint(number)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s350310907', 's424247528', 's488191447', 's684409008', 's805708429', 's835304884', 's034182893'] | [19388.0, 19376.0, 19408.0, 19420.0, 19392.0, 19364.0, 21608.0] | [44.0, 2206.0, 2206.0, 2206.0, 2206.0, 2206.0, 51.0] | [215, 181, 147, 148, 182, 150, 234] |
p02658 | u475966842 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['if min(As)==0:\n num=0\nelse:\n num=1\n for i in range(N):\n num *= As[i]\n if num>10**18:\n print("breakに突入")\n num=-1\n break\n\nprint(num)', 'N=int(input())\nAs=list(map(int,input().split()))\nnum=1\n\nfor i in range(N):\n num *= As[i]\n if num>10^18:\n num=-1\n break\nprint(num)', 'N=int(input())\nAs=list(map(int,input().split()))\nnum=1\n\nfor i in range(N):\n num *= As[i]\n \nif num>10^18:\n num=-1\n\nprint(num)', '#169B\nN=int(input())\nAs=list(map(int,input().split()))\n\nif min(As)==0:\n num=0\nelse:\n num=1\n for i in range(N):\n num *= As[i]\n if num>10**18:\n num=-1\n break\n\nprint(num)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s082905602', 's617424674', 's737475364', 's989479844'] | [9016.0, 21600.0, 21640.0, 21768.0] | [23.0, 50.0, 2206.0, 50.0] | [192, 149, 133, 212] |
p02658 | u479641507 | 2,000 | 1,048,576 | 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())\nmod = 10**18\nli = list(map(int, input().split())).sort()\nans = 1\nfor i in range(n):\n ans = ans * li[i]\n if ans > mod:\n ans = -1\n break\nprint(ans)\n', 'n = int(input())\nans = 1\nfor i in range(n):\n ans = ans * i\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n', 'n = int(input())\nmod = 10**18\nli = list(map(int, input().split()))\nli.sort()\nans = 1\nfor i in range(n):\n ans *= li[i]\n if ans > mod:\n ans = -1\n break\nprint(ans)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s150876238', 's449205585', 's137023045'] | [21728.0, 9168.0, 21468.0] | [82.0, 32.0, 101.0] | [183, 114, 181] |
p02658 | u479937725 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\nA = list(map(int,input().split()))\nX = 1\n\nfor a in A:\n X*=a\nif X>=1000000000000000000:\n print(-1)\nelse:\n print(X)', 'N = int(input())\nA = sorted(list(map(int,input().split())))\nX = 1\n\nif A[0]==0:\n print(0)\n\nelse:\n for a in A:\n X*=a\n if X>=1000000000000000001:\n print(-1)\n break\n else:\n print(X)'] | ['Wrong Answer', 'Accepted'] | ['s066960278', 's101815919'] | [21648.0, 21704.0] | [2206.0, 67.0] | [133, 199] |
p02658 | u481429249 | 2,000 | 1,048,576 | 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())\nAi = list(map(int, input().split()))\n \nresult = 1\n \nif 0 in Ai:\n result= '0' \nelse:\n for i in range(N):\n result *= Ai[i]\n if result > 10**18:\n result = '-1'\n \nprint(result)", 'import sys\nn = int(input())\na = list(map(int,input().split()))\nif 0 in a:\n print(0)\n sys.exit()\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n sys.exit()\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s052759488', 's404361875'] | [9028.0, 21600.0] | [25.0, 50.0] | [219, 213] |
p02658 | u481550011 | 2,000 | 1,048,576 | 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())\nx=10**18\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans=ans*i\n if(ans>x):\n ans=-1\nprint(ans)', 'n=int(input())\na=map(int,input().split())\nx=10**18\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans=ans*i\n if(ans>x):\n ans=-1\n break\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nx=10**18\nans=1\nif 0 in a:\n ans=0\nelse:\n for i in a:\n ans=ans*i\n if(ans>x):\n ans=-1\n break\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s398923709', 's902302198', 's530225562'] | [19488.0, 19412.0, 21780.0] | [48.0, 44.0, 53.0] | [148, 160, 166] |
p02658 | u483748949 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\n\nn = int(input())\na = np.array(list(map(int, input().split())))\n\nprint(a)\n\np = np.prod(a, axis=0)\n\nprint(p)\n\nif p > 10**18:\n print(-1)\nelse:\n print(p)\n', 'n = int(input())\na = list(map(int, input().split()))\np = 1\nif 0 in n:\n print(0)\n exit()\nfor i in range(n):\n p = p * a[i]\nif p > 10**18:\n print(-1)\nelse:\n print(p)', 'n = int(input())\na = list(map(int, input().split()))\n\ndef ans(a):\n if 0 in a:\n return 0\n n = 1\n for i in a:\n n *= i\n if n > 10**18\n return -1\n return n\n\nprint(ans(a))', 'n = int(input())\na = list(map(int, input().split()))\n\ndef ans(a):\n if 0 in a:\n return 0\n n = 1\n for i in a:\n n *= i\n if n > 10**18:\n return -1\n return n\n\nprint(ans(a))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s471491078', 's476301409', 's481247573', 's361017301'] | [39888.0, 21776.0, 8984.0, 21816.0] | [138.0, 53.0, 20.0, 48.0] | [176, 177, 210, 211] |
p02658 | u485819963 | 2,000 | 1,048,576 | 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(map(int, input().split()))\n\n# multiple = 1\n\n# multiple *= A[i]\n\n\n\n# if multiple <= 10 ** 18 :\n# print(multiple)\n# else:\n# print(-1)\n\n\nif 0 in A:\n print(0)\n return\n\noutput = 1\nfor a in A:\n output *= a\n \n if output > 10 ** 18:\n print(-1)\n return\n\nprint(output)\n', '\nN = int(input()) \n\nA = list(map(int, input().split()))\n\n# multiple = 1\n\n# multiple *= A[i]\n\n\n\n# if multiple <= 10 ** 18 :\n# print(multiple)\n# else:\n# print(-1)\n\ndef main():\n if 0 in A:\n print(0)\n return\n\n output = 1\n for a in A:\n output *= a\n\n if output > (10 ** 18):\n print(-1)\n return\n\n print(output)\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s264012147', 's713265691'] | [9096.0, 21748.0] | [25.0, 53.0] | [384, 441] |
p02658 | u486209657 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nA=list(map(int,input().split()))\nX=1\nif 0 in A:\n print(0)\n break\n\nelse:\n for idx in range(N):\n \tX=X*A[idx]\n \tif X >1*10**18:\n \t\tprint(-1)\n \tbreak\n\telse:\n \tprint(X)\n', 'N=int(input())\nA=list(map(int,input().split()))\nX=1\nfor idx in range(N):\n X=X*A[idx]\n\nif X >10**18:\n print(-1)\n break\nelse:\n print(X)\n', 'N=int(input())\nA=list(map(int,input().split()))\nX=1\nif 0 in A:\n print(0)\n return\n\nfor idx in range(N):\n X=X*A[idx]\n if X >1*10**18:\n print(-1)\n return\n\nprint(X)', 'N=int(input())\nA=list(map(int,input().split()))\nX=0\nfor idx in range(N):\n X=X*A[idx]\n if X >10**18:\n print(-1)\n break\nelse:\n print(X)', 'N=int(input())\nA=list(map(int,input().split()))\nX=1\nif 0 in A:\n print(0)\nelse:\n for idx in range(N):\n X=X*A[idx]\n if X >10**18:\n print(-1)\n break\n else:\n print(X)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s448616569', 's460818299', 's575857038', 's592532658', 's734003732'] | [8956.0, 9032.0, 9104.0, 21496.0, 21532.0] | [22.0, 28.0, 23.0, 73.0, 57.0] | [190, 138, 170, 142, 215] |
p02658 | u488934106 | 2,000 | 1,048,576 | 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 b169(n, alist):\n\n ans = 1\n for i in alist:\n ans *= i\n\n return ans if ans < 10**18 else -1\n\ndef main():\n n = int(input())\n alist = list(map(int, input().split()))\n print(b169(n, alist))\n\nif __name__ == '__main__':\n main()", "def b169(n, alist):\n\n ans = 1\n for i in alist:\n ans *= i\n\n return ans if ans < 10**18 else -1\n\ndef main():\n n = int(input())\n alist = list(int(input()))\n print(b169(n, alist))\n\nif __name__ == '__main__':\n main()", "def b169(n, alist):\n\n ans = 1\n for i in alist:\n if i == 0:\n return 0\n\n for i in alist:\n ans *= i\n if ans > 10**18:\n return -1\n\n return ans\n\ndef main():\n n = int(input())\n alist = list(map(int, input().split()))\n print(b169(n, alist))\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s457842161', 's914211554', 's252972024'] | [21660.0, 12664.0, 21520.0] | [2206.0, 34.0, 58.0] | [252, 239, 336] |
p02658 | u489691149 | 2,000 | 1,048,576 | 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()))\nout=1\nfor x in l:\n out=out*x\nprint(out) if out<10**18 else print(-1)', 'n=int(input())\nl=list(map(int,input().split()))\nout=1\nfor x in l:\n out*=x\nprint(out) if out<10**18 else print(-1)', 'n=int(input())\nl=list(map(int,input().split()))\nout=1\nif 0 in l: print(0);exit()\nfor x in l:\n out*=x\n if out>10**18:\n print(-1)\n exit()\nprint(out)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s085516040', 's414441716', 's697258612'] | [21696.0, 21640.0, 21592.0] | [2206.0, 2206.0, 51.0] | [119, 116, 166] |
p02658 | u490489966 | 2,000 | 1,048,576 | 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\nn = int(input())\na = list(map(int, input().split()))\nans = 1\nb = 0\nfor i in a:\n ans *= i\n if ans > 10 ** 18:\n b = -1\nif ans == 0:\n b = 0\nif b != -1:\n print(-1)\nelse:\n print(ans)\n', '#B\nn=int(input())\na = list(map(int, input().split()))\na.sort()\nans=1\nfor i in a:\n ans *= i\n if ans == 0:\n break\n if ans > 10 ** 18:\n ans = -1\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s834850131', 's492455337'] | [21612.0, 21624.0] | [2206.0, 74.0] | [203, 189] |
p02658 | u492447501 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\n*A, = map(int, input().split())\n\nans = 1\nfor i in range(N):\n ans = ans * A[i]\n\nif ans>=10**18:\n print(-1)\nelse: \n print(ans)', 'N = int(input())\n*A, = map(int, input().split())\n\ndef dfs(l, r):\n\n if l==r:\n return A[l]\n mid = (l+r)//2\n ans = 1\n ans = ans * dfs(l, mid)\n ans = ans * dfs(mid+1, r)\n return ans\n\nans = dfs(0, len(A)-1)\n\nif ans>10**18:\n print(-1)\n exit()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s402082585', 's966369474'] | [21588.0, 21656.0] | [2206.0, 1474.0] | [153, 278] |
p02658 | u493318999 | 2,000 | 1,048,576 | 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 ans *= a[i]\n if ans > 10**18:\n \t print(-1)\n exit()\n\nprint(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nans = 1\nfor i in range(len(a)):\n\tif ans > 10**18:\n \tprint(-1)\n exit()\n else:\n \tans *= a[i]\nif ans > 10**18:\n\tprint(-1)\n exit()\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\n\nfor i in range(len(a)):\n if a[i] == 0:\n print(0)\n exit()\n\nans = 1\nfor i in range(len(a)):\n ans *= a[i]\n print(ans)\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n', 'n = int(input())\na = list(map(int,input().split()))\n\nfor i in range(len(a)):\n if a[i] == 0:\n print(0)\n exit()\n\nans = 1\nfor i in range(len(a)):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s069208524', 's276933052', 's638893547', 's576957857'] | [9028.0, 9020.0, 21648.0, 21592.0] | [25.0, 24.0, 86.0, 57.0] | [162, 209, 243, 230] |
p02658 | u494037809 | 2,000 | 1,048,576 | 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([int(a) for a in input().split()])\n\nif int(np.prod(A))>=10**18:\n print(-1)\nelse:\n print(int(np.prod(A)))', 'import sys\n\nN = int(input())\nA = input().split()\n\nif "0" in A:\n print(0)\n\nelse:\n ans = 1\n \n for n in range(N):\n ans = ans*int(A[n])\n\n if ans>10**18:\n print(-1)\n sys.exit()\n \n if ans<=10**18:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s852280516', 's072741612'] | [40068.0, 19416.0] | [137.0, 52.0] | [160, 275] |
p02658 | u494295478 | 2,000 | 1,048,576 | 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()\nlist1=input().split()\nA=int(A)\n \nAns=1\nfor i in range(0,A):\n Ans= Ans*int(list1[i])\n \nif 10**18<=Ans:\n print(-1)\nelse: \n print(Ans)', 'A=input()\nlist1=input().split()\nA=int(A)\nAns=1\n#---------------------------\n\nif "0" in list1:\n print("0")\n \nelse:\n for i in range(0,A):\n Ans=Ans*int(list1[i]) \n if Ans >10**18:\n print(-1)\n break\n else:\n print(Ans)', 'A=input()\nlist1=input().split()\nA=int(A)\n\nAns=1\nfor i in range(0,A):\n Ans*= Ans*int(list1[i])\n\nif 10**18>=Ans:\n print(-1)\nelse: \n print(Ans)', 'A=input()\nlist1=input().split()\nA=int(A)\nAns=1\n#---------------------------\n\nif "0" in list1:\n print("0")\n \nelse:\n for i in range(0,A):\n Ans=Ans*int(list1[i]) \n if Ans >10**18:\n print(-1)\n break\n if Ans <=10**18: \n print(Ans) \n '] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s552255282', 's638327535', 's838368844', 's094114505'] | [19160.0, 19184.0, 289396.0, 19304.0] | [2206.0, 80.0, 2215.0, 50.0] | [152, 279, 151, 301] |
p02658 | u494741995 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n = int(input())\na = list(map(int, input().split()))\nx = 1\nfor i in range(n):\n x = x * a[i]\n if x > 10 ** 18:\n print(-1)\n break\nif x < 10 ** 18:\n print(x)', 'n = int(input())\na = list(map(int, input().split()))\nx = 1\nif 0 in a:\n x = 0\nelse:\n for i in range(n):\n x = x * a[i]\n if x > 10 ** 18:\n x = -1\n break\nprint(x)'] | ['Wrong Answer', 'Accepted'] | ['s453124215', 's369718915'] | [21648.0, 21476.0] | [49.0, 49.0] | [177, 200] |
p02658 | u496009935 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['n=int(input())\nA=list(map(int,input().split()))\n\nans=1\nfor i in range(n):\n ans*=A[i]\n if ans > 10**18\n break\n\nif ans>10**18:\n print(-1)\nelse :\n print(ans)\n', 'n=int(input())\nA=list(map(int,input().split()))\n\nans=1\n\nif 0 in A:\n print(0)\nelse :\n for i in range(n):\n ans*=A[i]\n if ans > 10**18:\n break\n\n if ans>10**18:\n print(-1)\n else :\n print(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s736873311', 's070805374'] | [9024.0, 21708.0] | [27.0, 62.0] | [170, 239] |
p02658 | u496157893 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = input().split()\n\nlist = [int(x) for x in input().split()]\n\nsortlist = list.sorted()\n\nanswer = 1\n\nfor a in sortlist:\n answer = answer*a\n if answer == 0:\n break\n if answer > 10^18:\n answer = -1\n break\n else:\n continue\n', 'N = input().split()\n\nlist = [int(x) for x in input().split()]\n\nsortlist = list.sorted()\n\nanswer = 1\n\nfor a in sortlist:\n answer = answer*a\n if answer == 0:\n break\n if answer > 10^18:\n answer = -1\n break\n else:\n continue\n\nprint(answer)', 'N = input().split()\n\nlist = [int(x) for x in input().split()]\n\nlist.sort()\n\nanswer = 1\n\nfor a in list:\n answer = answer*a\n if answer == 0:\n break\n if answer > 10**18:\n answer = -1\n break\n else:\n continue\n\nprint(answer)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s888540502', 's934540654', 's080123671'] | [21624.0, 21680.0, 21696.0] | [58.0, 60.0, 84.0] | [260, 274, 258] |
p02658 | u496212176 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = int(input())\na_list = list(map(int, input().split()))\n\nres = 1\nfor a in a_list:\n res *= a\nif res // (10 ** 18) == 1:\n res = -1\nprint(res)', 'N = int(input())\na_list = list(map(int, input().split()))\n\nres = 1\nif 0 in a_list:\n print(0)\n exit()\n\nfor a in a_list:\n res *= a\n if res > (10 ** 18):\n res = -1\n break\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s673591071', 's375833602'] | [21720.0, 21700.0] | [2206.0, 48.0] | [147, 204] |
p02658 | u496850275 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['input()\nl = map(int, input().split())\nr = 1\nif 0 in l:\n print(0)\nelse:\n for i in l:\n r *= i\n if r > 1e18:\n break\n print(-1 if r > 1e18 else r)', 'input()\nl = list(map(int, input().split()))\nif 0 in l:\n print(0)\nelse:\n r = 1\n for i in l:\n r *= i\n if r > 1e18:\n break\n print(-1 if r > 1e18 else r)'] | ['Wrong Answer', 'Accepted'] | ['s225111380', 's561525581'] | [19276.0, 21628.0] | [49.0, 48.0] | [176, 186] |
p02658 | u497277272 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['str_list_size = input()\nstr_num = input()\nnum_list = str_num.split()\nlist_size = int(str_list_size)\n\nanswer = 1\nfor i in range(0, list_size):\n answer *=int(num_list[i])\n if answer >= 10**18:\n answer = -1\n break\n\nprint(answer)', 'str_num = input()\nnum_list = str_num.split()\n\nanswer = 1\nfor i in range(1, int(num_list[0])+1):\n answer *=int(num_list[i])\n if answer >= 10**18:\n answer = -1\n break\n\nprint(answer)', "def main():\n N = input()\n str_num = input()\n num_list = str_num.split()\n \n if '0' in num_list:\n print(0)\n return\n \n answer = 1\n for num in num_list:\n answer *=int(num)\n if answer > 10**8:\n answer = -1\n break\n\n print(answer)", "def main():\n N = input()\n str_num = input()\n num_list = str_num.split()\n \n if '0' in num_list:\n print(0)\n return\n \n answer = 1\n for num in num_list:\n answer *=int(num)\n if answer > 10**8:\n answer = -1\n break\n\n print(answer)\n\nmain()", 'str_num = input()\nnum_list = str_num.split()\n\nanswer = 1\nfor number in num_list:\n answer *=int(number)\n if answer >= 10**18:\n answer = -1\n break\n\nprint(answer)', "def main():\n N = input()\n str_num = input()\n num_list = str_num.split()\n \n if '0' in num_list:\n print(0)\n return\n \n answer = 1\n for num in num_list:\n answer *=int(num)\n if answer > 10**18:\n answer = -1\n break\n\n print(answer)\n\nmain()"] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s358051436', 's696728513', 's788534011', 's798218437', 's939699970', 's901247107'] | [19152.0, 9188.0, 9108.0, 19188.0, 9176.0, 19288.0] | [54.0, 22.0, 20.0, 36.0, 23.0, 38.0] | [245, 199, 300, 308, 179, 309] |
p02658 | u497600911 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#include <bits/stdc++.h> \nusing namespace std; \ntypedef long long int lli;\n#define MAX 100005\n\nint main(){\n\tios_base::sync_with_stdio(false);\n\tcin.tie(NULL);\n\tlli n;\n\tcin>>n;\n\tlli mask = 1;\n\tlli temp;\n\tbool flag = false;\n\tbool fzero = false;\n\tfor(lli i = 0; i<n; i++){\n\t\tcin>>temp;\n\t\tmask *= temp;\n\t\tif(mask < 0 || mask > 1000000000000000000){\n\t\t\tflag = true;\n\t\t}\n\t\tif(temp == 0)\n\t\t\tfzero = true;\n\t}\n\tif(fzero){\n\t\tcout<<0<<endl;\n\t\treturn 1;\n\t}\n\tif(flag){\n\t\tcout<<"-1"<<endl;\n\t\treturn 1;\n\t}\n\tcout<<mask<<endl;\n}', '\n# number of elements \nn = int(input()) \n \n# Below line read inputs from user using map() function \na = list(map(int,input().strip().split()))[:n] \n \nmask = 1;\nflag = 0;\nfor num in a:\n if(num == 0):\n flag = 1\nmask = 1;\nflagex = 0;\nif(flag == 1):\n print(0)\nelse:\n for num in a:\n mask *= num;\n if(mask > 1000000000000000000):\n flagex = -1;\n break;\n if(flagex == -1):\n print(-1);\n else:\n print(mask);\n '] | ['Runtime Error', 'Accepted'] | ['s249990861', 's598472176'] | [9008.0, 21780.0] | [23.0, 53.0] | [527, 490] |
p02658 | u497805118 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['_ = input()\nl = list(map(int, input().split(" ")))\n\nans = functools.reduce(lambda x, y : x* y, l, 1)\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', '\nimport sys\n_ = input()\nl = list(map(int, input().split(" ")))\n\nif 0 in l:\n print(0)\n sys.exit()\n\nans = 1\nfor i in l:\n ans *= i\n if ans > 10 **18:\n print(-1)\n sys.exit()\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s746943474', 's673856258'] | [21744.0, 21636.0] | [49.0, 51.0] | [153, 207] |
p02658 | u500673386 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N=int(input())\nA=sorted(list(map(int,input().split())))\nans=1\nif 0 in A:\n print(0)\n return\nfor i in range(N):\n ans*=A[i]\n if ans>=10**18:\n print(-1)\n break\nelse:print(ans)', "N=int(input())\nA=sorted(list(map(int,input().split())))\nans=1\nfor i in range(N):\n ans*=A[i]\n if ans>=10**18:\n print('-1')\n break\nelse:print(ans)", 'N=int(input())\nA=sorted(list(map(int,input().split())))\nans=1\nif A[0]==0:\n print(0)\n exit()\nfor i in range(N):\n ans*=A[i]\n if ans>=10**18:\n print(-1)\n break\nelse:print(ans)', "import numpy as np\nN=int(input())\nA=list(map(int,input().split()))\nA.sort()\nif A[0]==0:\n print('0')\nelif np.prod(A)<10**18:\n print(np.prod(A))\nelse: print('-1')", 'def main():\n N=int(input())\n A=sorted(list(map(int,input().split())))\n ans=1\n if 0 in A:\n print(0)\n return\n for i in range(N):\n ans*=A[i]\n if ans>10**18:\n print(-1)\n return\n print(ans)\nmain()'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s495713311', 's662806045', 's764564003', 's781193805', 's244539899'] | [9008.0, 21744.0, 21648.0, 40212.0, 21600.0] | [26.0, 97.0, 90.0, 178.0, 82.0] | [197, 164, 198, 166, 259] |
p02658 | u505730871 | 2,000 | 1,048,576 | 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())\ndata = list(map(int, input().split()))\n\nflag = 0\nif data.count(0) > 0:\n print(0)\nelse\n\ta = data[0]\n\tfor i in range(1,n):\n \t\ta = a*data[i]\n if a > 10**18:\n flag = 1\n break\n\n\tif flag == 1:\n \t\tprint('-1')\n\telse\n\t\tprint(a)", 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\nj = 0\n \nwhile i<n:\n while j < n:\n if data[j]==0:\n \t a = 0\n \t break\n j +=1\n break\n a = a*data[i]\n i += 1\n \nif a > 10**18:\n a = -1\n \nprint(a)', 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\nwhile i<n:\n a = a*data[i]\n i += 1\n\nif a > 10^18 -1 :\n a = -1\n \nprint(a)', 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\n \nwhile i<n:\n while j < n:\n \tif data[j]==0:\n \ta = 0\n \tbreak\n j +=1 \n a = a*data[i]\n i += 1\n\nif a > 10**18:\n a = -1\n \nprint(a)', 'n = map(int, input())\ndata = list(map(int, input().split()))\n\na = 1\nwhile i<n:\n a = a*data[i]\n i += 1\n if a > 10^18:\n a = -1\n\nprint(a)', 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\nwhile i<n:\n a = a*data[i]\n i += 1\n if a > 10^18:\n a = -1\n break\n \nprint(a)', 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\nwhile i<n:\n a = a*data[i]\n i += 1\n if a > 10^18:\n a = -1\n break\n \nprint(a)', 'n = int(input())\ndata = list(map(int, input().split()))\n \na = 1\ni = 0\nwhile i<n:\n a = a*data[i]\n i += 1\n\nif a > 10^18:\n a = -1\n \nprint(a)', "n = int(input())\ndata = list(map(int, input().split()))\n\nflag = 0\nif data.count(0) > 0:\n\tprint(0)\nelse:\n a = data[0]\n for i in range(1,n):\n a = a*data[i]\n if a > 10**18:\n flag = 1\n break\n \n if flag == 1:\n print('-1')\n else:\n print(a)"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s112971887', 's343265380', 's575158912', 's640813553', 's688044186', 's740182843', 's830081732', 's888461418', 's558660349'] | [9032.0, 21648.0, 21648.0, 9032.0, 21616.0, 21700.0, 21580.0, 21592.0, 21636.0] | [24.0, 62.0, 2206.0, 26.0, 53.0, 49.0, 51.0, 2206.0, 45.0] | [263, 231, 144, 213, 140, 153, 153, 140, 264] |
p02658 | u506765399 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#include<bits/stdc++.h>\nusing namespace std;\n\n#define All(V) V.begin(), V.end()\ntypedef long long int ll;\ntypedef pair<int, int> P;\nconst ll MOD = 1e9+7, INF = 1e9;\n\nint main()\n{\n\tint n; cin >> n;\n vector<ll> v(n);\n rep(i, n){\n cin >> v[i];\n }\n sort(All(v));\n if(v[0] == 0){\n cout << 0 << endl;\n return 0;\n }\n ll ans = v[n-1];\n for(int i = 0; i < n-1; i++){\n ans *= v[i];\n if(ans > (ll)1e18){\n cout << -1 << endl;\n return 0;\n }\n }\n if(ans < 0){\n cout << -1 << endl;\n }\n else cout << ans << endl;\n system("pause");\n}\n', 'N = int(input())\nL = list(map(int, input().split()))\nans = 1\nif 0 in L:\n print(0)\n exit()\nfor i in range(N):\n ans *= L[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s806254563', 's068510443'] | [8948.0, 21792.0] | [20.0, 49.0] | [670, 179] |
p02658 | u507145838 | 2,000 | 1,048,576 | 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()]\nsum = 1\n\nfor i in range(N):\n sum = sum * A[i]\n\nif sum > 10 ** 18:\n sum = -1\n\nprint(sum)', 'N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nnum = A[0]\nfor a in A[1:]:\n num *= a\n if num > 10 ** 18:\n print(-1)\n exit()\nprint(result)', 'N = int(input())\nA = list(map(int, input().split()))\n \nA.sort()\nnum = A[0]\nfor a in A[1:]:\n num *= a\n if num > 10 ** 18:\n print(-1)\n exit()\nprint(num)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s014178482', 's565627963', 's364701905'] | [12764.0, 21660.0, 21544.0] | [25.0, 91.0, 91.0] | [136, 160, 158] |
p02658 | u507456172 | 2,000 | 1,048,576 | 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 A.count(0) >= 1:\n print(0)\nelse:\n B=[i for i in A if i != 1]\n if len(B) >= 100:\n print("-1")\n else:\n for k in range(len(B)-1):\n ans=ans*B[k]\n if ans > 1000000000000000000:\n print("-1")\n else:\n print(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nans=1\nif A.count(0) >= 1:\n print(0)\nelse:\n B=[i for i in A if i != 1]\n if len(B) >= 100:\n print("-1")\n else:\n for k in range(len(B)):\n ans=ans*B[k]\n if ans > 1000000000000000000:\n print("-1")\n else:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s049982515', 's201810938'] | [21788.0, 21516.0] | [55.0, 52.0] | [291, 289] |
p02658 | u508061226 | 2,000 | 1,048,576 | 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 = ans * i\n if ans > 10 ** 18:\n\t print("-1")\n break\n else:\n continue\nelse:\n print(ans)', 'n = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n print("0")\nelse:\n for i in A:\n ans = ans * i\n if ans > 10 ** 18:\n print("-1")\n break\n else:\n continue\n else:\n print(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s668716208', 's524268599'] | [8984.0, 21664.0] | [21.0, 51.0] | [177, 225] |
p02658 | u509029769 | 2,000 | 1,048,576 | 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 x = 1\n for i in range(N):\n x = x * A[i]\n if x>10**18:\n x = -1\n break\n print(x)', 'import sys\n\nN = int(input())\nA = list(map(int,input().split()))\n\nif 0 in A:\n print(0)\nelse:\n x = 1\n for i in range(N):\n x = x * A[i]\n if x>10**18:\n print(-1)\n sys.exit()\n \n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s566831182', 's509527765'] | [21672.0, 21588.0] | [57.0, 57.0] | [203, 236] |
p02658 | u509739538 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n#made by hageron\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n', 'x = input()\n\nprint(x)\n\nprint("Hello World!")', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n return int(input())\ndef readInts():\n return list(map(int, input().split()))\ndef readChar():\n return input()\ndef readChars():\n return input().split()\ndef factorization(n):\n res = []\n if n%2==0:\n res.append(2)\n for i in range(3,math.floor(n//2)+1,2):\n if n%i==0:\n c = 0\n for j in res:\n if i%j==0:\n c=1\n if c==0:\n res.append(i)\n if len(res)==0:\n res = [n]\n return res\ndef fact2(n):\n p = factorization(n)\n res = []\n for i in p:\n c=0\n z=n\n while 1:\n if z%i==0:\n c+=1\n z/=i\n else:\n break\n res.append([i,c])\n return res\ndef fact(n):\n ans = 1\n m=n\n for _i in range(n-1):\n ans*=m\n m-=1\n return ans\ndef comb(n,r):\n if n<r:\n return 0\n l = min(r,n-r)\n m=n\n u=1\n for _i in range(l):\n u*=m\n m-=1\n return u//fact(l)\ndef combmod(n,r,mod):\n return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n r=copyQueue(q)\n ans=[0]*r.qsize()\n for i in range(r.qsize()-1,-1,-1):\n ans[i] = r.get()\n print(ans)\nclass UnionFind():\n def __init__(self, n):\n self.n = n\n self.parents = [-1]*n\n\n def find(self, x): # root\n if self.parents[x]<0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self,x,y):\n x = self.find(x)\n y = self.find(y)\n\n if x==y:\n return\n\n if self.parents[x]>self.parents[y]:\n x,y = y,x\n\n self.parents[x]+=self.parents[y]\n self.parents[y]=x\n\n def size(self,x):\n return -1*self.parents[self.find(x)]\n\n def same(self,x,y):\n return self.find(x)==self.find(y)\n\n def members(self,x): # much time\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i)==root]\n\n def roots(self):\n return [i for i,x in enumerate(self.parents) if x<0]\n\n def group_count(self):\n return len(self.roots())\n\n def all_group_members(self):\n return {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n x = 1\n zero = "0"*n\n ans = []\n ans.append([0]*n)\n for i in range(2**n-1):\n ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n x+=1\n return ans;\ndef arrsSum(a1,a2):\n for i in range(len(a1)):\n a1[i]+=a2[i]\n return a1\ndef maxValue(a,b,v):\n v2 = v\n for i in range(v2,-1,-1):\n for j in range(v2//a+1): \n k = i-a*j\n if k%b==0:\n return i\n return -1\ndef copyQueue(q):\n nq = queue.Queue()\n n = q.qsize()\n for i in range(n):\n x = q.get()\n q.put(x)\n nq.put(x)\n return nq\ndef get_sieve_of_eratosthenes(n):\n data = [2]\n #data = [0,0,0]\n for i in range(3,n+1,2):\n data.append(i)\n data.append(0)\n for i in range(len(data)):\n interval = data[i]\n if interval!=0:\n for j in range(i+interval,n-1,interval):\n data[j] = 0\n ans = [x for x in data if x!=0]\n \n return ans\n\n\na,b = readInts()\n\n#print(a+b)\nprint(a*b)', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n return int(input())\ndef readInts():\n return list(map(int, input().split()))\ndef readChar():\n return input()\ndef readChars():\n return input().split()\ndef factorization(n):\n res = []\n if n%2==0:\n res.append(2)\n for i in range(3,math.floor(n//2)+1,2):\n if n%i==0:\n c = 0\n for j in res:\n if i%j==0:\n c=1\n if c==0:\n res.append(i)\n if len(res)==0:\n res = [n]\n return res\ndef fact2(n):\n p = factorization(n)\n res = []\n for i in p:\n c=0\n z=n\n while 1:\n if z%i==0:\n c+=1\n z/=i\n else:\n break\n res.append([i,c])\n return res\ndef fact(n):\n ans = 1\n m=n\n for _i in range(n-1):\n ans*=m\n m-=1\n return ans\ndef comb(n,r):\n if n<r:\n return 0\n l = min(r,n-r)\n m=n\n u=1\n for _i in range(l):\n u*=m\n m-=1\n return u//fact(l)\ndef combmod(n,r,mod):\n return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n r=copyQueue(q)\n ans=[0]*r.qsize()\n for i in range(r.qsize()-1,-1,-1):\n ans[i] = r.get()\n print(ans)\nclass UnionFind():\n def __init__(self, n):\n self.n = n\n self.parents = [-1]*n\n\n def find(self, x): # root\n if self.parents[x]<0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self,x,y):\n x = self.find(x)\n y = self.find(y)\n\n if x==y:\n return\n\n if self.parents[x]>self.parents[y]:\n x,y = y,x\n\n self.parents[x]+=self.parents[y]\n self.parents[y]=x\n\n def size(self,x):\n return -1*self.parents[self.find(x)]\n\n def same(self,x,y):\n return self.find(x)==self.find(y)\n\n def members(self,x): # much time\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i)==root]\n\n def roots(self):\n return [i for i,x in enumerate(self.parents) if x<0]\n\n def group_count(self):\n return len(self.roots())\n\n def all_group_members(self):\n return {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n x = 1\n zero = "0"*n\n ans = []\n ans.append([0]*n)\n for i in range(2**n-1):\n ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n x+=1\n return ans;\ndef arrsSum(a1,a2):\n for i in range(len(a1)):\n a1[i]+=a2[i]\n return a1\ndef maxValue(a,b,v):\n v2 = v\n for i in range(v2,-1,-1):\n for j in range(v2//a+1): \n k = i-a*j\n if k%b==0:\n return i\n return -1\ndef copyQueue(q):\n nq = queue.Queue()\n n = q.qsize()\n for i in range(n):\n x = q.get()\n q.put(x)\n nq.put(x)\n return nq\ndef get_sieve_of_eratosthenes(n):\n data = [2]\n #data = [0,0,0]\n for i in range(3,n+1,2):\n data.append(i)\n data.append(0)\n for i in range(len(data)):\n interval = data[i]\n if interval!=0:\n for j in range(i+interval,n-1,interval):\n data[j] = 0\n ans = [x for x in data if x!=0]\n \n return ans\n\n\na,b = readInts()\n\n#print(a+b)\nprint(a*b)', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n#made by hageron\ndef readInt():\n', 'import math\nfrom collections import deque\nfrom collections import defaultdict\n\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\n\n\nn = readInt()\na = readInts()\n\nans = 1\n\nd = defaultdict(int)\n\nif 0 in a:\n\tprint(0)\n\texit()\n\nfor i in a:\n\td[i]+=1\n\nfor k in d:\n\tans*=k**d[k]\n\tif ans>10**18:\n\t\tprint(-1)\n\t\texit()\n\nelse:\n\tprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s061651874', 's079221515', 's105667409', 's116165807', 's183261184', 's446536054', 's452990920', 's657228591', 's751986279', 's961173191', 's723881588'] | [9016.0, 9012.0, 9088.0, 8952.0, 9012.0, 9008.0, 9032.0, 9660.0, 9652.0, 8944.0, 22528.0] | [24.0, 23.0, 30.0, 21.0, 25.0, 25.0, 23.0, 27.0, 28.0, 29.0, 78.0] | [134, 134, 44, 134, 134, 134, 134, 3079, 3079, 134, 385] |
p02658 | u510331904 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['N = input()\nA = [int(i) for i in input().split()]\n\ncount = 1\n\nfor i in A:\n if A > 10**18:\n print(-1)\n exit()\n\nfor i in A:\n count *= i\n\nif count > 10**18:\n print(-1)\nelse:\n print(count)', 'N = int(input())\nA = [int(i) for i in input().split()]\n\ncount = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in A:\n count *= i\n if count > 10**18:\n print(-1)\n exit()\n\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s709171718', 's881329117'] | [21776.0, 21648.0] | [51.0, 52.0] | [210, 199] |
p02658 | u511096055 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['# -*- coding: utf-8 -*-\nfrom sys import stdin\nimport numpy as np\ninput = stdin.readline\nN = int(input())\nA = list(map(int,input().split()))\nnp_A = np.array(A)\nans = np_A[0]\n\n2\nfor i in range(1, N, 1):\n ans = ans*np_A[i]\n if ans > 10**18:\n flag = False\n break\n\n\nif flag == False:\n print(-1)\n\nelse:\n print(ans)\n', '# -*- coding: utf-8 -*-\nfrom sys import stdin\nfrom decimal import *\nimport numpy as np\ninput = stdin.readline\nN = int(input())\nA = list(map(Decimal,input().split()))\nnp_A = np.array(A)\nans = np_A[0]\n\nzero_flag = False\nif 0 in A:\n zero_flag = True\n\nflag = True\n\nfor i in range(1, N, 1):\n ans = Decimal(ans)*Decimal(np_A[i])\n #print(ans)\n if ans > 10**18:\n flag = False\n break\n\n\nif zero_flag == True:\n print(0)\n\n\nelse:\n if flag == False:\n print(-1)\n\n else:\n print(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s238812300', 's987030971'] | [40376.0, 47624.0] | [172.0, 270.0] | [335, 516] |
p02658 | u511268447 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['from sys import stdin\ninput = sys.stdin\n\nn = int(input())\naa = list(map(int, input().split()))\nif 0 in aa:\n print(0)\n exit()\nans = 1\nfor a in aa:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)', 'from sys import stdin\ninput = stdin\n\nn = int(input())\naa = list(map(int, input().split()))\nif 0 in aa:\n print(0)\n exit()\nans = 1\nfor a in aa:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n', 'from sys import stdin\ninput = stdin.readline\n\nn = int(input())\naa = list(map(int, input().split()))\nif 0 in aa:\n print(0)\n exit()\nans = 1\nfor a in aa:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s515654726', 's896932930', 's807878967'] | [9120.0, 9052.0, 21900.0] | [23.0, 24.0, 50.0] | [213, 210, 219] |
p02658 | u511501183 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\nN = int(input())\nA = [int(a) for a in input().split()]\n\nif 0 in A:\n print(0)\n exit()\n\nfor a in A:\n if a >= 10**18:\n print(-1)\n exit()\n\nans = np.prod(A, dtype=np.uint64)\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'import numpy as np\nN = int(input())\nA = [int(a) for a in input().split()]\n\nif 0 in A:\n print(0)\n exit()\n\nans = np.prod(A)\nif ans >= 10**18:\n print(-1)\nelse:\n print(ans)', 'import numpy as np\nN = int(input())\nA = [int(a) for a in input().split()]\nans = A[0]\n\nfor i in range(1, len(A)):\n if A[i] != 1:\n ans *= A[i]\n elif A[i] == 0:\n print(0)\n exit()\n if ans >= 10**18:\n print(-1)\n exit()\n\nprint(ans)', 'import numpy as np\nN = int(input())\nA = [int(a) for a in input().split()]\nans = A[0]\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(1, len(A)):\n if A[i] != 1:\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s451907786', 's979441655', 's994890505', 's475757508'] | [40312.0, 40136.0, 40300.0, 40092.0] | [137.0, 142.0, 138.0, 144.0] | [263, 180, 269, 253] |
p02658 | u511870776 | 2,000 | 1,048,576 | 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())\ni = 1\nif 0 in a:\n print(0)\n exit()\n\nfor x in a:\n i *= x\n if i > 1000000000000000000:\n break\n elif i == 0:\n break\n\nif i > 1000000000000000000:\n i = -1\nprint(i)', 'open Batteries\nlet n = read_int ()\nlet a = read_line () \nlet a2 = a |> String.split_on_char \' \' |> List.map int_of_string\nlet rec loop lst r=\n match lst with\n | [] -> r\n | first :: rest ->\n if List.mem 0 a2 then 0 else\n if first <> 1 && 1000000000000000000 / 2 <= r then -1 else\n loop rest (r*first)\n\nlet l = loop a2 1\nlet _ = l |> Printf.printf "%d\\n"', 'n = int(input())\na = list(map(int, input().split()))\ni = 1\nif 0 in a:\n print(0)\n exit()\n\nfor x in a:\n i *= x\n if i > 10 ** 18:\n break\n\n\nif i > 10 ** 18:\n i = -1\nprint(i)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s062700596', 's332453919', 's417231051'] | [19520.0, 9016.0, 21772.0] | [47.0, 24.0, 49.0] | [217, 364, 177] |
p02658 | u513858037 | 2,000 | 1,048,576 | 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\nif(ans > 10^18):\n ans = -1\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 *= a[i]\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s474437017', 's200776627'] | [21612.0, 21512.0] | [2206.0, 50.0] | [138, 195] |
p02658 | u514687406 | 2,000 | 1,048,576 | 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~~ Author : Bhaskar\n~~ Dated : 13~06~2020\n"""\n\nimport sys\nfrom bisect import *\nfrom math import floor, sqrt, ceil, factorial as F, gcd, pi\nfrom itertools import chain, combinations, permutations, accumulate\nfrom collections import Counter, defaultdict, OrderedDict, deque\n\nINT_MAX = sys.maxsize\nINT_MIN = -(sys.maxsize) - 1\nmod = 1000000007\nch = "abcdefghijklmnopqrstuvwxyz"\nlcm = lambda a, b: (a * b) // gcd(a, b)\nsetbit = lambda x: bin(x)[2:].count("1")\nINT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace("\\n", "")\nARRAY = lambda type: list(map(type, sys.stdin.readline().split()))\nNUMS = lambda type: map(type, sys.stdin.readline().split())\n\n\ndef solve():\n\n n = INT(int)\n a = ARRAY(int)\n if 0 in a:\n print(0)\n else:\n p = 1\n ok = False\n for i in a:\n a *= i\n if a > 10**18:\n ok = True\n break\n print(a if not ok else -1)\n\n\n\nif __name__ == "__main__":\n try:\n sys.stdin = open("input.txt", "r")\n except:\n pass\n solve()\n', '"""\n~~ Author : Bhaskar\n~~ Dated : 13~06~2020\n"""\n\nimport sys\nfrom bisect import *\nfrom math import floor, sqrt, ceil, factorial as F, gcd, pi\nfrom itertools import chain, combinations, permutations, accumulate\nfrom collections import Counter, defaultdict, OrderedDict, deque\n\nINT_MAX = sys.maxsize\nINT_MIN = -(sys.maxsize) - 1\nmod = 1000000007\nch = "abcdefghijklmnopqrstuvwxyz"\nlcm = lambda a, b: (a * b) // gcd(a, b)\nsetbit = lambda x: bin(x)[2:].count("1")\nINT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace("\\n", "")\nARRAY = lambda type: list(map(type, sys.stdin.readline().split()))\nNUMS = lambda type: map(type, sys.stdin.readline().split())\n\n\ndef solve():\n\n n = INT(int)\n a = ARRAY(int)\n if 0 in a:\n print(0)\n return\n p = 1\n for i in a:\n a *= i\n if a > 10**18:\n print(-1)\n return \n print(a)\n\n\n\nif __name__ == "__main__":\n try:\n sys.stdin = open("input.txt", "r")\n except:\n pass\n solve()\n', '"""\n~~ Author : Bhaskar\n~~ Dated : 13~06~2020\n"""\n\nimport sys\nfrom bisect import *\nfrom math import floor, sqrt, ceil, factorial as F, gcd, pi\nfrom itertools import chain, combinations, permutations, accumulate\nfrom collections import Counter, defaultdict, OrderedDict, deque\n\nINT_MAX = sys.maxsize\nINT_MIN = -(sys.maxsize) - 1\nmod = 1000000007\nch = "abcdefghijklmnopqrstuvwxyz"\nlcm = lambda a, b: (a * b) // gcd(a, b)\nsetbit = lambda x: bin(x)[2:].count("1")\nINT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace("\\n", "")\nARRAY = lambda type: list(map(type, sys.stdin.readline().split()))\nNUMS = lambda type: map(type, sys.stdin.readline().split())\n\n\ndef solve():\n\n n = INT(int)\n a = ARRAY(int)\n if 0 in a:\n print(0)\n else:\n p = 1\n ok = False\n for i in a:\n p *= i\n if p > 10**18:\n ok = True\n break\n print(p if not ok else -1)\n\n\n\nif __name__ == "__main__":\n # try:\n \n # except:\n \n solve()\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s439822046', 's705213771', 's898920158'] | [32464.0, 32272.0, 22684.0] | [53.0, 57.0, 50.0] | [1102, 1044, 1110] |
p02658 | u514894322 | 2,000 | 1,048,576 | 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*l, = map(int,input().split())\nans = 1\nfor i in l:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nif 0 in ;:\n ans = 0\nprint(ans)\n', 'n = int(input())\n*l, = map(int,input().split())\nans = 1\nfor i in l:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\nif 0 in l:\n ans = 0\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s596126105', 's580541108'] | [8980.0, 21604.0] | [27.0, 56.0] | [153, 153] |
p02658 | u515052479 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\nn = int(input())\na = np.array(list(map(int,input().split())))\nb = np.sqrt(a)\n\nlim = 10**9\nans_1 = np.prod(b)\nans = np.prod(a)\n\nif ans_1 > lim:\n ans = -1\nelif ans_1 < 0:\n ans = -1\n \nif ans > lim:\n ans = -1\nelif ans < 0:\n ans = -1\n \nprint(ans)', 'import numpy as np\nn = int(input())\na = np.array(list(map(int,input().split())))\nlim = 10**18\nans = np.prod(a)\n \nif ans >= lim:\n ans = -1\n \nprint(ans)', 'import numpy as np\nn = int(input())\na = np.array(list(map(int,input().split())))\nb = np.sqrt(a)\n\nlim = 10**9\nlim_1 = 10**18\nans_1 = np.prod(b)\nans = np.prod(a)\n\nif ans_1 > lim:\n ans = -1\nelif ans_1 < 0:\n ans = -1\n \nif ans > lim_1:\n ans = -1\nelif ans < 0:\n ans = -1\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s057273030', 's707906303', 's320611538'] | [40132.0, 40260.0, 39908.0] | [139.0, 142.0, 144.0] | [268, 154, 285] |
p02658 | u515172797 | 2,000 | 1,048,576 | 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(input().split())\nfor i in range(N):\n A[i] = int(A[i])\nsum = 1\n\nfor i in range(N):\n if sum <= 10**18:\n sum = sum * A[i]\n else:\n break:\n\nif sum <= 10**18:\n print(sum)\nelse:\n print(-1)', 'N = int(input())\nA = list(input().split())\nflag = 0\nfor i in range(N):\n A[i] = int(A[i])\n if A[i] == 0:\n flag = -1\nsum = 1\n\nfor i in range(N):\n if sum <= 10**18:\n sum = sum * A[i]\n else:\n break\n\n\nif sum <= 10**18:\n print(sum)\nelse:\n if flag == -1:\n print(0)\n else:\n print(-1)'] | ['Runtime Error', 'Accepted'] | ['s161506348', 's058965399'] | [9032.0, 19400.0] | [21.0, 67.0] | [236, 331] |
p02658 | u516494592 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import math\n\nN = int(input())\nA_list = list(map(int, input().split()))\n\nn = 1\nfor i in A_list:\n n = n * i\n\nif n == 0:\n print(n)\nelif math.log10(n) >= 18:\n print(-1)\nelse:\n print(n)\n ', 'import math\nfrom operator import mul\nfrom functools import reduce\n\nN = int(input())\nA_list = list(map(int, input().split()))\n\nn = reduce(mul, A_list)\n\nif n == 0:\n print(n)\nelif math.log10(n) >= 18:\n print(-1)\nelse:\n print(n)', 'import math\n\nN = int(input())\nA_list = list(map(int, input().split()))\n\nn = 1\nfor i in A_list:\n n = n * i\n if math.log10(n) >= 18:\n print(-1)\n break\nelse:\n print(n)', 'import math\n\nN = int(input())\nA_list = list(map(int, input().split()))\n\nn = 1\nfor i in A_list:\n if 0 in A_list:\n print(0)\n break\n n = n * i\n if math.log10(n) >= 18:\n print(-1)\n break\nelse:\n print(n)', 'N = int(input())\nA_list = list(map(int, input().split()))\nA_list.sort(reverse=True)\nn = 1\nfor i in A_list:\n if A_list[-1] == 0:\n print(0)\n break\n n = n * i\n if n > 1000000000000000000:\n print(-1)\n break\nelse:\n print(n)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s299419475', 's532634753', 's752089482', 's880871512', 's866164326'] | [21900.0, 22624.0, 22504.0, 22640.0, 21644.0] | [2206.0, 2206.0, 47.0, 2206.0, 75.0] | [187, 227, 173, 214, 234] |
p02658 | u516554284 | 2,000 | 1,048,576 | 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=ans*i\n if str(ans)>18:\n ans=-1\n break\n \nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\n\nans=1\nfor i in a:\n ans=ans*i\n if len(str(ans))>18:\n ans=-1\n break\n \nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split()))\n\nans=1\nfor i in a:\n ans=ans*i\n if len(str(ans))>18:\n ans=-1\n break\n \nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\n\nans=1\nfor i in a:\n ans=ans*i\n if ans>(10**18):\n ans=-1\n break\n \nprint(ans)\n'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s056720125', 's091729567', 's475207678', 's807781377'] | [21772.0, 21692.0, 21632.0, 21692.0] | [56.0, 108.0, 69.0, 94.0] | [133, 148, 139, 144] |
p02658 | u516579758 | 2,000 | 1,048,576 | 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()))\nresult=1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n result*=i\n if result>10**18:\n print(-1)\n break\n if result<=10**18:\n print(result)', 'n=int(input())\na=list(map(int,input().split()))\nresult=1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n result*=i\n if result>10*18:\n print(-1)\n if result>10**18:\n print(-1)\n else:\n print(result)', 'n=int(input())\na=list(map(int,input().split()))\nresult=1\nif 0 in a:\n print(0)\nelse:\n for i in a:\n result*=i\n if result>10**18:\n print(-1)\n break\n if result<=10**18:\n print(result)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s773372741', 's983593822', 's964007747'] | [9128.0, 21616.0, 21396.0] | [24.0, 2206.0, 50.0] | [216, 239, 233] |
p02658 | u517152997 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['#\nimport sys\nimport math\nimport numpy as np\nimport itertools\n\nn = int(input())\na=1\nll = [int(i) for i in input().split()] \nprint(ll)\nfor i in range(n):\n a *= ll[i]\nif a > 10**18:\n print(-1)\nelse:\n print(a)\n\n', '#\nimport sys\nimport math\nimport numpy as np\nimport itertools\n\nn = int(input())\na=1\nll = [int(i) for i in input().split()] \nll.sort()\n\nfor i in range(n):\n a *= ll[i]\n if a == 0:\n print(0)\n exit()\n if a > 10**18:\n print(-1)\n exit()\nelse:\n print(a)\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s540707807', 's307928132'] | [40040.0, 40104.0] | [2207.0, 169.0] | [216, 288] |
p02658 | u517630860 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ["# -*- coding: utf-8 -*-\nN = int(input())\nnumlist = list(map(int, input().split()))\nif 0 < numlist.count(0):\n print('0')\n quit()\n\ntotal = 1\nfor i in numlist:\n total *= abs(i)\n if 10 ** 18 < total:\n print('-1')\n quit()\n\nprint(sign * total) ", "# -*- coding: utf-8 -*-\nN = int(input())\nnumlist = list(map(int, input().split()))\nif 0 < numlist.count(0):\n print('0')\n quit()\n\ntotal = 1\nfor i in numlist:\n total *= abs(i)\n\nif 10 ** 18 < total:\n print('-1')\nelse:\n print(sign * total) ", "# -*- coding: utf-8 -*-\nN = int(input())\nnumlist = list(map(int, input().split()))\nif 0 < numlist.count(0):\n print('0')\n quit()\n\ntotal = 1\nfor i in numlist:\n total *= i\n if 10 ** 18 < total:\n print('-1')\n quit()\n\nprint(total) "] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s112845472', 's214228777', 's103263351'] | [21656.0, 21640.0, 21656.0] | [53.0, 2206.0, 51.0] | [252, 245, 240] |
p02658 | u517674755 | 2,000 | 1,048,576 | 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()))\ni = 0\nans = 0\nif 0 in a:\n print(0)\nelse:\n while ans<10**10 and i<len(a):\n ans*=a[i]\n if (ans<=10**18):\n print(ans)\n else:\n print(-1)\n', 'i = 0\nans = 1\nn = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n while ans<10**18 and i<len(a):\n ans*=a[i]\n i+=1\n if (ans<=10**18):\n print(ans)\n else:\n print(-1)'] | ['Time Limit Exceeded', 'Accepted'] | ['s667046938', 's476603858'] | [21480.0, 21492.0] | [2206.0, 58.0] | [219, 231] |
p02658 | u518085378 | 2,000 | 1,048,576 | 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()))\nfor i, a in enumerate(A):\n if i == 0:\n ans = a\n if ans > 10**18:\n print(-1)\n exit()\n else:\n ans = ans*a\nif ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n', 'n = int(input())\nA = list(map(int, input().split()))\nif A.count(0) != 0:\n print(0)\n exit()\nfor i, a in enumerate(A):\n if i == 0:\n ans = a\n elif ans > 10**18:\n print(-1)\n exit()\n else:\n ans = ans*a\nif ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s281422959', 's520065582'] | [21684.0, 21612.0] | [51.0, 51.0] | [247, 293] |
p02658 | u518890245 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['\nN = int(input())\nA = list(map(int, input().split()))\n\nR=1\nif 0 in A:\n print("0")\nelse:\n for i in range(0, N):\n R=R*A[i]\n if R>1000000000000000000:\n print("-1")\n exit()\n else:\n print(R)\n', '\nN = int(input())\nA = list(map(int, input().split()))\n\nR=1\nif 0 in A:\n print("0")\nelse:\n for i in range(0, N):\n R=R*A[i]\n if R>1000000000000000000:\n print("-1")\n exit()\n else:\n print(R)\n', '\nN = int(input())\nA = list(map(int, input().split()))\n\nR=1\nif 0 in A:\n print("0")\nelse:\n for i in range(0, N):\n R=R*A[i]\n if R>1000000000000000000:\n print("-1")\n exit()\n \n print(R)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s333368674', 's778589650', 's211937986'] | [21704.0, 21560.0, 21628.0] | [86.0, 85.0, 59.0] | [246, 246, 232] |
p02658 | u519832983 | 2,000 | 1,048,576 | Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead. | ['import numpy as np\nN = int(input())\n\nA = list(map(int, input().split()))\nse = 1\nfor n in range(N):\n se *= A[n]\nif se >= 10**18:\n print("-1")\nelse:\n print(se)', 'import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\nse = 1\nc = True\nfor n in range(N):\n se *= A[n]\n if se > 10**18:\n c = False\n break\nfor n in range(N):\n if A[n] == 0:\n se = 0\n c = True\nif c:\n print(se)\nelse:\n print("-1")'] | ['Wrong Answer', 'Accepted'] | ['s671134522', 's780552260'] | [40028.0, 40176.0] | [2206.0, 138.0] | [161, 259] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.