node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
13,
17,
29,
41,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
13,
2,
13,
13,
0,
13,
13,
30,
4,
18,
13,
40,
17,
29,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
13,
42,
2,
13,
17,
30,
14,
2,
2,
13,
17,
17,
0,
13,
2,
2,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
0,
13,
17,
0,
13,
2,
2,
13,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
20,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
382,
8
],
[
382,
9
],
[
9,
10
],
[
9,
11
],
[
382,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
20,
22
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
14,
56
],
[
56,
57
],
[
56,
58
],
[
14,
59
],
[
59,
60
],
[
59,
61
],
[
14,
62
],
[
62,
63
],
[
62,
64
],
[
62,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
76,
82
],
[
14,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
12,
87
],
[
87,
88
],
[
12,
89
],
[
89,
90
],
[
12,
91
],
[
91,
92
],
[
382,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
95,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
106,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
106,
127
],
[
127,
128
],
[
127,
129
],
[
95,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
95,
137
],
[
137,
138
],
[
93,
139
],
[
139,
140
],
[
93,
141
],
[
141,
142
],
[
382,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
149,
151
],
[
145,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
157,
159
],
[
152,
160
],
[
160,
161
],
[
161,
162
],
[
152,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
145,
168
],
[
168,
169
],
[
169,
170
],
[
143,
171
],
[
171,
172
],
[
0,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
173,
177
],
[
177,
178
],
[
177,
179
],
[
173,
181
],
[
181,
182
],
[
173,
183
],
[
183,
184
],
[
173,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
188,
192
],
[
185,
193
],
[
193,
194
],
[
173,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
198,
203
],
[
203,
204
],
[
197,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
213,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
222,
225
],
[
209,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
230,
231
],
[
231,
232
],
[
197,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
173,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
245,
243
],
[
255,
244
],
[
252,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
245,
249
],
[
249,
250
],
[
249,
251
],
[
252,
252
],
[
252,
253
],
[
252,
254
],
[
255,
255
],
[
255,
256
],
[
255,
257
],
[
245,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
238,
262
],
[
262,
263
],
[
173,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
267,
268
],
[
269,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
273,
275
],
[
269,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
264,
280
],
[
280,
281
],
[
173,
282
],
[
282,
283
],
[
282,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
286,
289
],
[
289,
290
],
[
173,
291
],
[
291,
292
],
[
291,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
295,
298
],
[
298,
299
],
[
173,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
303,
304
],
[
304,
305
],
[
305,
306
],
[
304,
307
],
[
307,
308
],
[
173,
309
],
[
309,
310
],
[
309,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
314,
315
],
[
311,
316
],
[
316,
317
],
[
317,
318
],
[
317,
319
],
[
316,
320
],
[
320,
321
],
[
320,
322
],
[
322,
323
],
[
311,
324
],
[
324,
325
],
[
324,
326
],
[
311,
327
],
[
327,
328
],
[
328,
329
],
[
329,
330
],
[
329,
331
],
[
327,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
333,
336
],
[
332,
337
],
[
337,
338
],
[
337,
339
],
[
339,
340
],
[
311,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
173,
345
],
[
345,
346
],
[
345,
347
],
[
347,
348
],
[
348,
349
],
[
348,
350
],
[
350,
351
],
[
347,
352
],
[
352,
353
],
[
353,
354
],
[
353,
355
],
[
352,
356
],
[
356,
357
],
[
356,
358
],
[
358,
359
],
[
347,
360
],
[
360,
361
],
[
360,
362
],
[
347,
363
],
[
363,
364
],
[
364,
365
],
[
365,
366
],
[
365,
367
],
[
363,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
369,
372
],
[
368,
373
],
[
373,
374
],
[
373,
375
],
[
375,
376
],
[
347,
377
],
[
377,
378
],
[
378,
379
],
[
379,
380
],
[
0,
381
],
[
381,
382
],
[
381,
383
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n\n private static final int M = 1_000_000_007;\n\n public Main(FastScanner in, PrintWriter out, int test) {\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }\n\n private long pow(int x, int p) {\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }\n\n public static void main(String[] args) {\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }\n}\n\n\nclass FastScanner{\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream)\n {\n this.stream = stream;\n }\n\n int read()\n {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars){\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n boolean isSpaceChar(int c)\n {\n return c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1;\n }\n\n boolean isEndline(int c)\n {\n return c=='\\n'||c=='\\r'||c==-1;\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String next(){\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isSpaceChar(c));\n return res.toString();\n }\n\n String nextLine(){\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isEndline(c));\n return res.toString();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n private static final int M = 1_000_000_007;\n\n public Main(FastScanner in, PrintWriter out, int test) {\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }\n\n private long pow(int x, int p) {\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }\n\n public static void main(String[] args) {\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }\n}",
"Main",
"private static final int M = 1_000_000_007;",
"M",
"1_000_000_007",
"public Main(FastScanner in, PrintWriter out, int test) {\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }",
"Main",
"{\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }",
"{\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }",
"a[i] = in.nextLong()",
"a[i]",
"a",
"i",
"in.nextLong()",
"in.nextLong",
"in",
"if (a[i] == 0) {\n out.println(0);\n return;\n }",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n out.println(0);\n return;\n }",
"out.println(0)",
"out.println",
"out",
"0",
"return;",
"final long limit = (long)1e18;",
"limit",
"(long)1e18",
"long prod = 1;",
"prod",
"1",
"for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }",
"long x",
"a",
"{\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }",
"{\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }",
"if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }",
"x <= limit / prod",
"x",
"limit / prod",
"limit",
"prod",
"prod *= x",
"prod",
"x",
"{\n out.println(-1);\n return;\n }",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"return;",
"out.println(prod)",
"out.println",
"out",
"prod",
"FastScanner in",
"in",
"PrintWriter out",
"out",
"int test",
"test",
"private long pow(int x, int p) {\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }",
"pow",
"{\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }",
"long res = 1",
"res",
"1",
"a = x;",
"a",
"x",
"while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }",
"p > 1",
"p",
"1",
"{\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }",
"if (p % 2 == 1)\n res = res * a % M;",
"p % 2 == 1",
"p % 2",
"p",
"2",
"1",
"res = res * a % M",
"res",
"res * a % M",
"res * a",
"res",
"a",
"M",
"a = a * a % M",
"a",
"a * a % M",
"a * a",
"a",
"a",
"M",
"p /= 2",
"p",
"2",
"res = res * a % M",
"res",
"res * a % M",
"res * a",
"res",
"a",
"M",
"return res;",
"res",
"int x",
"x",
"int p",
"p",
"public static void main(String[] args) {\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }",
"main",
"{\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"FastScanner in = new FastScanner(System.in);",
"in",
"new FastScanner(System.in)",
"for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }",
"int t = 1;",
"int t = 1;",
"t",
"1",
"t <= 1",
"t",
"1",
"t++",
"t++",
"t",
"{\n Main sol = new Main(in, out, t);\n }",
"{\n Main sol = new Main(in, out, t);\n }",
"Main sol = new Main(in, out, t);",
"sol",
"new Main(in, out, t)",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"class FastScanner{\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream)\n {\n this.stream = stream;\n }\n\n int read()\n {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars){\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n boolean isSpaceChar(int c)\n {\n return c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1;\n }\n\n boolean isEndline(int c)\n {\n return c=='\\n'||c=='\\r'||c==-1;\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String next(){\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isSpaceChar(c));\n return res.toString();\n }\n\n String nextLine(){\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isEndline(c));\n return res.toString();\n }\n}",
"FastScanner",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"public FastScanner(InputStream stream)\n {\n this.stream = stream;\n }",
"FastScanner",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"int read()\n {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars){\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"read",
"{\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars){\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"if (numChars == -1)\n throw new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars){\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try{\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0)\n return -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"boolean isSpaceChar(int c)\n {\n return c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1;\n }",
"isSpaceChar",
"{\n return c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1;\n }",
"return c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1;",
"c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1",
"c=='\\t'",
"c=='\\r'",
"c==' '||c=='\\n'||c=='\\r'||c=='\\t'||c==-1",
"c==' '",
"c",
"' '",
"c=='\\n'",
"c",
"'\\n'",
"c=='\\r'",
"c",
"'\\r'",
"c=='\\t'",
"c",
"'\\t'",
"c==-1",
"c",
"-1",
"1",
"int c",
"c",
"boolean isEndline(int c)\n {\n return c=='\\n'||c=='\\r'||c==-1;\n }",
"isEndline",
"{\n return c=='\\n'||c=='\\r'||c==-1;\n }",
"return c=='\\n'||c=='\\r'||c==-1;",
"c=='\\n'||c=='\\r'||c==-1",
"c=='\\n'||c=='\\r'||c==-1",
"c=='\\n'",
"c",
"'\\n'",
"c=='\\r'",
"c",
"'\\r'",
"c==-1",
"c",
"-1",
"1",
"int c",
"c",
"int nextInt()\n {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong()\n {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble()\n {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String next(){\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isSpaceChar(c));\n return res.toString();\n }",
"next",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isSpaceChar(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do{\n res.appendCodePoint(c);\n c = read();\n }while(!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"String nextLine(){\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isEndline(c));\n return res.toString();\n }",
"nextLine",
"{\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do{\n res.appendCodePoint(c);\n c = read();\n }while(!isEndline(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isEndline(c))\n c = read();",
"isEndline(c)",
"isEndline",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do{\n res.appendCodePoint(c);\n c = read();\n }while(!isEndline(c));",
"!isEndline(c)",
"isEndline(c)",
"isEndline",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public class Main {\n\n private static final int M = 1_000_000_007;\n\n public Main(FastScanner in, PrintWriter out, int test) {\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }\n\n private long pow(int x, int p) {\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }\n\n public static void main(String[] args) {\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }\n}",
"public class Main {\n\n private static final int M = 1_000_000_007;\n\n public Main(FastScanner in, PrintWriter out, int test) {\n int n = in.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = in.nextLong();\n if (a[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n final long limit = (long)1e18;\n long prod = 1;\n for (long x : a) {\n if (x <= limit / prod)\n prod *= x;\n else {\n out.println(-1);\n return;\n }\n }\n out.println(prod);\n }\n\n private long pow(int x, int p) {\n long res = 1, a = x;\n while (p > 1) {\n if (p % 2 == 1)\n res = res * a % M;\n\n a = a * a % M;\n p /= 2;\n }\n res = res * a % M;\n return res;\n }\n\n public static void main(String[] args) {\n PrintWriter out = new PrintWriter(System.out);\n // Scanner in = new Scanner(\n // new BufferedReader(new InputStreamReader(System.in)));\n FastScanner in = new FastScanner(System.in);\n\n // int T = in.nextInt();\n for (int t = 1; t <= 1; t++) {\n Main sol = new Main(in, out, t);\n }\n\n out.close();\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
private static final int M = 1_000_000_007;
public Main(FastScanner in, PrintWriter out, int test) {
int n = in.nextInt();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = in.nextLong();
if (a[i] == 0) {
out.println(0);
return;
}
}
final long limit = (long)1e18;
long prod = 1;
for (long x : a) {
if (x <= limit / prod)
prod *= x;
else {
out.println(-1);
return;
}
}
out.println(prod);
}
private long pow(int x, int p) {
long res = 1, a = x;
while (p > 1) {
if (p % 2 == 1)
res = res * a % M;
a = a * a % M;
p /= 2;
}
res = res * a % M;
return res;
}
public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.out);
// Scanner in = new Scanner(
// new BufferedReader(new InputStreamReader(System.in)));
FastScanner in = new FastScanner(System.in);
// int T = in.nextInt();
for (int t = 1; t <= 1; t++) {
Main sol = new Main(in, out, t);
}
out.close();
}
}
class FastScanner{
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public FastScanner(InputStream stream)
{
this.stream = stream;
}
int read()
{
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars){
curChar = 0;
try{
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
boolean isSpaceChar(int c)
{
return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
}
boolean isEndline(int c)
{
return c=='\n'||c=='\r'||c==-1;
}
int nextInt()
{
return Integer.parseInt(next());
}
long nextLong()
{
return Long.parseLong(next());
}
double nextDouble()
{
return Double.parseDouble(next());
}
String next(){
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do{
res.appendCodePoint(c);
c = read();
}while(!isSpaceChar(c));
return res.toString();
}
String nextLine(){
int c = read();
while (isEndline(c))
c = read();
StringBuilder res = new StringBuilder();
do{
res.appendCodePoint(c);
c = read();
}while(!isEndline(c));
return res.toString();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
17,
17,
41,
13,
20,
13,
41,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
4,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
133,
8
],
[
133,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
25,
29
],
[
11,
30
],
[
30,
31
],
[
30,
32
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
68,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
88,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
99,
105
],
[
98,
106
],
[
97,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
107,
114
],
[
97,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
11,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
9,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] |
[
"import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }\n}\n",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));",
"dMax",
"BigInteger.valueOf((long)Math.pow(10, 18))",
"BigInteger.valueOf",
"BigInteger",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"BigInteger mul = BigInteger.ONE;",
"mul",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"BigInteger tmp = null;",
"tmp",
"null",
"for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }",
"{\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n System.out.println(\"0\");\n return ;\n }",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"return ;",
"for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }",
"{\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }",
"tmp = BigInteger.valueOf(a[i])",
"tmp",
"BigInteger.valueOf(a[i])",
"BigInteger.valueOf",
"BigInteger",
"a[i]",
"a",
"i",
"if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }",
"mul.multiply(tmp).compareTo(dMax) > 0",
"mul.multiply(tmp).compareTo(dMax)",
"mul.multiply(tmp).compareTo",
"mul.multiply(tmp)",
"mul.multiply",
"mul",
"tmp",
"dMax",
"0",
"{\n System.out.println(\"-1\");\n return ;\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"return ;",
"{\n mul = mul.multiply(tmp);\n }",
"mul = mul.multiply(tmp)",
"mul",
"mul.multiply(tmp)",
"mul.multiply",
"mul",
"tmp",
"System.out.println(mul.toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"mul.toString()",
"mul.toString",
"mul",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int n = sc.nextInt();\n\n \n BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));\n\n long[] a = new long[n];\n BigInteger mul = BigInteger.ONE;\n BigInteger tmp = null;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n\n if (a[i] == 0) {\n System.out.println(\"0\");\n return ;\n }\n }\n\n for(int i=0;i<n;i++){\n\n tmp = BigInteger.valueOf(a[i]);\n if (mul.multiply(tmp).compareTo(dMax) > 0 ) {\n System.out.println(\"-1\");\n return ;\n } else {\n mul = mul.multiply(tmp);\n }\n }\n\n System.out.println(mul.toString());\n }\n}",
"Main"
] |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int n = sc.nextInt();
BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));
long[] a = new long[n];
BigInteger mul = BigInteger.ONE;
BigInteger tmp = null;
for(int i=0;i<n;i++){
a[i] = sc.nextLong();
if (a[i] == 0) {
System.out.println("0");
return ;
}
}
for(int i=0;i<n;i++){
tmp = BigInteger.valueOf(a[i]);
if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
System.out.println("-1");
return ;
} else {
mul = mul.multiply(tmp);
}
}
System.out.println(mul.toString());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
17,
13,
30,
0,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
8,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
73,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
87,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long A[] = new long[N];",
"A",
"new long[N]",
"N",
"for (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"A[i] = scan.nextLong()",
"A[i]",
"A",
"i",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans = A[0];",
"ans",
"A[0]",
"A",
"0",
"for (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"A[i] <= (1000000000000000000L / ans)",
"A[i]",
"A",
"i",
"(1000000000000000000L / ans)",
"1000000000000000000L",
"ans",
"{\n\t\t\t\tans *= A[i];\n\t\t\t}",
"ans *= A[i]",
"ans",
"A[i]",
"A",
"i",
"{\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint N = scan.nextInt();\n\t\tlong A[] = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = scan.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\t// 0が含まれてたら終了\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong ans = A[0];\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= A[i];\n\t\t\t} else {\n\t\t\t\t// 10の18乗超えた\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
long A[] = new long[N];
for (int i = 0; i < N; i++) {
A[i] = scan.nextLong();
if (A[i] == 0) {
// 0が含まれてたら終了
System.out.println(0);
return;
}
}
long ans = A[0];
for (int i = 1; i < N; i++) {
if (A[i] <= (1000000000000000000L / ans)) {
ans *= A[i];
} else {
// 10の18乗超えた
System.out.println(-1);
return;
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
17,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
109,
5
],
[
109,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
23,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
71,
71
],
[
71,
72
],
[
71,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
68,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
78,
86
],
[
67,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
99,
105
],
[
6,
106
],
[
106,
107
],
[
0,
108
],
[
108,
109
],
[
108,
110
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] arr = new long[n];",
"arr",
"new long[n]",
"n",
"long h = (long)Math.pow(10,18);",
"h",
"(long)Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}",
"{\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}",
"arr[i]=sc.nextLong()",
"arr[i]",
"arr",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"long ans =1;",
"ans",
"1",
"for(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}",
"{\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}",
"if(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"ans*1.0*arr[i]>1e18",
"ans*1.0*arr[i]",
"ans*1.0*arr[i]",
"ans",
"1.0",
"arr[i]",
"arr",
"i",
"1e18",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"ans=ans*arr[i]",
"ans",
"ans*arr[i]",
"ans",
"arr[i]",
"arr",
"i",
"System.out.println(ans>(long)1e18 ? -1:ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans>(long)1e18 ? -1:ans",
"ans>(long)1e18",
"ans",
"(long)1e18",
"-1",
"1",
"ans",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] arr = new long[n];\n\t\tlong h = (long)Math.pow(10,18);\n\t\t//System.out.println(h);\n\t\t//int flag =0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=sc.nextLong();\n\t\t\t// if(arr[i]==0){\n\t\t\t// \tflag = 1;\n\t\t\t// }\n\t\t}\n\t\t//if(flag==0){\n\t\tArrays.sort(arr);\n\t\tlong ans =1;\n\t\tfor(int i=0;i<n;i++){\n\t\t\t//ans=ans*arr[i];\n\t\t\tif(ans*1.0*arr[i]>1e18){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans=ans*arr[i];\n\t\t}\n\t\tSystem.out.println(ans>(long)1e18 ? -1:ans);\n\t\t//}\n\t\t// else{\n\t\t// \tSystem.out.println(0);\n\t\t// }\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] arr = new long[n];
long h = (long)Math.pow(10,18);
//System.out.println(h);
//int flag =0;
for(int i=0;i<n;i++){
arr[i]=sc.nextLong();
// if(arr[i]==0){
// flag = 1;
// }
}
//if(flag==0){
Arrays.sort(arr);
long ans =1;
for(int i=0;i<n;i++){
//ans=ans*arr[i];
if(ans*1.0*arr[i]>1e18){
System.out.println(-1);
return;
}
ans=ans*arr[i];
}
System.out.println(ans>(long)1e18 ? -1:ans);
//}
// else{
// System.out.println(0);
// }
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
14,
13,
30,
4,
13,
17,
30,
41,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
40,
17,
3,
4,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
29,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
13,
2,
18,
13,
13,
17,
4,
13,
17,
23,
13,
12,
13,
30,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
12,
13,
30,
42,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
353,
8
],
[
353,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
11,
13
],
[
353,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
16,
18
],
[
353,
19
],
[
19,
20
],
[
19,
21
],
[
353,
22
],
[
22,
23
],
[
22,
24
],
[
353,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
27,
33
],
[
33,
34
],
[
33,
35
],
[
27,
37
],
[
37,
38
],
[
37,
39
],
[
27,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
27,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
76,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
88,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
100,
105
],
[
76,
106
],
[
106,
107
],
[
106,
108
],
[
27,
109
],
[
109,
110
],
[
110,
111
],
[
27,
112
],
[
112,
113
],
[
113,
114
],
[
25,
115
],
[
115,
116
],
[
353,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
119,
144
],
[
144,
145
],
[
117,
146
],
[
146,
147
],
[
353,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
150,
175
],
[
175,
176
],
[
148,
177
],
[
177,
178
],
[
353,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
191,
193
],
[
186,
194
],
[
194,
195
],
[
195,
196
],
[
186,
197
],
[
198,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
204,
205
],
[
181,
206
],
[
206,
207
],
[
179,
208
],
[
208,
209
],
[
353,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
213,
216
],
[
210,
217
],
[
217,
218
],
[
353,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
222,
225
],
[
219,
226
],
[
226,
227
],
[
353,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
231,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
238,
240
],
[
231,
241
],
[
241,
242
],
[
242,
243
],
[
231,
244
],
[
245,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
248,
252
],
[
230,
253
],
[
253,
254
],
[
253,
255
],
[
228,
256
],
[
256,
257
],
[
353,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
261,
264
],
[
265,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
266,
271
],
[
271,
272
],
[
271,
273
],
[
260,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
258,
279
],
[
279,
280
],
[
0,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
281,
285
],
[
285,
286
],
[
281,
287
],
[
287,
288
],
[
287,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
289,
293
],
[
293,
294
],
[
293,
295
],
[
281,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
299,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
298,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
281,
312
],
[
312,
313
],
[
312,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
316,
319
],
[
319,
320
],
[
281,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
324,
325
],
[
325,
326
],
[
326,
327
],
[
325,
328
],
[
328,
329
],
[
281,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
334,
337
],
[
337,
338
],
[
281,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
344,
345
],
[
281,
346
],
[
346,
347
],
[
346,
348
],
[
348,
349
],
[
349,
350
],
[
350,
351
],
[
0,
352
],
[
352,
353
],
[
352,
354
]
] |
[
"import java.io.*;\nimport java.util.*;\n\npublic class Main{\n\n public static void main(String[] args) throws IOException {\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }\n\n static int MIN = Integer.MIN_VALUE;\n static int MAX = Integer.MAX_VALUE;\n static Reader in = new Reader();\n static PrintWriter out = new PrintWriter(System.out);\n\n static int[] readInt(int N) throws IOException { \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }\n \n static long[] readLong(int N) throws IOException { \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }\n \n static String[] readString(int N) throws IOException { \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }\n \n static void print(Object O) { \n \tout.print(O); \n }\n \n static void println(Object O) { \n \tout.println(O); \n }\n \n static void println(int arr[]) { \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }\n \n static void debug(Object ... O) { \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }\n}\n\nclass Reader {\n BufferedReader reader;\n StringTokenizer tokenizer;\n\n Reader() {\n reader = new BufferedReader(new InputStreamReader(System.in));\n tokenizer = new StringTokenizer(\"\");\n }\n\n String next() throws IOException {\n while (!tokenizer.hasMoreTokens() ) { \n tokenizer = new StringTokenizer(reader.readLine()); \n }\n return tokenizer.nextToken();\n }\n\n int nextInt() throws IOException { \n return Integer.parseInt(next()); \n }\n \n double nextDouble() throws IOException { \n return Double.parseDouble(next());\n }\n \n long nextLong() throws IOException { \n return Long.parseLong(next()); \n }\n \n String nextLine() throws IOException { \n return reader.readLine(); \n }\n \n void close() throws IOException { \n reader.close(); \n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\n public static void main(String[] args) throws IOException {\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }\n\n static int MIN = Integer.MIN_VALUE;\n static int MAX = Integer.MAX_VALUE;\n static Reader in = new Reader();\n static PrintWriter out = new PrintWriter(System.out);\n\n static int[] readInt(int N) throws IOException { \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }\n \n static long[] readLong(int N) throws IOException { \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }\n \n static String[] readString(int N) throws IOException { \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }\n \n static void print(Object O) { \n \tout.print(O); \n }\n \n static void println(Object O) { \n \tout.println(O); \n }\n \n static void println(int arr[]) { \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }\n \n static void debug(Object ... O) { \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }\n}",
"Main",
"static int MIN = Integer.MIN_VALUE;",
"MIN",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"static int MAX = Integer.MAX_VALUE;",
"MAX",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"static Reader in = new Reader();",
"in",
"new Reader()",
"static PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"public static void main(String[] args) throws IOException {\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }",
"main",
"{\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }",
"int N = in.nextInt();",
"N",
"in.nextInt()",
"in.nextInt",
"in",
"long A[] = new long[N];",
"A",
"new long[N]",
"N",
"boolean zero = false;",
"zero",
"false",
"for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }",
"{\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }",
"A[i] = in.nextLong()",
"A[i]",
"A",
"i",
"in.nextLong()",
"in.nextLong",
"in",
"if(A[i] == 0){\n zero = true;\n }",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n zero = true;\n }",
"zero = true",
"zero",
"true",
"if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }",
"zero",
"{\n println(0);\n }",
"println(0)",
"println",
"0",
"{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }",
"long limit = (long) 1e18;",
"limit",
"(long) 1e18",
"long res = 1;",
"res",
"1",
"for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }",
"long a",
"A",
"{\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }",
"{\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }",
"if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }",
"a <= limit/res",
"a",
"limit/res",
"limit",
"res",
"{\n res = res * a;\n }",
"res = res * a",
"res",
"res * a",
"res",
"a",
"{\n res = -1;\n break;\n }",
"res = -1",
"res",
"-1",
"1",
"break;",
"println(res)",
"println",
"res",
"in.close()",
"in.close",
"in",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static int[] readInt(int N) throws IOException { \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }",
"readInt",
"{ \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }",
"int arr[] = new int[N];",
"arr",
"new int[N]",
"N",
"for(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{ \n \t\tarr[i] = in.nextInt(); \n \t}",
"{ \n \t\tarr[i] = in.nextInt(); \n \t}",
"arr[i] = in.nextInt()",
"arr[i]",
"arr",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"return arr;",
"arr",
"int N",
"N",
"static long[] readLong(int N) throws IOException { \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }",
"readLong",
"{ \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }",
"long arr[] = new long[N];",
"arr",
"new long[N]",
"N",
"for(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{ \n \t\tarr[i] = in.nextLong(); \n \t}",
"{ \n \t\tarr[i] = in.nextLong(); \n \t}",
"arr[i] = in.nextLong()",
"arr[i]",
"arr",
"i",
"in.nextLong()",
"in.nextLong",
"in",
"return arr;",
"arr",
"int N",
"N",
"static String[] readString(int N) throws IOException { \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }",
"readString",
"{ \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }",
"String arr[] = new String[N];",
"arr",
"new String[N]",
"N",
"for(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{ \n \t\tarr[i] = in.next(); \n \t}",
"{ \n \t\tarr[i] = in.next(); \n \t}",
"arr[i] = in.next()",
"arr[i]",
"arr",
"i",
"in.next()",
"in.next",
"in",
"return arr;",
"arr",
"int N",
"N",
"static void print(Object O) { \n \tout.print(O); \n }",
"print",
"{ \n \tout.print(O); \n }",
"out.print(O)",
"out.print",
"out",
"O",
"Object O",
"O",
"static void println(Object O) { \n \tout.println(O); \n }",
"println",
"{ \n \tout.println(O); \n }",
"out.println(O)",
"out.println",
"out",
"O",
"Object O",
"O",
"static void println(int arr[]) { \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }",
"println",
"{ \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }",
"for(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{ \n \t\tprint(arr[i] + \" \"); \n \t}",
"{ \n \t\tprint(arr[i] + \" \"); \n \t}",
"print(arr[i] + \" \")",
"print",
"arr[i] + \" \"",
"arr[i]",
"arr",
"i",
"\" \"",
"println(\"\")",
"println",
"\"\"",
"int arr[]",
"arr",
"static void debug(Object ... O) { \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }",
"debug",
"{ \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }",
"for(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}",
"Object obj",
"O",
"{\n \t\tSystem.out.print(obj + \" \");\n \t}",
"{\n \t\tSystem.out.print(obj + \" \");\n \t}",
"System.out.print(obj + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"obj + \" \"",
"obj",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"Object ... O",
"O",
"class Reader {\n BufferedReader reader;\n StringTokenizer tokenizer;\n\n Reader() {\n reader = new BufferedReader(new InputStreamReader(System.in));\n tokenizer = new StringTokenizer(\"\");\n }\n\n String next() throws IOException {\n while (!tokenizer.hasMoreTokens() ) { \n tokenizer = new StringTokenizer(reader.readLine()); \n }\n return tokenizer.nextToken();\n }\n\n int nextInt() throws IOException { \n return Integer.parseInt(next()); \n }\n \n double nextDouble() throws IOException { \n return Double.parseDouble(next());\n }\n \n long nextLong() throws IOException { \n return Long.parseLong(next()); \n }\n \n String nextLine() throws IOException { \n return reader.readLine(); \n }\n \n void close() throws IOException { \n reader.close(); \n }\n}",
"Reader",
"BufferedReader reader;",
"reader",
"StringTokenizer tokenizer;",
"tokenizer",
"Reader() {\n reader = new BufferedReader(new InputStreamReader(System.in));\n tokenizer = new StringTokenizer(\"\");\n }",
"Reader",
"{\n reader = new BufferedReader(new InputStreamReader(System.in));\n tokenizer = new StringTokenizer(\"\");\n }",
"reader = new BufferedReader(new InputStreamReader(System.in))",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"tokenizer = new StringTokenizer(\"\")",
"tokenizer",
"new StringTokenizer(\"\")",
"String next() throws IOException {\n while (!tokenizer.hasMoreTokens() ) { \n tokenizer = new StringTokenizer(reader.readLine()); \n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (!tokenizer.hasMoreTokens() ) { \n tokenizer = new StringTokenizer(reader.readLine()); \n }\n return tokenizer.nextToken();\n }",
"while (!tokenizer.hasMoreTokens() ) { \n tokenizer = new StringTokenizer(reader.readLine()); \n }",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{ \n tokenizer = new StringTokenizer(reader.readLine()); \n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"int nextInt() throws IOException { \n return Integer.parseInt(next()); \n }",
"nextInt",
"{ \n return Integer.parseInt(next()); \n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"double nextDouble() throws IOException { \n return Double.parseDouble(next());\n }",
"nextDouble",
"{ \n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"long nextLong() throws IOException { \n return Long.parseLong(next()); \n }",
"nextLong",
"{ \n return Long.parseLong(next()); \n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"String nextLine() throws IOException { \n return reader.readLine(); \n }",
"nextLine",
"{ \n return reader.readLine(); \n }",
"return reader.readLine();",
"reader.readLine()",
"reader.readLine",
"reader",
"void close() throws IOException { \n reader.close(); \n }",
"close",
"{ \n reader.close(); \n }",
"reader.close()",
"reader.close",
"reader",
"public class Main{\n\n public static void main(String[] args) throws IOException {\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }\n\n static int MIN = Integer.MIN_VALUE;\n static int MAX = Integer.MAX_VALUE;\n static Reader in = new Reader();\n static PrintWriter out = new PrintWriter(System.out);\n\n static int[] readInt(int N) throws IOException { \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }\n \n static long[] readLong(int N) throws IOException { \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }\n \n static String[] readString(int N) throws IOException { \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }\n \n static void print(Object O) { \n \tout.print(O); \n }\n \n static void println(Object O) { \n \tout.println(O); \n }\n \n static void println(int arr[]) { \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }\n \n static void debug(Object ... O) { \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }\n}",
"public class Main{\n\n public static void main(String[] args) throws IOException {\n int N = in.nextInt();\n long A[] = new long[N];\n boolean zero = false;\n for(int i = 0; i < N; i++){\n A[i] = in.nextLong();\n if(A[i] == 0){\n zero = true;\n }\n }\n \n if(zero){\n println(0);\n }\n else{\n /*\n curr = prev * a[i]\n curr <= 1e18\n prev * a[i] <= 1e18\n a[i] <= 1e18/prev\n */\n\n long limit = (long) 1e18;\n long res = 1;\n for(long a: A){\n if(a <= limit/res){\n res = res * a;\n }\n else{\n res = -1;\n break;\n }\n }\n\n println(res);\n }\n in.close();\n out.close();\n }\n\n static int MIN = Integer.MIN_VALUE;\n static int MAX = Integer.MAX_VALUE;\n static Reader in = new Reader();\n static PrintWriter out = new PrintWriter(System.out);\n\n static int[] readInt(int N) throws IOException { \n \tint arr[] = new int[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextInt(); \n \t} \n \treturn arr;\n }\n \n static long[] readLong(int N) throws IOException { \n \tlong arr[] = new long[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.nextLong(); \n \t} \n \treturn arr;\n }\n \n static String[] readString(int N) throws IOException { \n \tString arr[] = new String[N];\n \tfor(int i = 0; i < N; i++){ \n \t\tarr[i] = in.next(); \n \t} \n \treturn arr;\n }\n \n static void print(Object O) { \n \tout.print(O); \n }\n \n static void println(Object O) { \n \tout.println(O); \n }\n \n static void println(int arr[]) { \n \tfor(int i = 0; i < arr.length; i++){ \n \t\tprint(arr[i] + \" \"); \n \t} \n \tprintln(\"\"); \n }\n \n static void debug(Object ... O) { \n \tfor(Object obj: O){\n \t\tSystem.out.print(obj + \" \");\n \t}\n \tSystem.out.println();\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException {
int N = in.nextInt();
long A[] = new long[N];
boolean zero = false;
for(int i = 0; i < N; i++){
A[i] = in.nextLong();
if(A[i] == 0){
zero = true;
}
}
if(zero){
println(0);
}
else{
/*
curr = prev * a[i]
curr <= 1e18
prev * a[i] <= 1e18
a[i] <= 1e18/prev
*/
long limit = (long) 1e18;
long res = 1;
for(long a: A){
if(a <= limit/res){
res = res * a;
}
else{
res = -1;
break;
}
}
println(res);
}
in.close();
out.close();
}
static int MIN = Integer.MIN_VALUE;
static int MAX = Integer.MAX_VALUE;
static Reader in = new Reader();
static PrintWriter out = new PrintWriter(System.out);
static int[] readInt(int N) throws IOException {
int arr[] = new int[N];
for(int i = 0; i < N; i++){
arr[i] = in.nextInt();
}
return arr;
}
static long[] readLong(int N) throws IOException {
long arr[] = new long[N];
for(int i = 0; i < N; i++){
arr[i] = in.nextLong();
}
return arr;
}
static String[] readString(int N) throws IOException {
String arr[] = new String[N];
for(int i = 0; i < N; i++){
arr[i] = in.next();
}
return arr;
}
static void print(Object O) {
out.print(O);
}
static void println(Object O) {
out.println(O);
}
static void println(int arr[]) {
for(int i = 0; i < arr.length; i++){
print(arr[i] + " ");
}
println("");
}
static void debug(Object ... O) {
for(Object obj: O){
System.out.print(obj + " ");
}
System.out.println();
}
}
class Reader {
BufferedReader reader;
StringTokenizer tokenizer;
Reader() {
reader = new BufferedReader(new InputStreamReader(System.in));
tokenizer = new StringTokenizer("");
}
String next() throws IOException {
while (!tokenizer.hasMoreTokens() ) {
tokenizer = new StringTokenizer(reader.readLine());
}
return tokenizer.nextToken();
}
int nextInt() throws IOException {
return Integer.parseInt(next());
}
double nextDouble() throws IOException {
return Double.parseDouble(next());
}
long nextLong() throws IOException {
return Long.parseLong(next());
}
String nextLine() throws IOException {
return reader.readLine();
}
void close() throws IOException {
reader.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
14,
13,
30,
4,
18,
18,
13,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
17,
13,
18,
13,
13,
0,
13,
18,
13,
13,
30,
0,
13,
17,
3,
4,
18,
18,
13,
13,
8,
13,
13,
40,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
17,
40,
13,
11,
1,
41,
13,
13,
2,
13,
4,
18,
13,
1,
40,
13,
30,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
0,
13,
17,
30,
4,
18,
13,
4,
18,
13,
13,
14,
13,
0,
13,
17,
0,
13,
2,
4,
18,
13,
4,
18,
13,
13,
29,
2,
13,
8,
13,
40,
17,
17,
12,
13,
30,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
296,
17
],
[
296,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
33
],
[
33,
34
],
[
33,
35
],
[
20,
36
],
[
36,
37
],
[
36,
38
],
[
20,
39
],
[
39,
40
],
[
39,
41
],
[
20,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
20,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
72,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
95,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
81,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
118,
121
],
[
121,
122
],
[
18,
123
],
[
123,
124
],
[
0,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
125,
129
],
[
129,
130
],
[
125,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
131,
137
],
[
137,
138
],
[
125,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
142,
151
],
[
151,
152
],
[
151,
153
],
[
141,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
125,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
125,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
125,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
125,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
185,
190
],
[
190,
191
],
[
190,
192
],
[
185,
193
],
[
193,
194
],
[
193,
195
],
[
185,
196
],
[
196,
197
],
[
196,
198
],
[
185,
199
],
[
199,
200
],
[
199,
201
],
[
185,
202
],
[
202,
203
],
[
202,
204
],
[
185,
205
],
[
205,
206
],
[
205,
207
],
[
185,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
210,
213
],
[
209,
214
],
[
208,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
219,
220
],
[
185,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
221,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
221,
231
],
[
231,
232
],
[
232,
233
],
[
221,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
237,
240
],
[
236,
241
],
[
235,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
246,
247
],
[
245,
248
],
[
248,
249
],
[
249,
250
],
[
242,
251
],
[
251,
252
],
[
251,
253
],
[
242,
254
],
[
254,
255
],
[
254,
256
],
[
235,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
258,
261
],
[
261,
262
],
[
262,
263
],
[
261,
264
],
[
257,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
267,
269
],
[
185,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
273,
276
],
[
276,
277
],
[
277,
278
],
[
272,
279
],
[
185,
280
],
[
280,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
283,
287
],
[
125,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
0,
295
],
[
295,
296
],
[
295,
297
]
] |
[
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }\n}\n\n\n\n\nclass Scanner\n{\n StringTokenizer st;\n BufferedReader br;\n\n public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}\n\n public String next() throws IOException\n {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }\n\n public int nextInt() throws IOException {return Integer.parseInt(next());}\n\n public long nextLong() throws IOException {return Long.parseLong(next());}\n\n public String nextLine() throws IOException {return br.readLine();}\n\n public double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }\n\n public boolean ready() throws IOException {return br.ready();}\n\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"long sum = 1;",
"sum",
"1",
"boolean flag = true",
"flag",
"true",
"ff=false;",
"ff",
"false",
"for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }",
"{\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }",
"arr[i]=s.nextLong()",
"arr[i]",
"arr",
"i",
"s.nextLong()",
"s.nextLong",
"s",
"if(arr[i]==0){\n ff = true;\n }",
"arr[i]==0",
"arr[i]",
"arr",
"i",
"0",
"{\n ff = true;\n }",
"ff = true",
"ff",
"true",
"if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }",
"ff",
"{\n System.out.println(0);\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }",
"for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }",
"{\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }",
"if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }",
"((long)(1e18))/sum >=arr[i]",
"((long)(1e18))/sum",
"((long)(1e18))",
"sum",
"arr[i]",
"arr",
"i",
"sum*=arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"{\n flag = false;\n break;\n }",
"flag = false",
"flag",
"false",
"break;",
"System.out.println(flag?sum:-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"flag?sum:-1",
"flag",
"sum",
"-1",
"1",
"String[] args",
"args",
"class Scanner\n{\n StringTokenizer st;\n BufferedReader br;\n\n public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}\n\n public String next() throws IOException\n {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }\n\n public int nextInt() throws IOException {return Integer.parseInt(next());}\n\n public long nextLong() throws IOException {return Long.parseLong(next());}\n\n public String nextLine() throws IOException {return br.readLine();}\n\n public double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }\n\n public boolean ready() throws IOException {return br.ready();}\n\n\n}",
"Scanner",
"StringTokenizer st;",
"st",
"BufferedReader br;",
"br",
"public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}",
"Scanner",
"{\tbr = new BufferedReader(new InputStreamReader(s));}",
"br = new BufferedReader(new InputStreamReader(s))",
"br",
"new BufferedReader(new InputStreamReader(s))",
"InputStream s",
"s",
"public String next() throws IOException\n {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int nextInt() throws IOException {return Integer.parseInt(next());}",
"nextInt",
"{return Integer.parseInt(next());}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() throws IOException {return Long.parseLong(next());}",
"nextLong",
"{return Long.parseLong(next());}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public String nextLine() throws IOException {return br.readLine();}",
"nextLine",
"{return br.readLine();}",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"public double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }",
"nextDouble",
"{\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }",
"String x = next();",
"x",
"next()",
"next",
"StringBuilder sb = new StringBuilder(\"0\");",
"sb",
"new StringBuilder(\"0\")",
"double res = 0",
"res",
"0",
"f = 1;",
"f",
"1",
"boolean dec = false",
"dec",
"false",
"neg = false;",
"neg",
"false",
"int start = 0;",
"start",
"0",
"if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }",
"x.charAt(0) == '-'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'-'",
"{\n neg = true;\n start++;\n }",
"neg = true",
"neg",
"true",
"start++",
"start",
"for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"int i = start;",
"int i = start;",
"i",
"start",
"i < x.length()",
"i",
"x.length()",
"x.length",
"x",
"i++",
"i++",
"i",
"if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"x.charAt(i) == '.'",
"x.charAt(i)",
"x.charAt",
"x",
"i",
"'.'",
"{\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }",
"res = Long.parseLong(sb.toString())",
"res",
"Long.parseLong(sb.toString())",
"Long.parseLong",
"Long",
"sb.toString()",
"sb.toString",
"sb",
"sb = new StringBuilder(\"0\")",
"sb",
"new StringBuilder(\"0\")",
"dec = true",
"dec",
"true",
"{\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"sb.append(x.charAt(i))",
"sb.append",
"sb",
"x.charAt(i)",
"x.charAt",
"x",
"i",
"if(dec)\n f *= 10;",
"dec",
"f *= 10",
"f",
"10",
"res += Long.parseLong(sb.toString()) / f",
"res",
"Long.parseLong(sb.toString()) / f",
"Long.parseLong(sb.toString())",
"Long.parseLong",
"Long",
"sb.toString()",
"sb.toString",
"sb",
"f",
"return res * (neg?-1:1);",
"res * (neg?-1:1)",
"res",
"(neg?-1:1)",
"neg",
"-1",
"1",
"1",
"public boolean ready() throws IOException {return br.ready();}",
"ready",
"{return br.ready();}",
"return br.ready();",
"br.ready()",
"br.ready",
"br",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n long arr[] = new long[n];\n long sum = 1;\n boolean flag = true,ff=false;\n for(int i=0;i<n;i++){\n arr[i]=s.nextLong();\n if(arr[i]==0){\n ff = true;\n }\n }\n if(ff){\n System.out.println(0);\n }\n else{\n for(int i=0;i<n;i++){\n if(((long)(1e18))/sum >=arr[i])sum*=arr[i];\n else {\n flag = false;\n break;\n }\n }\n System.out.println(flag?sum:-1);\n }\n\n\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
long arr[] = new long[n];
long sum = 1;
boolean flag = true,ff=false;
for(int i=0;i<n;i++){
arr[i]=s.nextLong();
if(arr[i]==0){
ff = true;
}
}
if(ff){
System.out.println(0);
}
else{
for(int i=0;i<n;i++){
if(((long)(1e18))/sum >=arr[i])sum*=arr[i];
else {
flag = false;
break;
}
}
System.out.println(flag?sum:-1);
}
}
}
class Scanner
{
StringTokenizer st;
BufferedReader br;
public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}
public String next() throws IOException
{
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine());
return st.nextToken();
}
public int nextInt() throws IOException {return Integer.parseInt(next());}
public long nextLong() throws IOException {return Long.parseLong(next());}
public String nextLine() throws IOException {return br.readLine();}
public double nextDouble() throws IOException
{
String x = next();
StringBuilder sb = new StringBuilder("0");
double res = 0, f = 1;
boolean dec = false, neg = false;
int start = 0;
if(x.charAt(0) == '-')
{
neg = true;
start++;
}
for(int i = start; i < x.length(); i++)
if(x.charAt(i) == '.')
{
res = Long.parseLong(sb.toString());
sb = new StringBuilder("0");
dec = true;
}
else
{
sb.append(x.charAt(i));
if(dec)
f *= 10;
}
res += Long.parseLong(sb.toString()) / f;
return res * (neg?-1:1);
}
public boolean ready() throws IOException {return br.ready();}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
17,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
17,
2,
13,
13,
30,
0,
13,
40,
17,
3,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
3,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
128,
5
],
[
128,
6
],
[
6,
7
],
[
6,
8
],
[
128,
9
],
[
9,
10
],
[
9,
11
],
[
128,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
20,
22
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
14,
44
],
[
44,
45
],
[
44,
46
],
[
14,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
59,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
76,
81
],
[
14,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
14,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
106,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
12,
125
],
[
125,
126
],
[
0,
127
],
[
127,
128
],
[
127,
129
]
] |
[
"\nimport java.util.Scanner;\n\npublic class Main {\n static Scanner sc = new Scanner(System.in);\n static long check = 1000000000000000000L;\n\n public static void main(String[] args) {\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n static long check = 1000000000000000000L;\n\n public static void main(String[] args) {\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"static long check = 1000000000000000000L;",
"check",
"1000000000000000000L",
"public static void main(String[] args) {\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }",
"main",
"{\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = sc.nextLong();\n }",
"{\n arr[i] = sc.nextLong();\n }",
"arr[i] = sc.nextLong()",
"arr[i]",
"arr",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long ans = 1;",
"ans",
"1",
"for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }",
"{\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }",
"long tmp = ans;",
"tmp",
"ans",
"ans *= arr[i]",
"ans",
"arr[i]",
"arr",
"i",
"if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }",
"ans < 0 || ans < tmp",
"ans < 0",
"ans",
"0",
"ans < tmp",
"ans",
"tmp",
"{\n ans = -1;\n break;\n }",
"ans = -1",
"ans",
"-1",
"1",
"break;",
"for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }",
"{\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }",
"if (arr[i] == 0){\n ans = 0;\n break;\n }",
"arr[i] == 0",
"arr[i]",
"arr",
"i",
"0",
"{\n ans = 0;\n break;\n }",
"ans = 0",
"ans",
"0",
"break;",
"if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }",
"ans > check",
"ans",
"check",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n static long check = 1000000000000000000L;\n\n public static void main(String[] args) {\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }\n}",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n static long check = 1000000000000000000L;\n\n public static void main(String[] args) {\n int n = sc.nextInt();\n long arr[] = new long[n];\n for (int i = 0; i < n; i++){\n arr[i] = sc.nextLong();\n }\n long ans = 1;\n for (int i = 0; i < n; i++){\n long tmp = ans;\n ans *= arr[i];\n if (ans < 0 || ans < tmp){\n ans = -1;\n break;\n }\n }\n for (int i = 0; i < n; i++){\n if (arr[i] == 0){\n ans = 0;\n break;\n }\n }\n if (ans > check){\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static long check = 1000000000000000000L;
public static void main(String[] args) {
int n = sc.nextInt();
long arr[] = new long[n];
for (int i = 0; i < n; i++){
arr[i] = sc.nextLong();
}
long ans = 1;
for (int i = 0; i < n; i++){
long tmp = ans;
ans *= arr[i];
if (ans < 0 || ans < tmp){
ans = -1;
break;
}
}
for (int i = 0; i < n; i++){
if (arr[i] == 0){
ans = 0;
break;
}
}
if (ans > check){
System.out.println(-1);
} else {
System.out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
4,
18,
13,
17,
17,
41,
13,
17,
41,
13,
39,
39,
17,
17,
39,
17,
40,
17,
39,
17,
17,
39,
40,
17,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
13,
17,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
13,
13,
18,
13,
13,
30,
4,
13,
17,
4,
18,
13,
17,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
29,
17,
41,
13,
2,
13,
13,
14,
2,
13,
2,
13,
13,
30,
29,
17,
29,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
42,
2,
13,
13,
30,
4,
13,
13,
13,
13,
40,
13,
40,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
18,
13,
13,
17,
30,
29,
17,
41,
13,
2,
18,
13,
13,
17,
42,
2,
13,
17,
30,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
30,
3,
40,
13,
14,
2,
13,
17,
30,
29,
17,
41,
13,
2,
18,
13,
13,
17,
11,
1,
41,
13,
2,
18,
13,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
30,
0,
13,
13,
3,
4,
13,
13,
13,
13,
4,
13,
13,
2,
13,
17,
2,
18,
13,
13,
17,
29,
17,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
2,
13,
17,
29,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
13,
17,
4,
13,
17,
23,
13,
12,
13,
30,
29,
2,
4,
18,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
4,
13,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
533,
14
],
[
533,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
17,
21
],
[
533,
22
],
[
22,
23
],
[
22,
24
],
[
533,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
27,
35
],
[
35,
36
],
[
35,
37
],
[
27,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
533,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
44,
53
],
[
53,
54
],
[
53,
55
],
[
44,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
44,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
44,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
44,
95
],
[
95,
96
],
[
95,
97
],
[
44,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
98,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
111,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
110,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
44,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
44,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
42,
146
],
[
146,
147
],
[
533,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
156,
158
],
[
151,
159
],
[
159,
160
],
[
160,
161
],
[
150,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
150,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
167,
173
],
[
173,
174
],
[
174,
175
],
[
150,
176
],
[
176,
177
],
[
148,
178
],
[
178,
179
],
[
148,
180
],
[
180,
181
],
[
533,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
184,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
194,
196
],
[
184,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
182,
202
],
[
202,
203
],
[
182,
204
],
[
204,
205
],
[
182,
206
],
[
206,
207
],
[
533,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
216,
219
],
[
216,
220
],
[
215,
221
],
[
221,
222
],
[
215,
223
],
[
223,
224
],
[
208,
225
],
[
225,
226
],
[
208,
227
],
[
227,
228
],
[
208,
229
],
[
229,
230
],
[
533,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
234,
240
],
[
240,
241
],
[
241,
242
],
[
233,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
245,
249
],
[
233,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
250,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
260,
261
],
[
260,
262
],
[
262,
263
],
[
262,
264
],
[
255,
265
],
[
265,
266
],
[
254,
267
],
[
267,
268
],
[
233,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
274,
275
],
[
233,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
233,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
287,
291
],
[
283,
292
],
[
292,
293
],
[
292,
294
],
[
283,
295
],
[
295,
296
],
[
296,
297
],
[
283,
298
],
[
299,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
301,
305
],
[
305,
306
],
[
305,
307
],
[
300,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
308,
312
],
[
233,
313
],
[
313,
314
],
[
313,
315
],
[
313,
316
],
[
313,
317
],
[
233,
318
],
[
318,
319
],
[
318,
320
],
[
318,
321
],
[
321,
322
],
[
321,
323
],
[
318,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
324,
328
],
[
233,
329
],
[
329,
330
],
[
231,
331
],
[
331,
332
],
[
533,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
335,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
340,
345
],
[
345,
346
],
[
345,
347
],
[
340,
348
],
[
348,
349
],
[
349,
350
],
[
340,
351
],
[
352,
352
],
[
352,
353
],
[
353,
354
],
[
354,
355
],
[
354,
356
],
[
353,
357
],
[
357,
358
],
[
357,
359
],
[
335,
360
],
[
360,
361
],
[
333,
362
],
[
362,
363
],
[
533,
364
],
[
364,
365
],
[
364,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
367,
372
],
[
364,
373
],
[
373,
374
],
[
533,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
378,
379
],
[
378,
380
],
[
378,
381
],
[
382,
382
],
[
382,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
383,
388
],
[
388,
389
],
[
388,
390
],
[
377,
391
],
[
391,
392
],
[
391,
393
],
[
375,
394
],
[
394,
395
],
[
533,
396
],
[
396,
397
],
[
396,
398
],
[
398,
399
],
[
399,
400
],
[
400,
401
],
[
401,
402
],
[
402,
403
],
[
401,
404
],
[
400,
405
],
[
405,
406
],
[
406,
407
],
[
405,
408
],
[
396,
409
],
[
409,
410
],
[
533,
411
],
[
411,
412
],
[
411,
413
],
[
413,
414
],
[
414,
415
],
[
415,
416
],
[
415,
417
],
[
414,
418
],
[
418,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
420,
423
],
[
413,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
425,
429
],
[
424,
430
],
[
430,
431
],
[
431,
432
],
[
413,
433
],
[
433,
434
],
[
434,
435
],
[
434,
436
],
[
434,
437
],
[
437,
438
],
[
437,
439
],
[
411,
440
],
[
440,
441
],
[
411,
442
],
[
442,
443
],
[
533,
444
],
[
444,
445
],
[
444,
446
],
[
446,
447
],
[
444,
448
],
[
448,
449
],
[
444,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
453,
455
],
[
444,
456
],
[
456,
457
],
[
456,
458
],
[
458,
459
],
[
459,
460
],
[
460,
461
],
[
461,
462
],
[
461,
463
],
[
460,
464
],
[
464,
465
],
[
465,
466
],
[
466,
467
],
[
459,
468
],
[
468,
469
],
[
469,
470
],
[
470,
471
],
[
470,
472
],
[
472,
473
],
[
473,
474
],
[
474,
475
],
[
469,
476
],
[
476,
477
],
[
477,
478
],
[
477,
479
],
[
458,
480
],
[
480,
481
],
[
481,
482
],
[
482,
483
],
[
444,
484
],
[
484,
485
],
[
484,
486
],
[
486,
487
],
[
487,
488
],
[
488,
489
],
[
489,
490
],
[
488,
491
],
[
491,
492
],
[
444,
493
],
[
493,
494
],
[
493,
495
],
[
495,
496
],
[
496,
497
],
[
497,
498
],
[
498,
499
],
[
497,
500
],
[
500,
501
],
[
444,
502
],
[
502,
503
],
[
502,
504
],
[
504,
505
],
[
505,
506
],
[
506,
507
],
[
507,
508
],
[
506,
509
],
[
509,
510
],
[
444,
511
],
[
511,
512
],
[
511,
513
],
[
513,
514
],
[
514,
515
],
[
514,
516
],
[
513,
517
],
[
517,
518
],
[
518,
519
],
[
518,
520
],
[
520,
521
],
[
521,
522
],
[
522,
523
],
[
517,
524
],
[
524,
525
],
[
525,
526
],
[
525,
527
],
[
527,
528
],
[
528,
529
],
[
513,
530
],
[
530,
531
],
[
0,
532
],
[
532,
533
],
[
532,
534
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\npublic class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final long EIGHT = (long) 1e18;\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }\n\n /*\n * Check if a * b is overflow or not\n */\n static Boolean isOverflowByMul(long a, long b) {\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final long EIGHT = (long) 1e18;\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }\n\n /*\n * Check if a * b is overflow or not\n */\n static Boolean isOverflowByMul(long a, long b) {\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main",
"private static final int MOD = (int) Math.pow(10, 9);",
"MOD",
"(int) Math.pow(10, 9)",
"Math.pow",
"Math",
"10",
"9",
"private static final long EIGHT = (long) 1e18;",
"EIGHT",
"(long) 1e18",
"private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};",
"DIRS",
"{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}",
"{0, 1}",
"0",
"1",
"{0, -1}",
"0",
"-1",
"1",
"{1, 0}",
"1",
"0",
"{-1, 0}",
"-1",
"1",
"0",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }",
"main",
"{\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] nums = new long[n];",
"nums",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n nums[i] = sc.nextLong();\n }",
"{\n nums[i] = sc.nextLong();\n }",
"nums[i] = sc.nextLong()",
"nums[i]",
"nums",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(nums)",
"Arrays.sort",
"Arrays",
"nums",
"if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }",
"nums[0] == 0",
"nums[0]",
"nums",
"0",
"0",
"{\n print(\"0\");\n System.exit(0);\n }",
"print(\"0\")",
"print",
"\"0\"",
"System.exit(0)",
"System.exit",
"System",
"0",
"long res = 1;",
"res",
"1",
"for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }",
"{\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }",
"if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }",
"isOverflowByMul(res, nums[i])",
"isOverflowByMul",
"res",
"nums[i]",
"nums",
"i",
"{\n print(\"-1\");\n System.exit(0);\n }",
"print(\"-1\")",
"print",
"\"-1\"",
"System.exit(0)",
"System.exit",
"System",
"0",
"res *= nums[i]",
"res",
"nums[i]",
"nums",
"i",
"if (res > EIGHT) {\n res = -1;\n }",
"res > EIGHT",
"res",
"EIGHT",
"{\n res = -1;\n }",
"res = -1",
"res",
"-1",
"1",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"/*\n * Check if a * b is overflow or not\n */\n static Boolean isOverflowByMul(long a, long b) {\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }",
"isOverflowByMul",
"{\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }",
"if (a == 0 || b == 0) {\n return false;\n }",
"a == 0 || b == 0",
"a == 0",
"a",
"0",
"b == 0",
"b",
"0",
"{\n return false;\n }",
"return false;",
"false",
"long result = a * b;",
"result",
"a * b",
"a",
"b",
"if (a == result / b) {\n return false;\n }",
"a == result / b",
"a",
"result / b",
"result",
"b",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"long a",
"a",
"long b",
"b",
"static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }",
"swap",
"{\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }",
"int tmp = nums[x];",
"tmp",
"nums[x]",
"nums",
"x",
"nums[x] = nums[y]",
"nums[x]",
"nums",
"x",
"nums[y]",
"nums",
"y",
"nums[y] = tmp",
"nums[y]",
"nums",
"y",
"tmp",
"int[] nums",
"nums",
"int x",
"x",
"int y",
"y",
"static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }",
"reverse",
"{\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }",
"while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }",
"left < right",
"left",
"right",
"{\n swap(nums, left, right);\n left++;\n right--;\n }",
"swap(nums, left, right)",
"swap",
"nums",
"left",
"right",
"left++",
"left",
"right--",
"right",
"int[] nums",
"nums",
"int left",
"left",
"int right",
"right",
"static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }",
"findNextPermutation",
"{\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }",
"if (nums.length <= 1) {\n return false;\n }",
"nums.length <= 1",
"nums.length",
"nums",
"nums.length",
"1",
"{\n return false;\n }",
"return false;",
"false",
"int last = nums.length - 2;",
"last",
"nums.length - 2",
"nums.length",
"nums",
"nums.length",
"2",
"while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }",
"last >= 0",
"last",
"0",
"{\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }",
"if (nums[last] < nums[last + 1]){\n break;\n }",
"nums[last] < nums[last + 1]",
"nums[last]",
"nums",
"last",
"nums[last + 1]",
"nums",
"last + 1",
"last",
"1",
"{\n break;\n }",
"break;",
"last--",
"last",
"if (last < 0) { return false; }",
"last < 0",
"last",
"0",
"{ return false; }",
"return false;",
"false",
"int nextGenerater = nums.length - 1;",
"nextGenerater",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"int i = nums.length - 1;",
"int i = nums.length - 1;",
"i",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"i > last",
"i",
"last",
"i--",
"i--",
"i",
"{\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"{\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }",
"nums[i] > nums[last]",
"nums[i]",
"nums",
"i",
"nums[last]",
"nums",
"last",
"{\n nextGenerater = i;\n break;\n }",
"nextGenerater = i",
"nextGenerater",
"i",
"break;",
"swap(nums, nextGenerater, last)",
"swap",
"nums",
"nextGenerater",
"last",
"reverse(nums, last + 1, nums.length - 1)",
"reverse",
"nums",
"last + 1",
"last",
"1",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"return true;",
"true",
"int[] nums",
"nums",
"static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }",
"generateNArray",
"{\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }",
"int[] res = new int[n];",
"res",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n res[i] = i + 1;\n }",
"{\n res[i] = i + 1;\n }",
"res[i] = i + 1",
"res[i]",
"res",
"i",
"i + 1",
"i",
"1",
"return res;",
"res",
"int n",
"n",
"static private void print(String s) {\n System.out.println(s);\n }",
"print",
"{\n System.out.println(s);\n }",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"String s",
"s",
"static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }",
"printArray",
"{\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }",
"for (int s: e) {\n System.out.print(s + \" \");\n }",
"int s",
"e",
"{\n System.out.print(s + \" \");\n }",
"{\n System.out.print(s + \" \");\n }",
"System.out.print(s + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"s + \" \"",
"s",
"\" \"",
"print(\"\")",
"print",
"\"\"",
"int[] e",
"e",
"static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }",
"log2",
"{\n return (int)(Math.log(x) / Math.log(2));\n }",
"return (int)(Math.log(x) / Math.log(2));",
"(int)(Math.log(x) / Math.log(2))",
"Math.log(x)",
"Math.log",
"Math",
"x",
"Math.log(2)",
"Math.log",
"Math",
"2",
"int x",
"x",
"static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }",
"gcd",
"{\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }",
"if (m < n) { return gcd(n, m); }",
"m < n",
"m",
"n",
"{ return gcd(n, m); }",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if (m % n == 0) { return n; }",
"m % n == 0",
"m % n",
"m",
"n",
"0",
"{ return n; }",
"return n;",
"n",
"return gcd(n, m%n);",
"gcd(n, m%n)",
"gcd",
"n",
"m%n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final long EIGHT = (long) 1e18;\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }\n\n /*\n * Check if a * b is overflow or not\n */\n static Boolean isOverflowByMul(long a, long b) {\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final long EIGHT = (long) 1e18;\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n long[] nums = new long[n];\n\n for (int i = 0; i < n; i++) {\n nums[i] = sc.nextLong();\n }\n Arrays.sort(nums);\n\n if (nums[0] == 0) {\n print(\"0\");\n System.exit(0);\n }\n\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (isOverflowByMul(res, nums[i])){\n print(\"-1\");\n System.exit(0);\n }\n res *= nums[i];\n }\n\n if (res > EIGHT) {\n res = -1;\n }\n System.out.println(res);\n }\n\n /*\n * Check if a * b is overflow or not\n */\n static Boolean isOverflowByMul(long a, long b) {\n if (a == 0 || b == 0) {\n return false;\n }\n\n long result = a * b;\n if (a == result / b) {\n return false;\n }\n return true;\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
private static final int MOD = (int) Math.pow(10, 9);
private static final long EIGHT = (long) 1e18;
private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
public static void main(String[] args) {
FastReader sc = new FastReader();
int n = sc.nextInt();
long[] nums = new long[n];
for (int i = 0; i < n; i++) {
nums[i] = sc.nextLong();
}
Arrays.sort(nums);
if (nums[0] == 0) {
print("0");
System.exit(0);
}
long res = 1;
for (int i = 0; i < n; i++) {
if (isOverflowByMul(res, nums[i])){
print("-1");
System.exit(0);
}
res *= nums[i];
}
if (res > EIGHT) {
res = -1;
}
System.out.println(res);
}
/*
* Check if a * b is overflow or not
*/
static Boolean isOverflowByMul(long a, long b) {
if (a == 0 || b == 0) {
return false;
}
long result = a * b;
if (a == result / b) {
return false;
}
return true;
}
static private void swap(int[] nums, int x, int y) {
int tmp = nums[x];
nums[x] = nums[y];
nums[y] = tmp;
}
static private void reverse(int[] nums, int left, int right) {
while (left < right) {
swap(nums, left, right);
left++;
right--;
}
}
static private boolean findNextPermutation(int[] nums) {
if (nums.length <= 1) {
return false;
}
int last = nums.length - 2;
while (last >= 0) {
if (nums[last] < nums[last + 1]){
break;
}
last--;
}
if (last < 0) { return false; }
int nextGenerater = nums.length - 1;
for (int i = nums.length - 1; i > last; i--) {
if (nums[i] > nums[last]) {
nextGenerater = i;
break;
}
}
swap(nums, nextGenerater, last);
reverse(nums, last + 1, nums.length - 1);
return true;
}
static private int[] generateNArray(int n) {
int[] res = new int[n];
for (int i = 0; i < n; i++) {
res[i] = i + 1;
}
return res;
}
static private void print(String s) {
System.out.println(s);
}
static private void printArray(int[] e) {
for (int s: e) {
System.out.print(s + " ");
}
print("");
}
static private int log2(int x) {
return (int)(Math.log(x) / Math.log(2));
}
static private long gcd(long m, long n) {
if (m < n) { return gcd(n, m); }
if (m % n == 0) { return n; }
return gcd(n, m%n);
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try{
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
4,
18,
13,
17,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
20,
3,
14,
2,
4,
18,
13,
20,
17,
30,
0,
13,
4,
18,
13,
20,
14,
2,
4,
18,
13,
20,
17,
30,
0,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
98,
8
],
[
98,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
25,
29
],
[
11,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
44,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
60,
65
],
[
59,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
66,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
74,
79
],
[
73,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
11,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
90,
91
],
[
11,
92
],
[
92,
93
],
[
93,
94
],
[
9,
95
],
[
95,
96
],
[
0,
97
],
[
97,
98
],
[
97,
99
]
] |
[
"import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}\n\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long Num = sc.nextLong();",
"Num",
"sc.nextLong()",
"sc.nextLong",
"sc",
"BigInteger resultMul = new BigInteger(\"1\");",
"resultMul",
"new BigInteger(\"1\")",
"long resultMax = (long) Math.pow(10, 18);",
"resultMax",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"long tmp;",
"tmp",
"for (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"long i=0;",
"long i=0;",
"i",
"0",
"i<Num",
"i",
"Num",
"i++",
"i++",
"i",
"{\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"{\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"tmp = sc.nextLong()",
"tmp",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}",
"tmp == 0",
"tmp",
"0",
"{\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}",
"resultMul = new BigInteger(\"0\")",
"resultMul",
"new BigInteger(\"0\")",
"break;",
"if(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}",
"resultMul.compareTo(new BigInteger(\"0\")) > 0",
"resultMul.compareTo(new BigInteger(\"0\"))",
"resultMul.compareTo",
"resultMul",
"new BigInteger(\"0\")",
"0",
"{\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}",
"resultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)))",
"resultMul",
"resultMul.multiply(new BigInteger(String.valueOf(tmp)))",
"resultMul.multiply",
"resultMul",
"new BigInteger(String.valueOf(tmp))",
"if(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}",
"resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0",
"resultMul.compareTo(new BigInteger(String.valueOf(resultMax)))",
"resultMul.compareTo",
"resultMul",
"new BigInteger(String.valueOf(resultMax))",
"0",
"{\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}",
"resultMul = new BigInteger(\"-1\")",
"resultMul",
"new BigInteger(\"-1\")",
"System.out.println(resultMul.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"resultMul.longValue()",
"resultMul.longValue",
"resultMul",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong Num = sc.nextLong();\n\n\t\tBigInteger resultMul = new BigInteger(\"1\");\n\t\tlong resultMax = (long) Math.pow(10, 18);\n\t\tlong tmp;\n\n\t\tfor (long i=0;i<Num;i++) {\n\t\t\ttmp = sc.nextLong();\n\t\t\tif(tmp == 0) {\n\t\t\t\tresultMul = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(resultMul.compareTo(new BigInteger(\"0\")) > 0) {\n\t\t\t\tresultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));\n\t\t\t\tif(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {\n\t\t\t\t\tresultMul = new BigInteger(\"-1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(resultMul.longValue());\n\t\tsc.close();\n\n\t}\n\n}",
"Main"
] |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long Num = sc.nextLong();
BigInteger resultMul = new BigInteger("1");
long resultMax = (long) Math.pow(10, 18);
long tmp;
for (long i=0;i<Num;i++) {
tmp = sc.nextLong();
if(tmp == 0) {
resultMul = new BigInteger("0");
break;
}
if(resultMul.compareTo(new BigInteger("0")) > 0) {
resultMul = resultMul.multiply(new BigInteger(String.valueOf(tmp)));
if(resultMul.compareTo(new BigInteger(String.valueOf(resultMax))) > 0) {
resultMul = new BigInteger("-1");
}
}
}
System.out.println(resultMul.longValue());
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
40,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
4,
18,
13,
17,
17,
13,
30,
0,
13,
2,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
0,
13,
17,
3,
14,
40,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
234,
20
],
[
234,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
23,
35
],
[
35,
36
],
[
35,
37
],
[
23,
39
],
[
39,
40
],
[
39,
41
],
[
23,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
68,
69
],
[
23,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
74,
81
],
[
23,
82
],
[
82,
83
],
[
82,
84
],
[
23,
85
],
[
85,
86
],
[
85,
87
],
[
23,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
88,
99
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
107,
111
],
[
106,
112
],
[
101,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
101,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
121,
129
],
[
129,
130
],
[
129,
131
],
[
121,
132
],
[
23,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
21,
143
],
[
143,
144
],
[
0,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
145,
149
],
[
149,
150
],
[
145,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
145,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
160,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
170,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
159,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
145,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
192,
193
],
[
145,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
201,
202
],
[
145,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
207,
210
],
[
210,
211
],
[
145,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
218,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
214,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.*;\nimport java.math.BigInteger;\npublic class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}\n}\n\n\n\n\n\nclass FastReader {\n\tBufferedReader br;\n\tStringTokenizer st;\n\n\tpublic FastReader() {\n\t\tbr = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t}\n\n\tString next() {\n\t\twhile (st == null || !st.hasMoreElements()) {\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn st.nextToken();\n\t}\n\n\tint nextInt() {\n\t\treturn Integer.parseInt(next());\n\t}\n\n\tlong nextLong() {\n\t\treturn Long.parseLong(next());\n\t}\n\n\tdouble nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}\n\n\tString nextLine() {\n\t\tString str = \"\";\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn str;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.*;",
"util.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}\n}",
"Main",
"public static void main(String[] args)throws IOException {\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}",
"main",
"{\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"PrintWriter pw = new PrintWriter(System.out);",
"pw",
"new PrintWriter(System.out)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"int zero = 0;",
"zero",
"0",
"for (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}",
"{\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}",
"arr[i] = sc.nextLong()",
"arr[i]",
"arr",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (arr[i] == 0)\n\t\t\t\tzero++;",
"arr[i] == 0",
"arr[i]",
"arr",
"i",
"0",
"zero++",
"zero",
"if (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"zero > 0",
"zero",
"0",
"{\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long prod = 1;",
"prod",
"1",
"boolean flag = false;",
"flag",
"false",
"for (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"if (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}",
"arr[i] <= ((long)Math.pow(10, 18)) / prod",
"arr[i]",
"arr",
"i",
"((long)Math.pow(10, 18)) / prod",
"((long)Math.pow(10, 18))",
"Math.pow",
"Math",
"10",
"18",
"prod",
"{\n\t\t\t\tprod = prod * arr[i];\n\t\t\t}",
"prod = prod * arr[i]",
"prod",
"prod * arr[i]",
"prod",
"arr[i]",
"arr",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"flag = true",
"flag",
"true",
"break;",
"if (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}",
"!flag",
"flag",
"{\n\t\t\tSystem.out.println(prod);\n\t\t}",
"System.out.println(prod)",
"System.out.println",
"System.out",
"System",
"System.out",
"prod",
"String[] args",
"args",
"class FastReader {\n\tBufferedReader br;\n\tStringTokenizer st;\n\n\tpublic FastReader() {\n\t\tbr = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t}\n\n\tString next() {\n\t\twhile (st == null || !st.hasMoreElements()) {\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn st.nextToken();\n\t}\n\n\tint nextInt() {\n\t\treturn Integer.parseInt(next());\n\t}\n\n\tlong nextLong() {\n\t\treturn Long.parseLong(next());\n\t}\n\n\tdouble nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}\n\n\tString nextLine() {\n\t\tString str = \"\";\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn str;\n\t}\n}",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n\t\tbr = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t}",
"FastReader",
"{\n\t\tbr = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t}",
"br = new BufferedReader(new\n\t\t InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n\t\t InputStreamReader(System.in))",
"String next() {\n\t\twhile (st == null || !st.hasMoreElements()) {\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn st.nextToken();\n\t}",
"next",
"{\n\t\twhile (st == null || !st.hasMoreElements()) {\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn st.nextToken();\n\t}",
"while (st == null || !st.hasMoreElements()) {\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n\t\t\ttry {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t}",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n\t\treturn Integer.parseInt(next());\n\t}",
"nextInt",
"{\n\t\treturn Integer.parseInt(next());\n\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n\t\treturn Long.parseLong(next());\n\t}",
"nextLong",
"{\n\t\treturn Long.parseLong(next());\n\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}",
"nextDouble",
"{\n\t\treturn Double.parseDouble(next());\n\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n\t\tString str = \"\";\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn str;\n\t}",
"nextLine",
"{\n\t\tString str = \"\";\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn str;\n\t}",
"String str = \"\";",
"str",
"\"\"",
"try {\n\t\t\tstr = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tstr = br.readLine();\n\t\t}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader sc = new FastReader();\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\tint n = sc.nextInt();\n\t\tlong arr[] = new long[n];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextLong();\n\t\t\tif (arr[i] == 0)\n\t\t\t\tzero++;\n\t\t}\n\t\tif (zero > 0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prod = 1;\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (arr[i] <= ((long)Math.pow(10, 18)) / prod) {\n\t\t\t\tprod = prod * arr[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!flag) {\n\t\t\tSystem.out.println(prod);\n\t\t}\n\n\n\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.math.BigInteger;
public class Main {
public static void main(String[] args)throws IOException {
FastReader sc = new FastReader();
PrintWriter pw = new PrintWriter(System.out);
int n = sc.nextInt();
long arr[] = new long[n];
int zero = 0;
for (int i = 0; i < n; i++) {
arr[i] = sc.nextLong();
if (arr[i] == 0)
zero++;
}
if (zero > 0) {
System.out.println(0);
return;
}
long prod = 1;
boolean flag = false;
for (int i = 0; i < n; i++) {
if (arr[i] <= ((long)Math.pow(10, 18)) / prod) {
prod = prod * arr[i];
} else {
System.out.println(-1);
flag = true;
break;
}
}
if (!flag) {
System.out.println(prod);
}
}
}
class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
116,
8
],
[
116,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
11,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
61,
68
],
[
11,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
93,
101
],
[
84,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
11,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
9,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] |
[
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"long judge = (long) Math.pow(10, 18);",
"judge",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t}",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t}",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"if(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"a[0]==0",
"a[0]",
"a",
"0",
"0",
"{\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans = 1;",
"ans",
"1",
"for(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}",
"{\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}",
"if(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"ans>judge/a[i]",
"ans",
"judge/a[i]",
"judge",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"ans*=a[i]",
"ans",
"a[i]",
"a",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tlong judge = (long) Math.pow(10, 18);\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tif(a[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong ans = 1;\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(ans>judge/a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans*=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
long judge = (long) Math.pow(10, 18);
for(int i = 0; i < n; i++) {
a[i] = sc.nextLong();
}
Arrays.sort(a);
if(a[0]==0) {
System.out.println(0);
return;
}
long ans = 1;
for(int i = 0; i < n; i++) {
if(ans>judge/a[i]) {
System.out.println(-1);
return;
}
ans*=a[i];
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
41,
13,
17,
38,
5,
13,
30,
0,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
13,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
133,
8
],
[
133,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
11,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
11,
64
],
[
64,
65
],
[
64,
66
],
[
11,
67
],
[
67,
68
],
[
67,
69
],
[
11,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
70,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
90,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
99,
103
],
[
90,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
11,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
113,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
9,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] |
[
"import java.util.*;\nimport java.math.BigInteger;\n \npublic class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }",
"main",
"{\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"List<Long> list = new ArrayList<Long>();",
"list",
"new ArrayList<Long>()",
"for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"list.add(a)",
"list.add",
"list",
"a",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }",
"list.get(0) == 0",
"list.get(0)",
"list.get",
"list",
"0",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans = 1l;",
"ans",
"1l",
"boolean isOver = false;",
"isOver",
"false",
"try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }",
"catch (ArithmeticException e) {\n isOver = true;\n }",
"ArithmeticException e",
"{\n isOver = true;\n }",
"isOver = true",
"isOver",
"true",
"{\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n }",
"for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n }",
"{\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n }",
"long a = list.get(i);",
"a",
"list.get(i)",
"list.get",
"list",
"i",
"ans = Math.multiplyExact(ans, a)",
"ans",
"Math.multiplyExact(ans, a)",
"Math.multiplyExact",
"Math",
"ans",
"a",
"if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }",
"ans > 1000000000000000000l",
"ans",
"1000000000000000000l",
"{\n isOver = true;\n break;\n }",
"isOver = true",
"isOver",
"true",
"break;",
"if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }",
"isOver",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n /*\n * 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n\n // 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /*\n * 公式の模範解答を真似たけど、WA\n long ans = 1l;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n long a = list.get(i); \n if (Math.floor(10E+18 / ans) <= a) {\n isOver = true;\n break;\n } else {\n ans *= a;\n }\n }\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n\n }\n}",
"Main"
] |
import java.util.*;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
List<Long> list = new ArrayList<Long>();
for (int i = 0; i < n; i++) {
long a = scan.nextLong();
list.add(a);
}
Collections.sort(list);//System.out.println(list);
// listの先頭が0だったら、0を出力して即終了
if (list.get(0) == 0) {
System.out.println(0);
return;
}
/*
* 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。
BigInteger ans = BigInteger.ONE;
boolean isOver = false;
for (int i = 0; i < n; i++) {
ans = ans.multiply(BigInteger.valueOf(list.get(i)));
if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {
isOver = true;
break;
}
}
if (isOver) {
System.out.println(-1);
} else {
System.out.println(ans);
}
*/
// 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。
long ans = 1l;
boolean isOver = false;
try {
for (int i = 0; i < n; i++) {
long a = list.get(i);
ans = Math.multiplyExact(ans, a);
if (ans > 1000000000000000000l) {
isOver = true;
break;
}
}
} catch (ArithmeticException e) {
isOver = true;
}
if (isOver) {
System.out.println(-1);
} else {
System.out.println(ans);
}
/*
* 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。
long ans = 1l;
for (int i = 0; i < n; i++) {
long a = list.get(i);
ans *= a;
if (ans > 1000000000000000000l || ans <= 0) {
break;
}
}
if (ans > 1000000000000000000l || ans <= 0) {
//System.out.println(ans);
System.out.println(-1);
} else {
System.out.println(ans);
}
*/
/*
* 公式の模範解答を真似たけど、WA
long ans = 1l;
boolean isOver = false;
for (int i = 0; i < n; i++) {
long a = list.get(i);
if (Math.floor(10E+18 / ans) <= a) {
isOver = true;
break;
} else {
ans *= a;
}
}
if (isOver) {
System.out.println(-1);
} else {
System.out.println(ans);
}
*/
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
17,
30,
14,
2,
13,
2,
4,
18,
13,
17,
17,
13,
30,
14,
2,
13,
17,
0,
13,
13,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
79,
5
],
[
79,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
51,
55
],
[
50,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
47,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans = 1;",
"ans",
"1",
"for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }",
"{\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }",
"a == 0",
"a",
"0",
"{\n ans = 0;\n }",
"ans = 0",
"ans",
"0",
"{\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }",
"if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }",
"ans <= ((long)Math.pow(10, 18) / a)",
"ans",
"((long)Math.pow(10, 18) / a)",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"a",
"{\n if(ans >= 0) ans *= a;\n }",
"if(ans >= 0) ans *= a;",
"ans >= 0",
"ans",
"0",
"ans *= a",
"ans",
"a",
"{\n ans = -1;\n }",
"ans = -1",
"ans",
"-1",
"1",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long ans = 1;\n for(int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if(a == 0) {\n ans = 0;\n } else {\n if(ans <= ((long)Math.pow(10, 18) / a)) {\n if(ans >= 0) ans *= a;\n } else {\n ans = -1;\n }\n }\n }\n System.out.println(ans);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 1;
for(int i = 0; i < n; i++) {
long a = sc.nextLong();
if(a == 0) {
ans = 0;
} else {
if(ans <= ((long)Math.pow(10, 18) / a)) {
if(ans >= 0) ans *= a;
} else {
ans = -1;
}
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
17,
18,
13,
13,
0,
13,
2,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
392,
20
],
[
392,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
392,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
31,
40
],
[
40,
41
],
[
40,
42
],
[
31,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
31,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
31,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
73,
80
],
[
31,
81
],
[
81,
82
],
[
81,
83
],
[
31,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
97,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
112,
120
],
[
31,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
392,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
127,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
141,
148
],
[
148,
149
],
[
148,
150
],
[
141,
152
],
[
152,
153
],
[
152,
154
],
[
141,
155
],
[
155,
156
],
[
155,
157
],
[
141,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
161,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
172,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
168,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
190,
191
],
[
191,
192
],
[
160,
193
],
[
193,
194
],
[
141,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
198,
206
],
[
206,
207
],
[
207,
208
],
[
141,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
217,
218
],
[
217,
219
],
[
209,
220
],
[
220,
221
],
[
141,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
226,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
232,
234
],
[
225,
235
],
[
235,
236
],
[
224,
237
],
[
237,
238
],
[
238,
239
],
[
141,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
243,
247
],
[
247,
248
],
[
242,
249
],
[
249,
250
],
[
249,
251
],
[
242,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
242,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
261,
264
],
[
260,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
242,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
141,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
276,
280
],
[
280,
281
],
[
275,
282
],
[
282,
283
],
[
282,
284
],
[
275,
285
],
[
285,
286
],
[
285,
287
],
[
275,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
275,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
292,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
275,
304
],
[
304,
305
],
[
305,
306
],
[
306,
307
],
[
306,
308
],
[
305,
309
],
[
309,
310
],
[
309,
311
],
[
304,
312
],
[
312,
313
],
[
313,
314
],
[
275,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
320,
321
],
[
320,
322
],
[
319,
323
],
[
323,
324
],
[
323,
325
],
[
318,
326
],
[
326,
327
],
[
327,
328
],
[
327,
329
],
[
326,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
332,
334
],
[
318,
335
],
[
335,
336
],
[
336,
337
],
[
337,
338
],
[
337,
339
],
[
339,
340
],
[
336,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
335,
345
],
[
345,
346
],
[
346,
347
],
[
347,
348
],
[
347,
349
],
[
349,
350
],
[
347,
351
],
[
335,
352
],
[
352,
353
],
[
353,
354
],
[
317,
355
],
[
355,
356
],
[
355,
357
],
[
357,
358
],
[
141,
359
],
[
359,
360
],
[
359,
361
],
[
361,
362
],
[
362,
363
],
[
362,
364
],
[
364,
365
],
[
361,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
368,
370
],
[
370,
371
],
[
370,
372
],
[
367,
373
],
[
373,
374
],
[
373,
375
],
[
375,
376
],
[
375,
377
],
[
366,
378
],
[
378,
379
],
[
361,
380
],
[
380,
381
],
[
141,
382
],
[
382,
383
],
[
382,
384
],
[
384,
385
],
[
385,
386
],
[
386,
387
],
[
387,
388
],
[
386,
389
],
[
389,
390
],
[
0,
391
],
[
391,
392
],
[
391,
393
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.NoSuchElementException;\n\n\t\npublic class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n\t\n\tvoid run() {\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}\n\t\n\tvoid tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}\n}\n\nclass FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n \n public double nextDouble() { return Double.parseDouble(next());}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n\t\n\tvoid run() {\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}\n\t\n\tvoid tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}\n}",
"Main",
"public static void main(String[] args) {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"void run() {\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}",
"run",
"{\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}",
"FastScanner sc=new FastScanner();",
"sc",
"new FastScanner()",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A=new long[N];",
"A",
"new long[N]",
"N",
"for (int i=0;i<N;++i) A[i]=sc.nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"++i",
"++i",
"i",
"A[i]=sc.nextLong();",
"A[i]=sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"if (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"A[0]==0",
"A[0]",
"A",
"0",
"0",
"{\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long prd=1;",
"prd",
"1",
"for (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"++i",
"++i",
"i",
"{\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"prd<=((long)1e18)/A[i]",
"prd",
"((long)1e18)/A[i]",
"((long)1e18)",
"A[i]",
"A",
"i",
"prd=prd*A[i]",
"prd",
"prd*A[i]",
"prd",
"A[i]",
"A",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(prd)",
"System.out.println",
"System.out",
"System",
"System.out",
"prd",
"void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}",
"tr",
"{System.out.println(Arrays.deepToString(objects));}",
"System.out.println(Arrays.deepToString(objects))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.deepToString(objects)",
"Arrays.deepToString",
"Arrays",
"objects",
"Object...objects",
"objects",
"class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n \n public double nextDouble() { return Double.parseDouble(next());}\n}",
"FastScanner",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int ptr = 0;",
"ptr",
"0",
"private int buflen = 0;",
"buflen",
"0",
"private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"hasNextByte",
"{\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr < buflen",
"ptr",
"buflen",
"{\n return true;\n }",
"return true;",
"true",
"{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr = 0",
"ptr",
"0",
"try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n buflen = in.read(buffer);\n }",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (buflen <= 0) {\n return false;\n }",
"buflen <= 0",
"buflen",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}",
"readByte",
"{ if (hasNextByte()) return buffer[ptr++]; else return -1;}",
"if (hasNextByte()) return buffer[ptr++]; else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"return -1;",
"-1",
"1",
"private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}",
"isPrintableChar",
"{ return 33 <= c && c <= 126;}",
"return 33 <= c && c <= 126;",
"33 <= c && c <= 126",
"33 <= c",
"33",
"c",
"c <= 126",
"c",
"126",
"int c",
"c",
"public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}",
"hasNext",
"{ while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}",
"while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"ptr++",
"ptr",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"next",
"{\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n sb.appendCodePoint(b);\n b = readByte();\n }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"nextLong",
"{\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"true",
"{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n n *= 10;\n n += b - '0';\n }",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n return minus ? -n : n;\n }",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"nextInt",
"{\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"public double nextDouble() { return Double.parseDouble(next());}",
"nextDouble",
"{ return Double.parseDouble(next());}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n\t\n\tvoid run() {\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}\n\t\n\tvoid tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}\n}",
"public class Main{\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n\t\n\tvoid run() {\n\t\tFastScanner sc=new FastScanner();\n\t\tint N=sc.nextInt();\n\t\tlong[] A=new long[N];\n\t\tfor (int i=0;i<N;++i) A[i]=sc.nextLong();\n\t\tArrays.sort(A);\n\t\tif (A[0]==0) {\n\t\t\tSystem.out.println(0);\n\t\t\treturn;\n\t\t}\n\t\tlong prd=1;\n\t\tfor (int i=0;i<N;++i) {\n\t\t\tif (prd<=((long)1e18)/A[i]) prd=prd*A[i];\n\t\t\telse {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(prd);\n\t}\n\t\n\tvoid tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.NoSuchElementException;
public class Main{
public static void main(String[] args) {
new Main().run();
}
void run() {
FastScanner sc=new FastScanner();
int N=sc.nextInt();
long[] A=new long[N];
for (int i=0;i<N;++i) A[i]=sc.nextLong();
Arrays.sort(A);
if (A[0]==0) {
System.out.println(0);
return;
}
long prd=1;
for (int i=0;i<N;++i) {
if (prd<=((long)1e18)/A[i]) prd=prd*A[i];
else {
System.out.println(-1);
return;
}
}
System.out.println(prd);
}
void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) nl;
}
public double nextDouble() { return Double.parseDouble(next());}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
40,
17,
14,
2,
13,
17,
30,
0,
13,
17,
4,
18,
18,
13,
13,
17,
29,
14,
2,
13,
40,
17,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
94,
5
],
[
94,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
40,
50
],
[
39,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
38,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
38,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
65,
75
],
[
61,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
76,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
8,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
6,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
] |
[
"import java.util.*;\n\npublic class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main",
"static public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long aa=1L;",
"aa",
"1L",
"for(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L",
"Math.log10(a)+Math.log10(aa)>18",
"Math.log10(a)+Math.log10(aa)",
"Math.log10(a)",
"Math.log10",
"Math",
"a",
"Math.log10(aa)",
"Math.log10",
"Math",
"aa",
"18",
"aa*a>1000000000000000000L",
"aa*a",
"aa",
"a",
"1000000000000000000L",
"{\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}",
"aa=-1",
"aa",
"-1",
"1",
"if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"a==0",
"a",
"0",
"{\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}",
"aa*=0",
"aa",
"0",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"aa!=-1",
"aa",
"-1",
"1",
"{\n\t\t\t\taa*=a;\n\t\t\t}",
"aa*=a",
"aa",
"a",
"System.out.println(aa)",
"System.out.println",
"System.out",
"System",
"System.out",
"aa",
"String args[]",
"args",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t \n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n System.out.println(0);\n return;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
static public void main(String args[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
long aa=1L;
for(int i=0;i<n;i++){
long a=sc.nextLong();
if(Math.log10(a)+Math.log10(aa)>18||
aa*a>1000000000000000000L){
aa=-1;
}
else if(a==0){
aa*=0;
System.out.println(0);
return;
}
else if(aa!=-1){
aa*=a;
}
}
System.out.println(aa);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
40,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
133,
11
],
[
133,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
14,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
66,
73
],
[
14,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
14,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
104,
112
],
[
103,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
113,
121
],
[
121,
122
],
[
121,
123
],
[
14,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
12,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] |
[
"import java.util.Scanner;\nimport java.math.BigInteger;\nimport java.lang.Math;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.lang.Math;",
"Math",
"java.lang",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextLong();\n }",
"{\n a[i] = sc.nextLong();\n }",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k<n",
"k",
"n",
"k++",
"k++",
"k",
"{\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }",
"{\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }",
"if(a[k] == 0){\n System.out.println(0);\n return;\n }",
"a[k] == 0",
"a[k]",
"a",
"k",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"BigInteger mul = BigInteger.ONE;",
"mul",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }",
"{\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }",
"mul = mul.multiply(BigInteger.valueOf(a[j]))",
"mul",
"mul.multiply(BigInteger.valueOf(a[j]))",
"mul.multiply",
"mul",
"BigInteger.valueOf(a[j])",
"BigInteger.valueOf",
"BigInteger",
"a[j]",
"a",
"j",
"if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }",
"mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1",
"mul.compareTo(BigInteger.valueOf(1000000000000000000L))",
"mul.compareTo",
"mul",
"BigInteger.valueOf(1000000000000000000L)",
"BigInteger.valueOf",
"BigInteger",
"1000000000000000000L",
"1",
"{\n mul = BigInteger.valueOf(-1);\n j=n;\n }",
"mul = BigInteger.valueOf(-1)",
"mul",
"BigInteger.valueOf(-1)",
"BigInteger.valueOf",
"BigInteger",
"-1",
"1",
"j=n",
"j",
"n",
"System.out.println(mul)",
"System.out.println",
"System.out",
"System",
"System.out",
"mul",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n long[] a = new long[n];\n for(int i = 0; i<n; i++){\n a[i] = sc.nextLong();\n }\n\n for(int k = 0; k<n; k++){\n if(a[k] == 0){\n System.out.println(0);\n return;\n } \n }\n\n BigInteger mul = BigInteger.ONE;\n for(int j = 0; j<n; j++){\n mul = mul.multiply(BigInteger.valueOf(a[j]));\n if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){\n mul = BigInteger.valueOf(-1);\n j=n;\n }\n }\n System.out.println(mul);\n }\n}",
"Main"
] |
import java.util.Scanner;
import java.math.BigInteger;
import java.lang.Math;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
for(int i = 0; i<n; i++){
a[i] = sc.nextLong();
}
for(int k = 0; k<n; k++){
if(a[k] == 0){
System.out.println(0);
return;
}
}
BigInteger mul = BigInteger.ONE;
for(int j = 0; j<n; j++){
mul = mul.multiply(BigInteger.valueOf(a[j]));
if(mul.compareTo(BigInteger.valueOf(1000000000000000000L)) == 1){
mul = BigInteger.valueOf(-1);
j=n;
}
}
System.out.println(mul);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
4,
18,
13,
17,
13,
40,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
116,
8
],
[
116,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
50,
57
],
[
11,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
11,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
75,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
89,
95
],
[
88,
96
],
[
96,
97
],
[
87,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
98,
106
],
[
11,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
9,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] |
[
"import java.util.*;\nimport java.math.*;\n \npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }",
"{\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }",
"A[i] = sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (A[i] == 0) {\n System.out.println(0);\n return;\n }",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"BigInteger ans = BigInteger.ONE;",
"ans",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }",
"{\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }",
"ans = ans.multiply(BigInteger.valueOf(A[i]))",
"ans",
"ans.multiply(BigInteger.valueOf(A[i]))",
"ans.multiply",
"ans",
"BigInteger.valueOf(A[i])",
"BigInteger.valueOf",
"BigInteger",
"A[i]",
"A",
"i",
"if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }",
"BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1",
"BigInteger.valueOf(1000000000000000000L).compareTo(ans)",
"BigInteger.valueOf(1000000000000000000L).compareTo",
"BigInteger.valueOf(1000000000000000000L)",
"BigInteger.valueOf",
"BigInteger",
"1000000000000000000L",
"ans",
"-1",
"1",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n\n long[] A = new long[N];\n for (int i = 0; i < N ;i++) {\n A[i] = sc.nextLong();\n if (A[i] == 0) {\n System.out.println(0);\n return;\n }\n }\n\n BigInteger ans = BigInteger.ONE;\n for (int i = 0; i < N ;i++) {\n ans = ans.multiply(BigInteger.valueOf(A[i]));\n if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(ans);\n }\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[] A = new long[N];
for (int i = 0; i < N ;i++) {
A[i] = sc.nextLong();
if (A[i] == 0) {
System.out.println(0);
return;
}
}
BigInteger ans = BigInteger.ONE;
for (int i = 0; i < N ;i++) {
ans = ans.multiply(BigInteger.valueOf(A[i]));
if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {
System.out.println(-1);
return;
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
3,
14,
2,
18,
13,
13,
2,
4,
18,
13,
17,
17,
13,
30,
0,
13,
40,
17,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
74,
78
],
[
73,
79
],
[
68,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
68,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
8,
97
],
[
97,
98
],
[
98,
99
],
[
6,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int N = stdIn.nextInt();",
"N",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"long ans = 1;",
"ans",
"1",
"long []A = new long[N];",
"A",
"new long[N]",
"N",
"for(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < N",
"a",
"N",
"a++",
"a++",
"a",
"{\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}",
"{\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}",
"A[a] = stdIn.nextLong()",
"A[a]",
"A",
"a",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"for(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b < N",
"b",
"N",
"b++",
"b++",
"b",
"{\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}",
"if(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}",
"A[b] == 0",
"A[b]",
"A",
"b",
"0",
"{\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}",
"ans = 0",
"ans",
"0",
"break;",
"if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}",
"A[b] > (long)Math.pow(10, 18)/ans",
"A[b]",
"A",
"b",
"(long)Math.pow(10, 18)/ans",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"ans",
"{\n\t\t\t\tans = -1;\n\t\t\t}",
"ans = -1",
"ans",
"-1",
"1",
"{\n\t\t\t\tans *= A[b];\n\t\t\t}",
"ans *= A[b]",
"ans",
"A[b]",
"A",
"b",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"stdIn.close()",
"stdIn.close",
"stdIn",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tlong ans = 1;\n\t\tlong []A = new long[N];\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tA[a] = stdIn.nextLong();\n\t\t}\n\t\tfor(int b = 0; b < N; b++){\n\t\t\tif(A[b] == 0){\n\t\t\t\tans = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(A[b] > (long)Math.pow(10, 18)/ans){\n\t\t\t\tans = -1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tans *= A[b];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tstdIn.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int N = stdIn.nextInt();
long ans = 1;
long []A = new long[N];
for(int a = 0; a < N; a++){
A[a] = stdIn.nextLong();
}
for(int b = 0; b < N; b++){
if(A[b] == 0){
ans = 0;
break;
}
else if(A[b] > (long)Math.pow(10, 18)/ans){
ans = -1;
}
else{
ans *= A[b];
}
}
System.out.println(ans);
stdIn.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
17,
17,
14,
2,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
104,
8
],
[
104,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
11,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
50,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
61,
68
],
[
11,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
83,
91
],
[
76,
92
],
[
92,
93
],
[
92,
94
],
[
11,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
9,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] |
[
"import java.util.Arrays;\nimport java.util.Scanner;\n \npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long a[] = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextLong();\n }",
"{\n a[i] = sc.nextLong();\n }",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"final long K = (long) Math.pow(10, 18);",
"K",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"if (a[0] == 0) {\n System.out.println(0);\n return;\n }",
"a[0] == 0",
"a[0]",
"a",
"0",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long result = 1;",
"result",
"1",
"for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }",
"long l",
"a",
"{\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }",
"{\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }",
"if (result > K / l) {\n System.out.println(-1);\n return;\n }",
"result > K / l",
"result",
"K / l",
"K",
"l",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"result *= l",
"result",
"l",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n //入力\n \tint n = sc.nextInt();\n long a[] = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n \t\t//0を見つけたいので昇順にソート\n Arrays.sort(a);\n \t\t//10の18乗\n final long K = (long) Math.pow(10, 18);\n \t\t//0があるとき\n if (a[0] == 0) {\n System.out.println(0);\n return;\n }\n \n long result = 1;\n \t//取り出した値を格納する変数:順に取り出したい配列\n for (long l : a) {\n if (result > K / l) {\n System.out.println(-1);\n return;\n }\n //取り出した値を掛ける\n result *= l;\n }\n System.out.println(result);\n \n }\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//入力
int n = sc.nextInt();
long a[] = new long[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextLong();
}
//0を見つけたいので昇順にソート
Arrays.sort(a);
//10の18乗
final long K = (long) Math.pow(10, 18);
//0があるとき
if (a[0] == 0) {
System.out.println(0);
return;
}
long result = 1;
//取り出した値を格納する変数:順に取り出したい配列
for (long l : a) {
if (result > K / l) {
System.out.println(-1);
return;
}
//取り出した値を掛ける
result *= l;
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
13,
17,
0,
13,
17,
14,
2,
13,
17,
9,
0,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
17,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
14,
2,
2,
4,
18,
13,
13,
17,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
121,
8
],
[
121,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
11,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
47,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
53,
60
],
[
60,
61
],
[
60,
62
],
[
47,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
47,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
47,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
75,
80
],
[
74,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
11,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
97,
102
],
[
96,
103
],
[
103,
104
],
[
103,
105
],
[
95,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
95,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
9,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] |
[
"import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"BigInteger N=new BigInteger(\"1000000000000000000\");",
"N",
"new BigInteger(\"1000000000000000000\")",
"BigInteger ans=new BigInteger(\"1\");",
"ans",
"new BigInteger(\"1\")",
"BigInteger n0=new BigInteger(\"0\");",
"n0",
"new BigInteger(\"0\")",
"int flag=1;",
"flag",
"1",
"int num=1;",
"num",
"1",
"for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"++i",
"++i",
"i",
"{\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }",
"{\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }",
"BigInteger x=sc.nextBigInteger();",
"x",
"sc.nextBigInteger()",
"sc.nextBigInteger",
"sc",
"if(x.compareTo(n0)==0) num=0;",
"x.compareTo(n0)==0",
"x.compareTo(n0)",
"x.compareTo",
"x",
"n0",
"0",
"num=0",
"num",
"0",
"if(flag==0) continue;",
"flag==0",
"flag",
"0",
"continue;",
"ans=ans.multiply(x)",
"ans",
"ans.multiply(x)",
"ans.multiply",
"ans",
"x",
"if(ans.compareTo(N)>0) {\n flag=0;\n }",
"ans.compareTo(N)>0",
"ans.compareTo(N)",
"ans.compareTo",
"ans",
"N",
"0",
"{\n flag=0;\n }",
"flag=0",
"flag",
"0",
"if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);",
"num==0",
"num",
"0",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);",
"ans.compareTo(N)>0||flag==0",
"ans.compareTo(N)>0",
"ans.compareTo(N)",
"ans.compareTo",
"ans",
"N",
"0",
"flag==0",
"flag",
"0",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }\n}",
"public class Main {\n public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n BigInteger N=new BigInteger(\"1000000000000000000\");\n BigInteger ans=new BigInteger(\"1\");\n BigInteger n0=new BigInteger(\"0\");\n\n\n int flag=1;\n int num=1;\n for(int i=1;i<=n;++i){\n BigInteger x=sc.nextBigInteger();\n if(x.compareTo(n0)==0) num=0;\n if(flag==0) continue;\n ans=ans.multiply(x);\n if(ans.compareTo(N)>0) {\n flag=0;\n }\n }\n\n if(num==0) System.out.println(0);\n else if(ans.compareTo(N)>0||flag==0) System.out.println(\"-1\");\n else System.out.println(ans);\n }\n}",
"Main"
] |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
BigInteger N=new BigInteger("1000000000000000000");
BigInteger ans=new BigInteger("1");
BigInteger n0=new BigInteger("0");
int flag=1;
int num=1;
for(int i=1;i<=n;++i){
BigInteger x=sc.nextBigInteger();
if(x.compareTo(n0)==0) num=0;
if(flag==0) continue;
ans=ans.multiply(x);
if(ans.compareTo(N)>0) {
flag=0;
}
}
if(num==0) System.out.println(0);
else if(ans.compareTo(N)>0||flag==0) System.out.println("-1");
else System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
17,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
40,
17,
3,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
149,
11
],
[
149,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
14,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
14,
51
],
[
51,
52
],
[
51,
53
],
[
14,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
14,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
14,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
14,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
94,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
94,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
110,
115
],
[
109,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
116,
124
],
[
14,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
14,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
12,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] |
[
"import java.util.*;\nimport java.math.RoundingMode;\nimport java.math.BigDecimal;\n \n \n \npublic class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i]= sc.nextLong();\n\t\t}",
"{\n\t\t\ta[i]= sc.nextLong();\n\t\t}",
"a[i]= sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"long max = 1;",
"max",
"1",
"for(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < 18",
"i",
"18",
"i++",
"i++",
"i",
"{\n\t\t\tmax*=10;\n\t\t}",
"{\n\t\t\tmax*=10;\n\t\t}",
"max*=10",
"max",
"10",
"BigDecimal max1 = BigDecimal.valueOf(max);",
"max1",
"BigDecimal.valueOf(max)",
"BigDecimal.valueOf",
"BigDecimal",
"max",
"BigDecimal ans = BigDecimal.valueOf(1);",
"ans",
"BigDecimal.valueOf(1)",
"BigDecimal.valueOf",
"BigDecimal",
"1",
"for(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"BigDecimal a1 = BigDecimal.valueOf(a[i]);",
"a1",
"BigDecimal.valueOf(a[i])",
"BigDecimal.valueOf",
"BigDecimal",
"a[i]",
"a",
"i",
"ans = ans.multiply(a1)",
"ans",
"ans.multiply(a1)",
"ans.multiply",
"ans",
"a1",
"if(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}",
"ans.compareTo(max1)>0",
"ans.compareTo(max1)",
"ans.compareTo",
"ans",
"max1",
"0",
"{\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}",
"ans = BigDecimal.valueOf(-1)",
"ans",
"BigDecimal.valueOf(-1)",
"BigDecimal.valueOf",
"BigDecimal",
"-1",
"1",
"break;",
"if(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}",
"ans.compareTo(max1)>0",
"ans.compareTo(max1)",
"ans.compareTo",
"ans",
"max1",
"0",
"{\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}",
"ans = BigDecimal.valueOf(-1)",
"ans",
"BigDecimal.valueOf(-1)",
"BigDecimal.valueOf",
"BigDecimal",
"-1",
"1",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }\n}",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i]= sc.nextLong();\n\t\t}\n\t\tArrays.sort(a);\n\t\tlong max = 1;\n\t\tfor(int i = 0; i < 18; i++) {\n\t\t\tmax*=10;\n\t\t}\n\t\tBigDecimal max1 = BigDecimal.valueOf(max);\n\t\tBigDecimal ans = BigDecimal.valueOf(1);\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tBigDecimal a1 = BigDecimal.valueOf(a[i]);\n\t\t\tans = ans.multiply(a1);\n\t\t\tif(ans.compareTo(max1)>0) {\n\t\t\t\tans = BigDecimal.valueOf(-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ans.compareTo(max1)>0) {\n\t\t\tans = BigDecimal.valueOf(-1);\n\t\t}\n\t\tSystem.out.println(ans);\n\t }\n}",
"Main"
] |
import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
for(int i = 0; i < n; i++) {
a[i]= sc.nextLong();
}
Arrays.sort(a);
long max = 1;
for(int i = 0; i < 18; i++) {
max*=10;
}
BigDecimal max1 = BigDecimal.valueOf(max);
BigDecimal ans = BigDecimal.valueOf(1);
for(int i = 0; i < n; i++) {
BigDecimal a1 = BigDecimal.valueOf(a[i]);
ans = ans.multiply(a1);
if(ans.compareTo(max1)>0) {
ans = BigDecimal.valueOf(-1);
break;
}
}
if(ans.compareTo(max1)>0) {
ans = BigDecimal.valueOf(-1);
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
40,
13,
30,
0,
13,
13,
14,
2,
2,
13,
13,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
38,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
38,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 1;",
"sum",
"1",
"long max = 1000000000000000000L;",
"max",
"1000000000000000000L",
"boolean isMax = false;",
"isMax",
"false",
"for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }",
"{\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a== 0) {\n sum = 0;\n break;\n }",
"a== 0",
"a",
"0",
"{\n sum = 0;\n break;\n }",
"sum = 0",
"sum",
"0",
"break;",
"if (!isMax) {\n sum *= a;\n }",
"!isMax",
"isMax",
"{\n sum *= a;\n }",
"sum *= a",
"sum",
"a",
"if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }",
"sum > max || sum == 0",
"sum > max",
"sum",
"max",
"sum == 0",
"sum",
"0",
"{\n sum = -1;\n isMax = true;\n }",
"sum = -1",
"sum",
"-1",
"1",
"isMax = true",
"isMax",
"true",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long sum = 1;\n long max = 1000000000000000000L;\n boolean isMax = false;\n\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n if (a== 0) {\n sum = 0;\n break;\n }\n if (!isMax) {\n sum *= a;\n }\n if (sum > max || sum == 0) {\n sum = -1;\n isMax = true;\n }\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long sum = 1;
long max = 1000000000000000000L;
boolean isMax = false;
for (int i = 0; i < n; i++) {
long a = sc.nextLong();
if (a== 0) {
sum = 0;
break;
}
if (!isMax) {
sum *= a;
}
if (sum > max || sum == 0) {
sum = -1;
isMax = true;
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
4,
18,
18,
13,
13,
17,
30,
0,
13,
17,
14,
13,
30,
0,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
14,
2,
4,
18,
13,
13,
17,
30,
14,
2,
4,
18,
4,
18,
13,
13,
13,
17,
30,
0,
13,
4,
18,
13,
13,
30,
0,
13,
13,
3,
30,
0,
13,
13,
3,
4,
18,
13,
14,
2,
4,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
11,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
59,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
11,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
94,
99
],
[
93,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
103,
109
],
[
102,
110
],
[
101,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
101,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
93,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
11,
128
],
[
128,
129
],
[
129,
130
],
[
11,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
132,
137
],
[
137,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
131,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
153,
154
],
[
9,
155
],
[
155,
156
]
] |
[
"import java.util.*;\nimport java.math.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int N = sc.nextInt();\n\t\tBigInteger ans = new BigInteger(\"1\");\n\t\tfinal BigInteger TEN_EIGHTEEN = new BigInteger(\"1000000000000000000\");\n\t\tfinal BigInteger ZERO = new BigInteger(\"0\");\n\t\tfinal BigInteger OVER = new BigInteger(\"-1\");\n\t\tString[] s = new String[N];\n\t\tBoolean flag_z = false;\n\t\tfor (int i = 0; i < N; ++i) {\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}\n\t\tif (flag_z) {\n\t\t\tans = ZERO;\n\t\t} else {\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\" \"+ans.toString());\n\t\tsc.close();\n\t\tif (ans.compareTo(ZERO) == -1) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}else{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int N = sc.nextInt();\n\t\tBigInteger ans = new BigInteger(\"1\");\n\t\tfinal BigInteger TEN_EIGHTEEN = new BigInteger(\"1000000000000000000\");\n\t\tfinal BigInteger ZERO = new BigInteger(\"0\");\n\t\tfinal BigInteger OVER = new BigInteger(\"-1\");\n\t\tString[] s = new String[N];\n\t\tBoolean flag_z = false;\n\t\tfor (int i = 0; i < N; ++i) {\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}\n\t\tif (flag_z) {\n\t\t\tans = ZERO;\n\t\t} else {\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\" \"+ans.toString());\n\t\tsc.close();\n\t\tif (ans.compareTo(ZERO) == -1) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}else{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int N = sc.nextInt();\n\t\tBigInteger ans = new BigInteger(\"1\");\n\t\tfinal BigInteger TEN_EIGHTEEN = new BigInteger(\"1000000000000000000\");\n\t\tfinal BigInteger ZERO = new BigInteger(\"0\");\n\t\tfinal BigInteger OVER = new BigInteger(\"-1\");\n\t\tString[] s = new String[N];\n\t\tBoolean flag_z = false;\n\t\tfor (int i = 0; i < N; ++i) {\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}\n\t\tif (flag_z) {\n\t\t\tans = ZERO;\n\t\t} else {\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\" \"+ans.toString());\n\t\tsc.close();\n\t\tif (ans.compareTo(ZERO) == -1) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}else{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int N = sc.nextInt();\n\t\tBigInteger ans = new BigInteger(\"1\");\n\t\tfinal BigInteger TEN_EIGHTEEN = new BigInteger(\"1000000000000000000\");\n\t\tfinal BigInteger ZERO = new BigInteger(\"0\");\n\t\tfinal BigInteger OVER = new BigInteger(\"-1\");\n\t\tString[] s = new String[N];\n\t\tBoolean flag_z = false;\n\t\tfor (int i = 0; i < N; ++i) {\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}\n\t\tif (flag_z) {\n\t\t\tans = ZERO;\n\t\t} else {\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\" \"+ans.toString());\n\t\tsc.close();\n\t\tif (ans.compareTo(ZERO) == -1) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}else{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"final int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"BigInteger ans = new BigInteger(\"1\");",
"ans",
"new BigInteger(\"1\")",
"final BigInteger TEN_EIGHTEEN = new BigInteger(\"1000000000000000000\");",
"TEN_EIGHTEEN",
"new BigInteger(\"1000000000000000000\")",
"final BigInteger ZERO = new BigInteger(\"0\");",
"ZERO",
"new BigInteger(\"0\")",
"final BigInteger OVER = new BigInteger(\"-1\");",
"OVER",
"new BigInteger(\"-1\")",
"String[] s = new String[N];",
"s",
"new String[N]",
"N",
"Boolean flag_z = false;",
"flag_z",
"false",
"for (int i = 0; i < N; ++i) {\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"++i",
"++i",
"i",
"{\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}",
"{\n\t\t\ts[i] = sc.next();\n\t\t\tif (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}\n\t\t}",
"s[i] = sc.next()",
"s[i]",
"s",
"i",
"sc.next()",
"sc.next",
"sc",
"if (s[i].equals(\"0\")) {\n\t\t\t\tflag_z = true;\n\t\t\t}",
"s[i].equals(\"0\")",
"s[i].equals",
"s[i]",
"s",
"i",
"\"0\"",
"{\n\t\t\t\tflag_z = true;\n\t\t\t}",
"flag_z = true",
"flag_z",
"true",
"if (flag_z) {\n\t\t\tans = ZERO;\n\t\t} else {\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"flag_z",
"{\n\t\t\tans = ZERO;\n\t\t}",
"ans = ZERO",
"ans",
"ZERO",
"{\n\t\t\tfor (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int i = 0; i < N; ++i) {\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"++i",
"++i",
"i",
"{\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tBigInteger A = new BigInteger(s[i]);\n\t\t\t\tif (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"BigInteger A = new BigInteger(s[i]);",
"A",
"new BigInteger(s[i])",
"if (A.compareTo(ZERO) != 0) {\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"A.compareTo(ZERO) != 0",
"A.compareTo(ZERO)",
"A.compareTo",
"A",
"ZERO",
"0",
"{\n\t\t\t\t\tif (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0",
"ans.multiply(A).compareTo(TEN_EIGHTEEN)",
"ans.multiply(A).compareTo",
"ans.multiply(A)",
"ans.multiply",
"ans",
"A",
"TEN_EIGHTEEN",
"0",
"{\n\t\t\t\t\t\tans = ans.multiply(A);\n\t\t\t\t\t}",
"ans = ans.multiply(A)",
"ans",
"ans.multiply(A)",
"ans.multiply",
"ans",
"A",
"{\n\t\t\t\t\t\tans = OVER;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"ans = OVER",
"ans",
"OVER",
"break;",
"{\n\t\t\t\t\tans = ZERO;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"ans = ZERO",
"ans",
"ZERO",
"break;",
"sc.close()",
"sc.close",
"sc",
"if (ans.compareTo(ZERO) == -1) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}else{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}",
"ans.compareTo(ZERO) == -1",
"ans.compareTo(ZERO)",
"ans.compareTo",
"ans",
"ZERO",
"-1",
"1",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println(ans.toString());\n\t\t}",
"System.out.println(ans.toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.toString()",
"ans.toString",
"ans",
"String[] args",
"args"
] |
import java.util.*;
import java.math.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
final int N = sc.nextInt();
BigInteger ans = new BigInteger("1");
final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
final BigInteger ZERO = new BigInteger("0");
final BigInteger OVER = new BigInteger("-1");
String[] s = new String[N];
Boolean flag_z = false;
for (int i = 0; i < N; ++i) {
s[i] = sc.next();
if (s[i].equals("0")) {
flag_z = true;
}
}
if (flag_z) {
ans = ZERO;
} else {
for (int i = 0; i < N; ++i) {
BigInteger A = new BigInteger(s[i]);
if (A.compareTo(ZERO) != 0) {
if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
ans = ans.multiply(A);
} else {
ans = OVER;
break;
}
} else {
ans = ZERO;
break;
}
}
}
// System.out.println(" "+ans.toString());
sc.close();
if (ans.compareTo(ZERO) == -1) {
System.out.println("-1");
}else{
System.out.println(ans.toString());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
38,
5,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
41,
13,
17,
41,
13,
17,
0,
13,
4,
18,
13,
17,
17,
0,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
132,
5
],
[
132,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
8,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
58,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
69,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
78,
82
],
[
69,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
85,
89
],
[
69,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
90,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
105,
109
],
[
109,
110
],
[
109,
111
],
[
69,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
112,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
6,
129
],
[
129,
130
],
[
0,
131
],
[
131,
132
],
[
131,
133
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)throws Exception{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}",
"Scanner stdIn=new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int N=stdIn.nextInt();",
"N",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"long A[]=new long[N];",
"A",
"new long[N]",
"N",
"for(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"{\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"A[i]=stdIn.nextLong()",
"A[i]",
"A",
"i",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"if(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"A[i]==0",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"System.exit(0)",
"System.exit",
"System",
"0",
"try{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}",
"catch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}",
"Exception e",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}",
"long sum=1",
"sum",
"1",
"key=1;",
"key",
"1",
"key*=Math.pow(10,9)",
"key",
"Math.pow(10,9)",
"Math.pow",
"Math",
"10",
"9",
"key*=Math.pow(10,9)",
"key",
"Math.pow(10,9)",
"Math.pow",
"Math",
"10",
"9",
"for(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}",
"{\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}",
"sum=Math.multiplyExact(sum,A[i])",
"sum",
"Math.multiplyExact(sum,A[i])",
"Math.multiplyExact",
"Math",
"sum",
"A[i]",
"A",
"i",
"if(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);",
"sum>key",
"sum",
"key",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint N=stdIn.nextInt();\n\t\tlong A[]=new long[N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tA[i]=stdIn.nextLong();\n\t\t\tif(A[i]==0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\ttry{\n\t\t\tlong sum=1,key=1;\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tkey*=Math.pow(10,9);\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tsum=Math.multiplyExact(sum,A[i]);\n\t\t\t}\n\t\t\tif(sum>key)\n\t\t\t\tSystem.out.println(-1);\n\t\t\telse\n\t\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args)throws Exception{
Scanner stdIn=new Scanner(System.in);
int N=stdIn.nextInt();
long A[]=new long[N];
for(int i=0;i<N;i++){
A[i]=stdIn.nextLong();
if(A[i]==0){
System.out.println(0);
System.exit(0);
}
}
try{
long sum=1,key=1;
key*=Math.pow(10,9);
key*=Math.pow(10,9);
for(int i=0;i<N;i++){
sum=Math.multiplyExact(sum,A[i]);
}
if(sum>key)
System.out.println(-1);
else
System.out.println(sum);
}
catch(Exception e){
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
14,
2,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
20,
17,
30,
0,
13,
17,
30,
0,
13,
20,
3,
41,
13,
4,
18,
13,
20,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
110,
8
],
[
110,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
64,
69
],
[
63,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
44,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
11,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
11,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
85,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
11,
104
],
[
104,
105
],
[
105,
106
],
[
9,
107
],
[
107,
108
],
[
0,
109
],
[
109,
110
],
[
109,
111
]
] |
[
"import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}\n\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}",
"Scanner kb = new Scanner(System.in);",
"kb",
"new Scanner(System.in)",
"BigInteger count = new BigInteger(\"1\");",
"count",
"new BigInteger(\"1\")",
"int n = kb.nextInt();",
"n",
"kb.nextInt()",
"kb.nextInt",
"kb",
"boolean t = true;",
"t",
"true",
"for (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"long j = kb.nextLong();",
"j",
"kb.nextLong()",
"kb.nextLong",
"kb",
"if (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}",
"j != 0",
"j",
"0",
"{\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"if (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"t == true",
"t",
"true",
"{\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"count = count.multiply(BigInteger.valueOf(j))",
"count",
"count.multiply(BigInteger.valueOf(j))",
"count.multiply",
"count",
"BigInteger.valueOf(j)",
"BigInteger.valueOf",
"BigInteger",
"j",
"if (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}",
"count.compareTo(new BigInteger(\"1000000000000000000\")) == 1",
"count.compareTo(new BigInteger(\"1000000000000000000\"))",
"count.compareTo",
"count",
"new BigInteger(\"1000000000000000000\")",
"1",
"{\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}",
"t = false",
"t",
"false",
"{\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}",
"count = new BigInteger(\"0\")",
"count",
"new BigInteger(\"0\")",
"break;",
"int res = count.compareTo(new BigInteger(\"1000000000000000000\"));",
"res",
"count.compareTo(new BigInteger(\"1000000000000000000\"))",
"count.compareTo",
"count",
"new BigInteger(\"1000000000000000000\")",
"if (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}",
"res == 1",
"res",
"1",
"{\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(count);\n\t\t}",
"System.out.println(count)",
"System.out.println",
"System.out",
"System",
"System.out",
"count",
"kb.close()",
"kb.close",
"kb",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tBigInteger count = new BigInteger(\"1\");\n\t\tint n = kb.nextInt();\n\t\tboolean t = true;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong j = kb.nextLong();\n\t\t\tif (j != 0) {\n\t\t\t\tif (t == true) {\n\t\t\t\t\tcount = count.multiply(BigInteger.valueOf(j));\n\t\t\t\t\tif (count.compareTo(new BigInteger(\"1000000000000000000\")) == 1) {\n\t\t\t\t\t\t// System.out.println(\"k\");\n\t\t\t\t\t\tt = false;\n//\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcount = new BigInteger(\"0\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tint res = count.compareTo(new BigInteger(\"1000000000000000000\"));\n\t\tif (res == 1) {\n\t\t\t// System.out.println(res);\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(count);\n\t\t}\n\n\t\tkb.close();\n\t}\n\n}",
"Main"
] |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner kb = new Scanner(System.in);
BigInteger count = new BigInteger("1");
int n = kb.nextInt();
boolean t = true;
for (int i = 0; i < n; i++) {
long j = kb.nextLong();
if (j != 0) {
if (t == true) {
count = count.multiply(BigInteger.valueOf(j));
if (count.compareTo(new BigInteger("1000000000000000000")) == 1) {
// System.out.println("k");
t = false;
// break;
}
}
} else {
count = new BigInteger("0");
break;
}
}
int res = count.compareTo(new BigInteger("1000000000000000000"));
if (res == 1) {
// System.out.println(res);
System.out.println(-1);
} else {
System.out.println(count);
}
kb.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
29,
41,
13,
17,
28,
13,
13,
30,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
29,
30,
0,
13,
4,
18,
13,
13,
13,
14,
2,
13,
4,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
29,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
121,
5
],
[
121,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
47,
57
],
[
8,
58
],
[
58,
59
],
[
58,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
66,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
84,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
92,
96
],
[
89,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
97,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
8,
115
],
[
115,
116
],
[
116,
117
],
[
6,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"for (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"A[i] = sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"sc.close()",
"sc.close",
"sc",
"return;",
"long product = 1;",
"product",
"1",
"for (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"long a",
"A",
"{\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"sc.close()",
"sc.close",
"sc",
"return;",
"{\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}",
"product = Math.multiplyExact(product, a)",
"product",
"Math.multiplyExact(product, a)",
"Math.multiplyExact",
"Math",
"product",
"a",
"if (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}",
"product > (long) Math.pow(10, 18)",
"product",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"{\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"sc.close()",
"sc.close",
"sc",
"return;",
"System.out.println(product)",
"System.out.println",
"System.out",
"System",
"System.out",
"product",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t\tif (A[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong product = 1;\n\t\tfor (long a : A) {\n\t\t\ttry {\n\t\t\t\tproduct = Math.multiplyExact(product, a);\n\n\t\t\t\tif (product > (long) Math.pow(10, 18)) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tsc.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// 結果の出力\n\t\tSystem.out.println(product);\n\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 入力値の取得
int N = sc.nextInt();
long[] A = new long[N];
for (int i = 0; i < N; i++) {
A[i] = sc.nextLong();
if (A[i] == 0) {
System.out.println(0);
sc.close();
return;
}
}
long product = 1;
for (long a : A) {
try {
product = Math.multiplyExact(product, a);
if (product > (long) Math.pow(10, 18)) {
System.out.println(-1);
sc.close();
return;
}
} catch (Exception e) {
System.out.println(-1);
sc.close();
return;
}
}
// 結果の出力
System.out.println(product);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
40,
13,
30,
14,
2,
13,
17,
30,
0,
13,
17,
14,
40,
13,
30,
41,
13,
20,
0,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
0,
13,
17,
14,
13,
30,
4,
18,
18,
13,
13,
17,
14,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
118,
8
],
[
118,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
53,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
65,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
65,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
11,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
89,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
9,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"import java.math.BigDecimal;\nimport java.util.Scanner;\n \npublic class Main {\n \n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n \n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"BigDecimal ans = new BigDecimal(1);",
"ans",
"new BigDecimal(1)",
"BigDecimal over = new BigDecimal(1000000000000000000L);",
"over",
"new BigDecimal(1000000000000000000L)",
"boolean ov = false;",
"ov",
"false",
"boolean ze = false;",
"ze",
"false",
"for (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"long Ai = sc.nextLong();",
"Ai",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"!ze",
"ze",
"{\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"if (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}",
"Ai == 0",
"Ai",
"0",
"{\n\t\t\t\t\tze = true;\n\t\t\t\t}",
"ze = true",
"ze",
"true",
"if (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}",
"!ov",
"ov",
"{\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}",
"BigDecimal bd = new BigDecimal(Ai);",
"bd",
"new BigDecimal(Ai)",
"ans = ans.multiply(bd)",
"ans",
"ans.multiply(bd)",
"ans.multiply",
"ans",
"bd",
"int ju = ans.compareTo(over);",
"ju",
"ans.compareTo(over)",
"ans.compareTo",
"ans",
"over",
"if (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}",
"ju == 1",
"ju",
"1",
"{\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}",
"ov = true",
"ov",
"true",
"if (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}",
"ze",
"{\n\t\t\tSystem.out.println(0);\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}",
"ov",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(ans);\n\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n \n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"public class Main {\n \n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tBigDecimal ans = new BigDecimal(1);\n\t\tBigDecimal over = new BigDecimal(1000000000000000000L);\n\t\tboolean ov = false;\n\t\tboolean ze = false;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlong Ai = sc.nextLong();\n\t\t\tif (!ze) {\n\t\t\t\tif (Ai == 0) {\n\t\t\t\t\tze = true;\n\t\t\t\t}\n\t\t\t\tif (!ov) {\n\t\t\t\t\tBigDecimal bd = new BigDecimal(Ai);\n\t\t\t\t\tans = ans.multiply(bd);\n\t\t\t\t\tint ju = ans.compareTo(over);\n\t\t\t\t\tif (ju == 1) {\n\t\t\t\t\t\tov = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (ze) {\n\t\t\tSystem.out.println(0);\n\t\t} else if (ov) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
BigDecimal ans = new BigDecimal(1);
BigDecimal over = new BigDecimal(1000000000000000000L);
boolean ov = false;
boolean ze = false;
for (int i = 0; i < N; i++) {
long Ai = sc.nextLong();
if (!ze) {
if (Ai == 0) {
ze = true;
}
if (!ov) {
BigDecimal bd = new BigDecimal(Ai);
ans = ans.multiply(bd);
int ju = ans.compareTo(over);
if (ju == 1) {
ov = true;
}
}
}
}
if (ze) {
System.out.println(0);
} else if (ov) {
System.out.println(-1);
} else {
System.out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
17,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
30,
29,
18,
13,
40,
13,
30,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
38,
5,
13,
30,
30,
4,
18,
13,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
7,
12
],
[
12,
13
],
[
12,
14
],
[
7,
15
],
[
15,
16
],
[
15,
17
],
[
7,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
62,
69
],
[
20,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
91,
99
],
[
82,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
20,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
20,
111
],
[
111,
112
],
[
112,
113
],
[
18,
114
],
[
114,
115
],
[
0,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
116,
123
],
[
123,
124
],
[
123,
125
],
[
116,
127
],
[
127,
128
],
[
127,
129
],
[
116,
130
],
[
130,
131
],
[
130,
132
],
[
116,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
140,
141
],
[
141,
142
],
[
136,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
147,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
143,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
135,
168
],
[
168,
169
],
[
116,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
173,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
173,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
116,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
194,
196
],
[
186,
197
],
[
197,
198
],
[
116,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
203,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
209,
211
],
[
202,
212
],
[
212,
213
],
[
201,
214
],
[
214,
215
],
[
215,
216
],
[
116,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
220,
224
],
[
224,
225
],
[
219,
226
],
[
226,
227
],
[
226,
228
],
[
219,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
219,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
233,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
238,
241
],
[
237,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
219,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
116,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
253,
257
],
[
257,
258
],
[
252,
259
],
[
259,
260
],
[
259,
261
],
[
252,
262
],
[
262,
263
],
[
262,
264
],
[
252,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
252,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
274,
275
],
[
274,
276
],
[
273,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
252,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
282,
286
],
[
286,
287
],
[
286,
288
],
[
281,
289
],
[
289,
290
],
[
290,
291
],
[
252,
292
],
[
292,
293
],
[
292,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
300,
301
],
[
300,
302
],
[
295,
303
],
[
303,
304
],
[
304,
305
],
[
304,
306
],
[
303,
307
],
[
307,
308
],
[
307,
309
],
[
309,
310
],
[
309,
311
],
[
295,
312
],
[
312,
313
],
[
313,
314
],
[
314,
315
],
[
314,
316
],
[
316,
317
],
[
313,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
312,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
326,
327
],
[
324,
328
],
[
312,
329
],
[
329,
330
],
[
330,
331
],
[
294,
332
],
[
332,
333
],
[
332,
334
],
[
334,
335
],
[
116,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
338,
343
],
[
343,
344
],
[
344,
345
],
[
345,
346
],
[
345,
347
],
[
347,
348
],
[
347,
349
],
[
344,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
352,
354
],
[
343,
355
],
[
355,
356
],
[
338,
357
],
[
357,
358
],
[
116,
359
],
[
359,
360
],
[
359,
361
],
[
361,
362
],
[
362,
363
],
[
363,
364
],
[
364,
365
],
[
363,
366
],
[
366,
367
],
[
116,
368
],
[
368,
369
],
[
368,
370
],
[
370,
371
],
[
371,
372
],
[
372,
373
],
[
372,
374
],
[
371,
375
],
[
375,
376
],
[
376,
377
],
[
377,
378
],
[
116,
379
]
] |
[
"import java.io.*;\nimport java.util.*;\nclass Main{\n\tstatic final long MOD = 1_000_000_007; // 10^9+7\n\tstatic final int MAX = 2_147_483_646; // intMax \n\tstatic final int INF = 1_000_000_000; // 10^9 \n\tpublic static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tlong ans = 1L;\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}\n}\n\nclass hayami implements Closeable {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] hayami = new byte[1024];\n\tprivate int Hayami = 0;\n\tprivate int saori = 0;\n\tprivate boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tprivate int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}\n\tprivate static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}\n\tpublic boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}\n\tpublic String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}\n\tpublic long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}\n\tpublic int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}\n\tpublic double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}\n\tpublic void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }\n \n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tstatic final long MOD = 1_000_000_007; // 10^9+7\n\tstatic final int MAX = 2_147_483_646; // intMax \n\tstatic final int INF = 1_000_000_000; // 10^9 \n\tpublic static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tlong ans = 1L;\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}\n}",
"Main",
"static final long MOD = 1_000_000_007; // 10^9+7",
"MOD",
"1_000_000_007",
"static final int MAX = 2_147_483_646; // intMax ",
"MAX",
"2_147_483_646",
"static final int INF = 1_000_000_000; // 10^9 ",
"INF",
"1_000_000_000",
"public static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tlong ans = 1L;\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}",
"main",
"{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tlong ans = 1L;\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}",
"hayami saori = new hayami();",
"saori",
"new hayami()",
"int n = saori.saori_hayami();",
"n",
"saori.saori_hayami()",
"saori.saori_hayami",
"saori",
"long ans = 1L;",
"ans",
"1L",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for(int i = 0;i < n;i++){\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i] = saori.saorihayami();\n\t\t\tif(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"a[i] = saori.saorihayami()",
"a[i]",
"a",
"i",
"saori.saorihayami()",
"saori.saorihayami",
"saori",
"if(a[i] == 0){\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"for(int i = 0;i < n;i++){\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}",
"{\n\t\t\tif(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tans *= a[i];\n\t\t}",
"if(ans > 1000000000000000000L/a[i]){\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"ans > 1000000000000000000L/a[i]",
"ans",
"1000000000000000000L/a[i]",
"1000000000000000000L",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"ans *= a[i]",
"ans",
"a[i]",
"a",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"saori.close()",
"saori.close",
"saori",
"String[] args",
"args",
"class hayami implements Closeable {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] hayami = new byte[1024];\n\tprivate int Hayami = 0;\n\tprivate int saori = 0;\n\tprivate boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tprivate int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}\n\tprivate static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}\n\tpublic boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}\n\tpublic String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}\n\tpublic long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}\n\tpublic int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}\n\tpublic double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}\n\tpublic void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }\n \n}",
"hayami",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] hayami = new byte[1024];",
"hayami",
"new byte[1024]",
"1024",
"private int Hayami = 0;",
"Hayami",
"0",
"private int saori = 0;",
"saori",
"0",
"private boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"HayamiSaori",
"{\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"if (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"Hayami < saori",
"Hayami",
"saori",
"{\n\t\t\treturn true;\n\t\t}",
"return true;",
"true",
"{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"Hayami = 0",
"Hayami",
"0",
"try {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t}",
"saori = in.read(hayami)",
"saori",
"in.read(hayami)",
"in.read",
"in",
"hayami",
"if (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}",
"saori <= 0",
"saori",
"0",
"{\n\t\t\t\treturn false;\n\t\t\t}",
"return false;",
"false",
"return true;",
"true",
"private int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}",
"SaoriHayami",
"{ \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}",
"if (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }",
"HayamiSaori()",
"HayamiSaori",
"{\n return hayami[Hayami++];\n }",
"return hayami[Hayami++];",
"hayami[Hayami++]",
"hayami",
"Hayami++",
"Hayami",
"{\n return -1;\n }",
"return -1;",
"-1",
"1",
"private static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}",
"hayami_saori",
"{ \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}",
"return 33 <= hayami && hayami <= 126;",
"33 <= hayami && hayami <= 126",
"33 <= hayami",
"33",
"hayami",
"hayami <= 126",
"hayami",
"126",
"int hayami",
"hayami",
"public boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}",
"hayamisaori",
"{ \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}",
"while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++;",
"HayamiSaori() && !hayami_saori(hayami[Hayami])",
"HayamiSaori()",
"HayamiSaori",
"!hayami_saori(hayami[Hayami])",
"hayami_saori(hayami[Hayami])",
"hayami_saori",
"hayami[Hayami]",
"hayami",
"Hayami",
"Hayami++",
"Hayami",
"return HayamiSaori();",
"HayamiSaori()",
"HayamiSaori",
"public String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}",
"nextHayami",
"{\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}",
"if (!hayamisaori()) throw new NoSuchElementException();",
"!hayamisaori()",
"hayamisaori()",
"hayamisaori",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder hayamin = new StringBuilder();",
"hayamin",
"new StringBuilder()",
"int saori = SaoriHayami();",
"saori",
"SaoriHayami()",
"SaoriHayami",
"while(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"hayami_saori(saori)",
"hayami_saori",
"saori",
"{\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"hayamin.appendCodePoint(saori)",
"hayamin.appendCodePoint",
"hayamin",
"saori",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"return hayamin.toString();",
"hayamin.toString()",
"hayamin.toString",
"hayamin",
"public long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}",
"saorihayami",
"{//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}",
"if (!hayamisaori()) throw new NoSuchElementException();",
"!hayamisaori()",
"hayamisaori()",
"hayamisaori",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long hayami = 0;",
"hayami",
"0",
"boolean misao = false;",
"misao",
"false",
"int saori = SaoriHayami();",
"saori",
"SaoriHayami()",
"SaoriHayami",
"if (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"saori == '-'",
"saori",
"'-'",
"{\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"misao = true",
"misao",
"true",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"if (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"saori < '0' || '9' < saori",
"saori < '0'",
"saori",
"'0'",
"'9' < saori",
"'9'",
"saori",
"{\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"true",
"{\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"if ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"'0' <= saori && saori <= '9'",
"'0' <= saori",
"'0'",
"saori",
"saori <= '9'",
"saori",
"'9'",
"{\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}",
"hayami *= 10",
"hayami",
"10",
"hayami += saori - '0'",
"hayami",
"saori - '0'",
"saori",
"'0'",
"if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"saori == -1 || !hayami_saori(saori)",
"saori == -1",
"saori",
"-1",
"1",
"!hayami_saori(saori)",
"hayami_saori(saori)",
"hayami_saori",
"saori",
"{\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}",
"return misao ? -hayami : hayami;",
"misao ? -hayami : hayami",
"misao",
"-hayami",
"hayami",
"hayami",
"{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"public int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}",
"saori_hayami",
"{//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}",
"long hayami = saorihayami();",
"hayami",
"saorihayami()",
"saorihayami",
"if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();",
"hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE",
"hayami < Integer.MIN_VALUE",
"hayami",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"hayami > Integer.MAX_VALUE",
"hayami",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) hayami;",
"(int) hayami",
"public double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}",
"Hayamin",
"{ //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}",
"return Double.parseDouble(nextHayami());",
"Double.parseDouble(nextHayami())",
"Double.parseDouble",
"Double",
"nextHayami()",
"nextHayami",
"public void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }",
"close",
"{\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }",
"try {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}",
"catch (IOException e) {\n\t\t}",
"IOException e",
"{\n\t\t}",
"{\n\t\t\tin.close();\n\t\t}",
"in.close()",
"in.close",
"in",
"Closeable"
] |
import java.io.*;
import java.util.*;
class Main{
static final long MOD = 1_000_000_007; // 10^9+7
static final int MAX = 2_147_483_646; // intMax
static final int INF = 1_000_000_000; // 10^9
public static void main(String[] args) throws Exception{
hayami saori = new hayami();
int n = saori.saori_hayami();
long ans = 1L;
long[] a = new long[n];
for(int i = 0;i < n;i++){
a[i] = saori.saorihayami();
if(a[i] == 0){
System.out.println(0);
return;
}
}
for(int i = 0;i < n;i++){
if(ans > 1000000000000000000L/a[i]){
System.out.println(-1);
return;
}
ans *= a[i];
}
System.out.println(ans);
saori.close();
}
}
class hayami implements Closeable {
private final InputStream in = System.in;
private final byte[] hayami = new byte[1024];
private int Hayami = 0;
private int saori = 0;
private boolean HayamiSaori() {
if (Hayami < saori) {
return true;
}else{
Hayami = 0;
try {
saori = in.read(hayami);
} catch (IOException e) {
e.printStackTrace();
}
if (saori <= 0) {
return false;
}
}
return true;
}
private int SaoriHayami() {
if (HayamiSaori()) {
return hayami[Hayami++];
}else{
return -1;
}
}
private static boolean hayami_saori(int hayami) {
return 33 <= hayami && hayami <= 126;
}
public boolean hayamisaori() {
while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
}
public String nextHayami() {
if (!hayamisaori()) throw new NoSuchElementException();
StringBuilder hayamin = new StringBuilder();
int saori = SaoriHayami();
while(hayami_saori(saori)) {
hayamin.appendCodePoint(saori);
saori = SaoriHayami();
}
return hayamin.toString();
}
public long saorihayami() {//nextLong
if (!hayamisaori()) throw new NoSuchElementException();
long hayami = 0;
boolean misao = false;
int saori = SaoriHayami();
if (saori == '-') {
misao = true;
saori = SaoriHayami();
}
if (saori < '0' || '9' < saori) {
throw new NumberFormatException();
}
while(true){
if ('0' <= saori && saori <= '9') {
hayami *= 10;
hayami += saori - '0';
}else if(saori == -1 || !hayami_saori(saori)){
return misao ? -hayami : hayami;
}else{
throw new NumberFormatException();
}
saori = SaoriHayami();
}
}
public int saori_hayami() {//nextInt
long hayami = saorihayami();
if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) hayami;
}
public double Hayamin() { //nextDouble
return Double.parseDouble(nextHayami());
}
public void close() {
try {
in.close();
} catch (IOException e) {
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
18,
13,
13,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
29,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
4,
18,
18,
13,
13,
13,
17,
2,
4,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
29,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
29,
30,
4,
18,
18,
13,
13,
13,
4,
18,
13,
29,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
177,
8
],
[
177,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
11,
54
],
[
54,
55
],
[
54,
56
],
[
11,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
57,
67
],
[
67,
68
],
[
68,
69
],
[
57,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
73,
82
],
[
72,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
83,
90
],
[
90,
91
],
[
91,
92
],
[
83,
93
],
[
11,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
94,
104
],
[
104,
105
],
[
105,
106
],
[
94,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
111,
118
],
[
110,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
119,
124
],
[
109,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
125,
135
],
[
109,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
142,
144
],
[
11,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
146,
151
],
[
145,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
152,
159
],
[
159,
160
],
[
160,
161
],
[
152,
162
],
[
145,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
163,
170
],
[
170,
171
],
[
171,
172
],
[
163,
173
],
[
9,
174
],
[
174,
175
],
[
0,
176
],
[
176,
177
],
[
176,
178
]
] |
[
"import java.math.BigDecimal;\nimport java.util.Scanner;\n\npublic class Main\n{\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }\n}",
"Main",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = Integer.parseInt(sc.next());",
"N",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"BigDecimal[] A = new BigDecimal[N];",
"A",
"new BigDecimal[N]",
"N",
"for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextBigDecimal();\n }",
"{\n A[i] = sc.nextBigDecimal();\n }",
"A[i] = sc.nextBigDecimal()",
"A[i]",
"A",
"i",
"sc.nextBigDecimal()",
"sc.nextBigDecimal",
"sc",
"BigDecimal ans = BigDecimal.ONE;",
"ans",
"BigDecimal.ONE",
"BigDecimal",
"BigDecimal.ONE",
"BigDecimal tmp = new BigDecimal(\"1000000000000000000\");",
"tmp",
"new BigDecimal(\"1000000000000000000\")",
"for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }",
"{\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }",
"if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }",
"A[i].compareTo(BigDecimal.ZERO) == 0",
"A[i].compareTo(BigDecimal.ZERO)",
"A[i].compareTo",
"A[i]",
"A",
"i",
"BigDecimal.ZERO",
"BigDecimal",
"BigDecimal.ZERO",
"0",
"{\n System.out.println(\"0\");\n sc.close();\n return;\n }",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"sc.close()",
"sc.close",
"sc",
"return;",
"for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }",
"{\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }",
"if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }",
"A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1",
"A[i].compareTo(tmp) == 1",
"A[i].compareTo(tmp)",
"A[i].compareTo",
"A[i]",
"A",
"i",
"tmp",
"1",
"ans.compareTo(tmp) == 1",
"ans.compareTo(tmp)",
"ans.compareTo",
"ans",
"tmp",
"1",
"{\n System.out.println(\"-1\");\n sc.close();\n return;\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"sc.close()",
"sc.close",
"sc",
"return;",
"{\n ans = ans.multiply(A[i]);\n }",
"ans = ans.multiply(A[i])",
"ans",
"ans.multiply(A[i])",
"ans.multiply",
"ans",
"A[i]",
"A",
"i",
"if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }",
"ans.compareTo(tmp) == 1",
"ans.compareTo(tmp)",
"ans.compareTo",
"ans",
"tmp",
"1",
"{\n System.out.println(\"-1\");\n sc.close();\n return;\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"sc.close()",
"sc.close",
"sc",
"return;",
"{\n System.out.println(ans);\n sc.close();\n return;\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"sc.close()",
"sc.close",
"sc",
"return;",
"String[] args",
"args",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }\n}",
"public class Main\n{\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n \n int N = Integer.parseInt(sc.next());\n BigDecimal[] A = new BigDecimal[N];\n \n for (int i = 0; i < A.length; i++)\n {\n A[i] = sc.nextBigDecimal();\n }\n \n BigDecimal ans = BigDecimal.ONE;\n BigDecimal tmp = new BigDecimal(\"1000000000000000000\");\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(BigDecimal.ZERO) == 0)\n {\n System.out.println(\"0\");\n sc.close();\n return;\n }\n }\n \n for (int i = 0; i < A.length; i++)\n {\n if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n ans = ans.multiply(A[i]);\n }\n }\n \n if (ans.compareTo(tmp) == 1)\n {\n System.out.println(\"-1\");\n sc.close();\n return;\n }\n else\n {\n System.out.println(ans);\n sc.close();\n return;\n }\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
BigDecimal[] A = new BigDecimal[N];
for (int i = 0; i < A.length; i++)
{
A[i] = sc.nextBigDecimal();
}
BigDecimal ans = BigDecimal.ONE;
BigDecimal tmp = new BigDecimal("1000000000000000000");
for (int i = 0; i < A.length; i++)
{
if (A[i].compareTo(BigDecimal.ZERO) == 0)
{
System.out.println("0");
sc.close();
return;
}
}
for (int i = 0; i < A.length; i++)
{
if (A[i].compareTo(tmp) == 1 || ans.compareTo(tmp) == 1)
{
System.out.println("-1");
sc.close();
return;
}
else
{
ans = ans.multiply(A[i]);
}
}
if (ans.compareTo(tmp) == 1)
{
System.out.println("-1");
sc.close();
return;
}
else
{
System.out.println(ans);
sc.close();
return;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
40,
13,
0,
18,
13,
13,
20,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
20,
41,
13,
18,
13,
13,
28,
13,
13,
30,
30,
14,
2,
4,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
30,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
120,
8
],
[
120,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
45,
50
],
[
50,
51
],
[
51,
52
],
[
39,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
11,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
62,
69
],
[
11,
70
],
[
70,
71
],
[
70,
72
],
[
11,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
11,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
84,
89
],
[
83,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
90,
97
],
[
83,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
98,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
11,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
9,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
] |
[
"import java.util.*;\nimport java.math.*;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int size = sc.nextInt()",
"size",
"sc.nextInt()",
"sc.nextInt",
"sc",
"zero = 0;",
"zero",
"0",
"BigInteger nums[] = new BigInteger[size];",
"nums",
"new BigInteger[size]",
"size",
"for(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}",
"{\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}",
"String str = sc.next();",
"str",
"sc.next()",
"sc.next",
"sc",
"if(str.equals(\"0\")){zero++;}",
"str.equals(\"0\")",
"str.equals",
"str",
"\"0\"",
"{zero++;}",
"zero++",
"zero",
"nums[i] = new BigInteger(str)",
"nums[i]",
"nums",
"i",
"new BigInteger(str)",
"if(zero > 0){System.out.println(\"0\"); return;}",
"zero > 0",
"zero",
"0",
"{System.out.println(\"0\"); return;}",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"return;",
"BigInteger base = new BigInteger(\"1000000000000000000\")",
"base",
"new BigInteger(\"1000000000000000000\")",
"ans = BigInteger.ONE;",
"ans",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"for(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}",
"BigInteger num",
"nums",
"{\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}",
"if(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}",
"num.compareTo(base) > 0",
"num.compareTo(base)",
"num.compareTo",
"num",
"base",
"0",
"{\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"return;",
"{\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}",
"ans = ans.multiply(num)",
"ans",
"ans.multiply(num)",
"ans.multiply",
"ans",
"num",
"base = base.divide(num)",
"base",
"base.divide(num)",
"base.divide",
"base",
"num",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint size = sc.nextInt(), zero = 0;\n\t\tBigInteger nums[] = new BigInteger[size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tString str = sc.next();\n\t\t\tif(str.equals(\"0\")){zero++;}\n\t\t\tnums[i] = new BigInteger(str);\n\t\t}\n\t\tif(zero > 0){System.out.println(\"0\"); return;}\n\t\tBigInteger base = new BigInteger(\"1000000000000000000\"), ans = BigInteger.ONE;\n\t\tfor(BigInteger num : nums){\n\t\t\tif(num.compareTo(base) > 0){\n\t\t\t\tSystem.out.println(\"-1\"); return;\n\t\t\t} else {\n\t\t\t\tans = ans.multiply(num);\n\t\t\t\tbase = base.divide(num);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int size = sc.nextInt(), zero = 0;
BigInteger nums[] = new BigInteger[size];
for(int i = 0; i < size; i++){
String str = sc.next();
if(str.equals("0")){zero++;}
nums[i] = new BigInteger(str);
}
if(zero > 0){System.out.println("0"); return;}
BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
for(BigInteger num : nums){
if(num.compareTo(base) > 0){
System.out.println("-1"); return;
} else {
ans = ans.multiply(num);
base = base.divide(num);
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
17,
18,
13,
13,
30,
0,
13,
40,
17,
3,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
48,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
83,
88
],
[
74,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
61,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
6,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long currentA = 1;",
"currentA",
"1",
"long[] vals = new long[N];",
"vals",
"new long[N]",
"N",
"for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n vals[i] = sc.nextLong();\n }",
"{\n vals[i] = sc.nextLong();\n }",
"vals[i] = sc.nextLong()",
"vals[i]",
"vals",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"Arrays.sort(vals)",
"Arrays.sort",
"Arrays",
"vals",
"if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }",
"vals[0] == 0",
"vals[0]",
"vals",
"0",
"0",
"{\n System.out.println(0);\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"{\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }",
"for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }",
"{\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }",
"if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }",
"currentA > 1000000000000000000L / vals[i]",
"currentA",
"1000000000000000000L / vals[i]",
"1000000000000000000L",
"vals[i]",
"vals",
"i",
"{\n currentA = -1;\n break;\n }",
"currentA = -1",
"currentA",
"-1",
"1",
"break;",
"currentA *= vals[i]",
"currentA",
"vals[i]",
"vals",
"i",
"System.out.println(currentA)",
"System.out.println",
"System.out",
"System",
"System.out",
"currentA",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long currentA = 1;\n long[] vals = new long[N];\n for (int i = 0; i < N; i++) {\n vals[i] = sc.nextLong();\n }\n Arrays.sort(vals);\n if (vals[0] == 0) {\n System.out.println(0);\n } else {\n for (int i = 0; i < N; i++) {\n if (currentA > 1000000000000000000L / vals[i]) {\n currentA = -1;\n break;\n }\n currentA *= vals[i];\n }\n System.out.println(currentA);\n }\n\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long currentA = 1;
long[] vals = new long[N];
for (int i = 0; i < N; i++) {
vals[i] = sc.nextLong();
}
Arrays.sort(vals);
if (vals[0] == 0) {
System.out.println(0);
} else {
for (int i = 0; i < N; i++) {
if (currentA > 1000000000000000000L / vals[i]) {
currentA = -1;
break;
}
currentA *= vals[i];
}
System.out.println(currentA);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
8,
13,
40,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
117,
11
],
[
117,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
14,
33
],
[
33,
34
],
[
33,
35
],
[
14,
36
],
[
36,
37
],
[
36,
38
],
[
14,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
41,
46
],
[
14,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
76,
83
],
[
59,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
59,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
89,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
59,
101
],
[
101,
102
],
[
101,
103
],
[
14,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
109,
113
],
[
12,
114
],
[
114,
115
],
[
0,
116
],
[
116,
117
],
[
116,
118
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }",
"main",
"{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(in.readLine());",
"n",
"Integer.parseInt(in.readLine())",
"Integer.parseInt",
"Integer",
"in.readLine()",
"in.readLine",
"in",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"long sum = 1;",
"sum",
"1",
"long lastSum = 1;",
"lastSum",
"1",
"boolean over = false;",
"over",
"false",
"String[] str = in.readLine().split(\" \");",
"str",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }",
"{\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }",
"a[i] = Long.parseLong(str[i])",
"a[i]",
"a",
"i",
"Long.parseLong(str[i])",
"Long.parseLong",
"Long",
"str[i]",
"str",
"i",
"if(a[i]==0) {\n System.out.println(0);\n return;\n }",
"a[i]==0",
"a[i]",
"a",
"i",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"sum *= a[i]",
"sum",
"a[i]",
"a",
"i",
"if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }",
"lastSum > sum || sum > 1000000000000000000L",
"lastSum > sum",
"lastSum",
"sum",
"sum > 1000000000000000000L",
"sum",
"1000000000000000000L",
"{\n over = true;\n }",
"over = true",
"over",
"true",
"lastSum = sum",
"lastSum",
"sum",
"System.out.println(over?-1:sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"over?-1:sum",
"over",
"-1",
"1",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(in.readLine());\n long[] a = new long[n];\n long sum = 1;\n long lastSum = 1;\n boolean over = false;\n String[] str = in.readLine().split(\" \");\n for(int i = 0; i < n; i++){\n a[i] = Long.parseLong(str[i]);\n if(a[i]==0) {\n System.out.println(0);\n return;\n }\n sum *= a[i];\n if(lastSum > sum || sum > 1000000000000000000L) {\n over = true;\n }\n lastSum = sum;\n }\n System.out.println(over?-1:sum);\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(in.readLine());
long[] a = new long[n];
long sum = 1;
long lastSum = 1;
boolean over = false;
String[] str = in.readLine().split(" ");
for(int i = 0; i < n; i++){
a[i] = Long.parseLong(str[i]);
if(a[i]==0) {
System.out.println(0);
return;
}
sum *= a[i];
if(lastSum > sum || sum > 1000000000000000000L) {
over = true;
}
lastSum = sum;
}
System.out.println(over?-1:sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
4,
18,
13,
4,
18,
13,
30,
29,
17,
41,
13,
20,
17,
41,
13,
4,
18,
13,
28,
13,
13,
30,
30,
40,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
14,
2,
40,
18,
13,
13,
17,
30,
29,
17,
29,
17,
23,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
14,
2,
13,
17,
30,
4,
18,
13,
13,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
13,
13,
30,
0,
13,
40,
17,
3,
30,
0,
13,
18,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
4,
13,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
314,
23
],
[
314,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
43,
45
],
[
26,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
46,
51
],
[
26,
52
],
[
52,
53
],
[
53,
54
],
[
24,
55
],
[
55,
56
],
[
314,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
59,
71
],
[
71,
72
],
[
71,
73
],
[
59,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
59,
80
],
[
80,
81
],
[
80,
82
],
[
80,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
59,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
89,
99
],
[
99,
100
],
[
100,
101
],
[
89,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
103,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
110,
117
],
[
117,
118
],
[
118,
119
],
[
59,
120
],
[
120,
121
],
[
57,
122
],
[
122,
123
],
[
57,
124
],
[
124,
125
],
[
314,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
130,
136
],
[
136,
137
],
[
136,
138
],
[
130,
140
],
[
140,
141
],
[
140,
142
],
[
130,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
145,
149
],
[
130,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
150,
158
],
[
158,
159
],
[
159,
160
],
[
150,
161
],
[
162,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
168,
169
],
[
162,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
170,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
130,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
185,
188
],
[
184,
189
],
[
130,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
190,
198
],
[
198,
199
],
[
199,
200
],
[
190,
201
],
[
202,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
208,
210
],
[
203,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
211,
216
],
[
203,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
220,
222
],
[
130,
223
],
[
223,
224
],
[
224,
225
],
[
223,
226
],
[
128,
227
],
[
227,
228
],
[
128,
229
],
[
229,
230
],
[
128,
231
],
[
231,
232
],
[
314,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
233,
237
],
[
237,
238
],
[
233,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
241,
245
],
[
245,
246
],
[
245,
247
],
[
239,
248
],
[
248,
249
],
[
233,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
254,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
253,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
267,
268
],
[
263,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
252,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
233,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
281,
285
],
[
233,
286
],
[
286,
287
],
[
286,
288
],
[
288,
289
],
[
289,
290
],
[
290,
291
],
[
291,
292
],
[
290,
293
],
[
293,
294
],
[
233,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
299,
302
],
[
302,
303
],
[
233,
304
],
[
304,
305
],
[
304,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
308,
311
],
[
311,
312
],
[
0,
313
],
[
313,
314
],
[
313,
315
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\n/**\n * Built using CHelper plug-in Actual solution is at the top\n */\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}\n\n\tstatic class Task {\n\t\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}\n\t}\n\n\tstatic boolean permutation_2(String s, String t) {\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tstatic class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}\n\n\tstatic class Task {\n\t\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}\n\t}\n\n\tstatic boolean permutation_2(String s, String t) {\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tstatic class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}",
"main",
"{\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"Task solver = new Task();",
"solver",
"new Task()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static boolean permutation_2(String s, String t) {\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"permutation_2",
"{\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"if (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}",
"s.length() != t.length()",
"s.length()",
"s.length",
"s",
"t.length()",
"t.length",
"t",
"{\n\t\t\treturn false;\n\t\t}",
"return false;",
"false",
"int[] letters = new int[256];",
"letters",
"new int[256]",
"256",
"char[] s_array = s.toCharArray();",
"s_array",
"s.toCharArray()",
"s.toCharArray",
"s",
"for (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}",
"char c",
"s_array",
"{\n\t\t\tletters[c]++;\n\t\t}",
"{\n\t\t\tletters[c]++;\n\t\t}",
"letters[c]++",
"letters[c]",
"letters",
"c",
"for (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < t.length()",
"i",
"t.length()",
"t.length",
"t",
"i++",
"i++",
"i",
"{\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"{\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"int c = (int) t.charAt(i);",
"c",
"(int) t.charAt(i)",
"t.charAt",
"t",
"i",
"if (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}",
"--letters[c] < 0",
"--letters[c]",
"letters[c]",
"letters",
"c",
"0",
"{\n\t\t\t\treturn false;\n\t\t\t}",
"return false;",
"false",
"return true;",
"true",
"String s",
"s",
"String t",
"t",
"static class Task {\n\t\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}\n\t}",
"Task",
"public void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}",
"solve",
"{\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"long ans = 1;",
"ans",
"1",
"long limit = (long)Math.pow(10, 18);",
"limit",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}",
"a[i] = in.nextLong()",
"a[i]",
"a",
"i",
"in.nextLong()",
"in.nextLong",
"in",
"if(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\t\tans = 0;\n\t\t\t\t}",
"ans = 0",
"ans",
"0",
"if(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}",
"ans == 0",
"ans",
"0",
"{\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}",
"out.println(ans)",
"out.println",
"out",
"ans",
"return;",
"for(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}",
"if(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}",
"a[i] > (limit / ans)",
"a[i]",
"a",
"i",
"(limit / ans)",
"limit",
"ans",
"{\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"ans = -1",
"ans",
"-1",
"1",
"break;",
"{\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}",
"ans *= a[i]",
"ans",
"a[i]",
"a",
"i",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"InputReader in",
"in",
"PrintWriter out",
"out",
"static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t}",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}",
"InputReader",
"{\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"next",
"{\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"try {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t}",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}",
"nextChar",
"{\n\t\t\treturn next().charAt(0);\n\t\t}",
"return next().charAt(0);",
"next().charAt(0)",
"next().charAt",
"next()",
"next",
"0",
"public int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"nextDouble",
"{\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"nextLong",
"{\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}\n\n\tstatic class Task {\n\t\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}\n\t}\n\n\tstatic boolean permutation_2(String s, String t) {\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tstatic class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tTask solver = new Task();\n\t\tsolver.solve(1, in, out);\n\t\tout.close();\n\t}\n\n\tstatic class Task {\n\t\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\n\t\t\tint n = in.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong ans = 1;\n\t\t\tlong limit = (long)Math.pow(10, 18);\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\ta[i] = in.nextLong();\n\t\t\t\tif(a[i] == 0) {\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(ans == 0) {\n\t\t\t\tout.println(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(a[i] > (limit / ans)) {\n\t\t\t\t\tans = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tans *= a[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.println(ans);\n\t\t}\n\t}\n\n\tstatic boolean permutation_2(String s, String t) {\n\t\tif (s.length() != t.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] letters = new int[256];\n\n\t\tchar[] s_array = s.toCharArray();\n\t\tfor (char c : s_array) {\n\t\t\tletters[c]++;\n\t\t}\n\n\t\tfor (int i = 0; i < t.length(); i++) {\n\t\t\tint c = (int) t.charAt(i);\n\t\t\tif (--letters[c] < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tstatic class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32768);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic char nextChar() {\n\t\t\treturn next().charAt(0);\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
* Built using CHelper plug-in Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task solver = new Task();
solver.solve(1, in, out);
out.close();
}
static class Task {
public void solve(int testNumber, InputReader in, PrintWriter out) {
int n = in.nextInt();
long[] a = new long[n];
long ans = 1;
long limit = (long)Math.pow(10, 18);
for(int i = 0; i < n; i++) {
a[i] = in.nextLong();
if(a[i] == 0) {
ans = 0;
}
}
if(ans == 0) {
out.println(ans);
return;
}
for(int i = 0; i < n; i++) {
if(a[i] > (limit / ans)) {
ans = -1;
break;
} else {
ans *= a[i];
}
}
out.println(ans);
}
}
static boolean permutation_2(String s, String t) {
if (s.length() != t.length()) {
return false;
}
int[] letters = new int[256];
char[] s_array = s.toCharArray();
for (char c : s_array) {
letters[c]++;
}
for (int i = 0; i < t.length(); i++) {
int c = (int) t.charAt(i);
if (--letters[c] < 0) {
return false;
}
}
return true;
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public char nextChar() {
return next().charAt(0);
}
public int nextInt() {
return Integer.parseInt(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
public long nextLong() {
return Long.parseLong(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
14,
2,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
29,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
116,
5
],
[
116,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
57,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
91,
99
],
[
83,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
8,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
8,
112
],
[
6,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] |
[
"import java.util.*;\n public class Main {\n public static void main(String[] args) {\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }\n }",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }\n }",
"Main",
"public static void main(String[] args) {\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }",
"main",
"{\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"long cal = 1;",
"cal",
"1",
"long max = (long)Math.pow(10,18);",
"max",
"(long)Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }",
"{\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }",
"A[i] = sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(A[i]==0){\n System.out.println(0);\n return;\n }",
"A[i]==0",
"A[i]",
"A",
"i",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }",
"cal != 0",
"cal",
"0",
"{\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }",
"for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }",
"{\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }",
"if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }",
"max/cal < A[i]",
"max/cal",
"max",
"cal",
"A[i]",
"A",
"i",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"{\n cal *= A[i];\n }",
"cal *= A[i]",
"cal",
"A[i]",
"A",
"i",
"System.out.println(cal)",
"System.out.println",
"System.out",
"System",
"System.out",
"cal",
"return;",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }\n }",
"public class Main {\n public static void main(String[] args) {\n \n //sec--1 (definition)\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n long cal = 1;\n long max = (long)Math.pow(10,18);\n \n //sec--2 (loop,0)\n for(int i=0; i<N; i++){\n A[i] = sc.nextLong();\n if(A[i]==0){\n System.out.println(0);\n return;\n }\n }\n \n //sec--3 (loop,-1.cal)\n //returnで初期に戻るので\n if(cal != 0) {\n for(int i=0; i<N; i++){\n if(max/cal < A[i]){\n System.out.println(-1);\n return;\n } else {\n cal *= A[i];\n }\n }\n }\n System.out.println(cal);\n return;\n }\n }",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
//sec--1 (definition)
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[] A = new long[N];
long cal = 1;
long max = (long)Math.pow(10,18);
//sec--2 (loop,0)
for(int i=0; i<N; i++){
A[i] = sc.nextLong();
if(A[i]==0){
System.out.println(0);
return;
}
}
//sec--3 (loop,-1.cal)
//returnで初期に戻るので
if(cal != 0) {
for(int i=0; i<N; i++){
if(max/cal < A[i]){
System.out.println(-1);
return;
} else {
cal *= A[i];
}
}
}
System.out.println(cal);
return;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
142,
8
],
[
142,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
50,
57
],
[
11,
58
],
[
58,
59
],
[
58,
60
],
[
11,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
73,
82
],
[
82,
83
],
[
82,
84
],
[
11,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
89,
97
],
[
85,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
102,
113
],
[
114,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
124,
132
],
[
98,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
9,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
]
] |
[
"import java.text.NumberFormat;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }\n}",
"import java.text.NumberFormat;",
"NumberFormat",
"java.text",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long numbers[] = new long[n];",
"numbers",
"new long[n]",
"n",
"for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }",
"{\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }",
"numbers[i] = sc.nextLong()",
"numbers[i]",
"numbers",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(numbers[i] == 0){\n System.out.println(0);\n return;\n }",
"numbers[i] == 0",
"numbers[i]",
"numbers",
"i",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"double ans = 0;",
"ans",
"0",
"for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n double d = Math.log10(numbers[i]);\n ans += d;\n }",
"{\n double d = Math.log10(numbers[i]);\n ans += d;\n }",
"double d = Math.log10(numbers[i]);",
"d",
"Math.log10(numbers[i])",
"Math.log10",
"Math",
"numbers[i]",
"numbers",
"i",
"ans += d",
"ans",
"d",
"if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }",
"ans > 18",
"ans",
"18",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }",
"long answer = 1;",
"answer",
"1",
"for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }",
"{\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }",
"answer *= numbers[i]",
"answer",
"numbers[i]",
"numbers",
"i",
"if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }",
"answer > (long)1e18",
"answer",
"(long)1e18",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }\n}",
"public class Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long numbers[] = new long[n];\n\n for(int i = 0; i < n; i++) {\n numbers[i] = sc.nextLong();\n if(numbers[i] == 0){\n System.out.println(0);\n return;\n }\n }\n\n double ans = 0;\n for(int i = 0; i < n;i++){\n double d = Math.log10(numbers[i]);\n ans += d;\n }\n\n if(ans > 18){\n System.out.println(-1);\n return;\n }else{\n long answer = 1;\n for(int i = 0;i < n;i++){\n answer *= numbers[i];\n\n if(answer > (long)1e18){\n System.out.println(-1);\n return;\n }\n }\n\n System.out.println(answer);\n\n }\n\n// long ans = 1;\n// for(int i = 0;i < n;i++){\n// ans *= numbers[i];\n//\n// if(ans > (long)1e18){\n// System.out.println(-1);\n// return;\n// }\n// }\n//\n// System.out.println(ans);\n\n\n\n// NumberFormat nm = NumberFormat.getNumberInstance();\n// System.out.println(nm.format(l));\n\n\n }\n}",
"Main"
] |
import java.text.NumberFormat;
import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long numbers[] = new long[n];
for(int i = 0; i < n; i++) {
numbers[i] = sc.nextLong();
if(numbers[i] == 0){
System.out.println(0);
return;
}
}
double ans = 0;
for(int i = 0; i < n;i++){
double d = Math.log10(numbers[i]);
ans += d;
}
if(ans > 18){
System.out.println(-1);
return;
}else{
long answer = 1;
for(int i = 0;i < n;i++){
answer *= numbers[i];
if(answer > (long)1e18){
System.out.println(-1);
return;
}
}
System.out.println(answer);
}
// long ans = 1;
// for(int i = 0;i < n;i++){
// ans *= numbers[i];
//
// if(ans > (long)1e18){
// System.out.println(-1);
// return;
// }
// }
//
// System.out.println(ans);
// NumberFormat nm = NumberFormat.getNumberInstance();
// System.out.println(nm.format(l));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
4,
18,
13,
17,
17,
30,
0,
13,
17,
3,
14,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
132,
8
],
[
132,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
11,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
11,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
11,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
84,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
98,
106
],
[
97,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
11,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
112,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
9,
129
],
[
129,
130
],
[
0,
131
],
[
131,
132
],
[
131,
133
]
] |
[
"import java.util.*;\nimport java.math.BigInteger;\n \npublic class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }",
"main",
"{\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"List<Long> list = new ArrayList<Long>();",
"list",
"new ArrayList<Long>()",
"for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"list.add(a)",
"list.add",
"list",
"a",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }",
"list.get(0) == 0",
"list.get(0)",
"list.get",
"list",
"0",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"BigInteger ans = BigInteger.ONE;",
"ans",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"boolean isOver = false;",
"isOver",
"false",
"for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n }",
"{\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n }",
"ans = ans.multiply(BigInteger.valueOf(list.get(i)))",
"ans",
"ans.multiply(BigInteger.valueOf(list.get(i)))",
"ans.multiply",
"ans",
"BigInteger.valueOf(list.get(i))",
"BigInteger.valueOf",
"BigInteger",
"list.get(i)",
"list.get",
"list",
"i",
"if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }",
"ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0",
"ans.compareTo(BigInteger.valueOf(1000000000000000000l))",
"ans.compareTo",
"ans",
"BigInteger.valueOf(1000000000000000000l)",
"BigInteger.valueOf",
"BigInteger",
"1000000000000000000l",
"0",
"{\n isOver = true;\n break;\n }",
"isOver = true",
"isOver",
"true",
"break;",
"if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }",
"isOver",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n // 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。\n BigInteger ans = BigInteger.ONE;\n boolean isOver = false;\n for (int i = 0; i < n; i++) {\n ans = ans.multiply(BigInteger.valueOf(list.get(i)));\n if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {\n isOver = true;\n break;\n }\n } \n\n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n /*\n * 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。\n long ans = 1l;\n boolean isOver = false;\n try {\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans = Math.multiplyExact(ans, a);\n if (ans > 1000000000000000000l) {\n isOver = true;\n break;\n }\n } \n } catch (ArithmeticException e) {\n isOver = true;\n }\n \n if (isOver) {\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n /* \n * 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n */\n \n }\n}",
"Main"
] |
import java.util.*;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
List<Long> list = new ArrayList<Long>();
for (int i = 0; i < n; i++) {
long a = scan.nextLong();
list.add(a);
}
Collections.sort(list);//System.out.println(list);
// listの先頭が0だったら、0を出力して即終了
if (list.get(0) == 0) {
System.out.println(0);
return;
}
// 1. BigIntegerクラスを用いて、オーバーフローが起きないようにする。
BigInteger ans = BigInteger.ONE;
boolean isOver = false;
for (int i = 0; i < n; i++) {
ans = ans.multiply(BigInteger.valueOf(list.get(i)));
if (ans.compareTo(BigInteger.valueOf(1000000000000000000l)) > 0) {
isOver = true;
break;
}
}
if (isOver) {
System.out.println(-1);
} else {
System.out.println(ans);
}
/*
* 2. multiplyExactメソッド(オーバーフローすると例外送出)を利用する方法。
long ans = 1l;
boolean isOver = false;
try {
for (int i = 0; i < n; i++) {
long a = list.get(i);
ans = Math.multiplyExact(ans, a);
if (ans > 1000000000000000000l) {
isOver = true;
break;
}
}
} catch (ArithmeticException e) {
isOver = true;
}
if (isOver) {
System.out.println(-1);
} else {
System.out.println(ans);
}
*/
/*
* 3. オーバーフローすると、負の数や0になる可能性があることを考慮して場合わけする。
long ans = 1l;
for (int i = 0; i < n; i++) {
long a = list.get(i);
ans *= a;
if (ans > 1000000000000000000l || ans <= 0) {
break;
}
}
if (ans > 1000000000000000000l || ans <= 0) {
//System.out.println(ans);
System.out.println(-1);
} else {
System.out.println(ans);
}
*/
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
4,
18,
13,
17,
29,
41,
13,
4,
18,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
13,
17,
30,
4,
18,
13,
40,
17,
29,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
29,
17,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
29,
17,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
270,
32
],
[
270,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
35,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
35,
46
],
[
46,
47
],
[
46,
48
],
[
35,
49
],
[
49,
50
],
[
49,
51
],
[
35,
52
],
[
52,
53
],
[
52,
54
],
[
35,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
55,
60
],
[
35,
61
],
[
61,
62
],
[
62,
63
],
[
33,
64
],
[
64,
65
],
[
270,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
70,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
101,
106
],
[
70,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
70,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
70,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
139,
140
],
[
139,
141
],
[
130,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
143,
148
],
[
142,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
149,
155
],
[
70,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
160,
161
],
[
68,
162
],
[
162,
163
],
[
68,
164
],
[
164,
165
],
[
68,
166
],
[
166,
167
],
[
270,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
168,
172
],
[
172,
173
],
[
168,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
174,
180
],
[
180,
181
],
[
168,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
185,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
195,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
201,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
211,
212
],
[
212,
213
],
[
201,
214
],
[
214,
215
],
[
214,
216
],
[
184,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
168,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
225,
228
],
[
228,
229
],
[
168,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
234,
237
],
[
237,
238
],
[
168,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
241,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
246,
251
],
[
251,
252
],
[
251,
253
],
[
246,
254
],
[
254,
255
],
[
255,
256
],
[
246,
257
],
[
258,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
263,
264
],
[
241,
265
],
[
265,
266
],
[
239,
267
],
[
267,
268
],
[
0,
269
],
[
269,
270
],
[
269,
271
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\nimport java.math.BigInteger;\nimport java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class B {\n public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }\n\n }\n\n static class MyScanner {\n private BufferedReader in;\n private StringTokenizer st;\n\n public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }\n\n public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }\n\n public int Int() {\n return Integer.parseInt(next());\n }\n\n public long Long() {\n return Long.parseLong(next());\n }\n\n public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class B {\n public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }\n\n }\n\n static class MyScanner {\n private BufferedReader in;\n private StringTokenizer st;\n\n public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }\n\n public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }\n\n public int Int() {\n return Integer.parseInt(next());\n }\n\n public long Long() {\n return Long.parseLong(next());\n }\n\n public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"MyScanner in = new MyScanner(inputStream);",
"in",
"new MyScanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"B solver = new B();",
"solver",
"new B()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class B {\n public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }\n\n }",
"B",
"public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }",
"solve",
"{\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }",
"int N = in.Int();",
"N",
"in.Int()",
"in.Int",
"in",
"long[] A = in.Long(N);",
"A",
"in.Long(N)",
"in.Long",
"in",
"N",
"for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }",
"{\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }",
"if (A[i] == 0) {\n out.println(0);\n return;\n }",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n out.println(0);\n return;\n }",
"out.println(0)",
"out.println",
"out",
"0",
"return;",
"BigInteger max = BigInteger.valueOf((long) 1e18);",
"max",
"BigInteger.valueOf((long) 1e18)",
"BigInteger.valueOf",
"BigInteger",
"(long) 1e18",
"BigInteger a = BigInteger.ONE;",
"a",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }",
"{\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }",
"a = a.multiply(BigInteger.valueOf(A[i]))",
"a",
"a.multiply(BigInteger.valueOf(A[i]))",
"a.multiply",
"a",
"BigInteger.valueOf(A[i])",
"BigInteger.valueOf",
"BigInteger",
"A[i]",
"A",
"i",
"if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }",
"a.compareTo(max) > 0",
"a.compareTo(max)",
"a.compareTo",
"a",
"max",
"0",
"{\n out.println(-1);\n return;\n }",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"return;",
"out.println(a.toString())",
"out.println",
"out",
"a.toString()",
"a.toString",
"a",
"int testNumber",
"testNumber",
"MyScanner in",
"in",
"PrintWriter out",
"out",
"static class MyScanner {\n private BufferedReader in;\n private StringTokenizer st;\n\n public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }\n\n public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }\n\n public int Int() {\n return Integer.parseInt(next());\n }\n\n public long Long() {\n return Long.parseLong(next());\n }\n\n public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }\n\n }",
"MyScanner",
"private BufferedReader in;",
"in",
"private StringTokenizer st;",
"st",
"public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }",
"MyScanner",
"{\n in = new BufferedReader(new InputStreamReader(stream));\n }",
"in = new BufferedReader(new InputStreamReader(stream))",
"in",
"new BufferedReader(new InputStreamReader(stream))",
"InputStream stream",
"stream",
"public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }",
"try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }",
"catch (IOException e) {\n return null;\n }",
"IOException e",
"{\n return null;\n }",
"return null;",
"null",
"{\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n }",
"String rl = in.readLine();",
"rl",
"in.readLine()",
"in.readLine",
"in",
"if (rl == null) {\n return null;\n }",
"rl == null",
"rl",
"null",
"{\n return null;\n }",
"return null;",
"null",
"st = new StringTokenizer(rl)",
"st",
"new StringTokenizer(rl)",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int Int() {\n return Integer.parseInt(next());\n }",
"Int",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long Long() {\n return Long.parseLong(next());\n }",
"Long",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }",
"Long",
"{\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = Long();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = Long();\n }",
"{\n a[i] = Long();\n }",
"a[i] = Long()",
"a[i]",
"a",
"i",
"Long()",
"Long",
"return a;",
"a",
"int n",
"n",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class B {\n public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }\n\n }\n\n static class MyScanner {\n private BufferedReader in;\n private StringTokenizer st;\n\n public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }\n\n public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }\n\n public int Int() {\n return Integer.parseInt(next());\n }\n\n public long Long() {\n return Long.parseLong(next());\n }\n\n public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n MyScanner in = new MyScanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n B solver = new B();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class B {\n public void solve(int testNumber, MyScanner in, PrintWriter out) {\n int N = in.Int();\n long[] A = in.Long(N);\n\n for (int i = 0; i < N; i++) {\n if (A[i] == 0) {\n out.println(0);\n return;\n }\n }\n\n BigInteger max = BigInteger.valueOf((long) 1e18);\n\n BigInteger a = BigInteger.ONE;\n for (int i = 0; i < N; i++) {\n a = a.multiply(BigInteger.valueOf(A[i]));\n if (a.compareTo(max) > 0) {\n out.println(-1);\n return;\n }\n }\n out.println(a.toString());\n }\n\n }\n\n static class MyScanner {\n private BufferedReader in;\n private StringTokenizer st;\n\n public MyScanner(InputStream stream) {\n in = new BufferedReader(new InputStreamReader(stream));\n }\n\n public String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n String rl = in.readLine();\n if (rl == null) {\n return null;\n }\n st = new StringTokenizer(rl);\n } catch (IOException e) {\n return null;\n }\n }\n return st.nextToken();\n }\n\n public int Int() {\n return Integer.parseInt(next());\n }\n\n public long Long() {\n return Long.parseLong(next());\n }\n\n public long[] Long(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = Long();\n }\n return a;\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
MyScanner in = new MyScanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
B solver = new B();
solver.solve(1, in, out);
out.close();
}
static class B {
public void solve(int testNumber, MyScanner in, PrintWriter out) {
int N = in.Int();
long[] A = in.Long(N);
for (int i = 0; i < N; i++) {
if (A[i] == 0) {
out.println(0);
return;
}
}
BigInteger max = BigInteger.valueOf((long) 1e18);
BigInteger a = BigInteger.ONE;
for (int i = 0; i < N; i++) {
a = a.multiply(BigInteger.valueOf(A[i]));
if (a.compareTo(max) > 0) {
out.println(-1);
return;
}
}
out.println(a.toString());
}
}
static class MyScanner {
private BufferedReader in;
private StringTokenizer st;
public MyScanner(InputStream stream) {
in = new BufferedReader(new InputStreamReader(stream));
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
try {
String rl = in.readLine();
if (rl == null) {
return null;
}
st = new StringTokenizer(rl);
} catch (IOException e) {
return null;
}
}
return st.nextToken();
}
public int Int() {
return Integer.parseInt(next());
}
public long Long() {
return Long.parseLong(next());
}
public long[] Long(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = Long();
}
return a;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
14,
2,
18,
13,
13,
17,
0,
13,
17,
14,
13,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
13,
2,
13,
18,
13,
13,
41,
13,
4,
18,
13,
17,
14,
2,
2,
2,
13,
13,
2,
13,
17,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
23,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
42,
2,
0,
13,
4,
13,
40,
17,
30,
14,
2,
13,
17,
3,
0,
18,
13,
40,
13,
13,
29,
20,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
41,
13,
20,
4,
18,
13,
13,
0,
13,
4,
13,
42,
40,
4,
18,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
2,
13,
17,
30,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
0,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
13,
14,
2,
13,
40,
17,
0,
18,
13,
17,
40,
17,
12,
13,
30,
14,
2,
13,
13,
4,
13,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
616,
8
],
[
616,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
52,
59
],
[
11,
60
],
[
60,
61
],
[
60,
62
],
[
11,
63
],
[
63,
64
],
[
63,
65
],
[
11,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
78,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
11,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
11,
100
],
[
100,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
106,
108
],
[
102,
109
],
[
109,
110
],
[
109,
111
],
[
100,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
100,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
9,
127
],
[
127,
128
],
[
0,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
129,
136
],
[
136,
137
],
[
129,
138
],
[
138,
139
],
[
129,
140
],
[
140,
141
],
[
129,
142
],
[
142,
143
],
[
129,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
146,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
129,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
165,
167
],
[
161,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
171,
173
],
[
159,
174
],
[
174,
175
],
[
129,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
178,
186
],
[
186,
187
],
[
178,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
189,
194
],
[
194,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
196,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
202,
207
],
[
178,
208
],
[
208,
209
],
[
129,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
218,
221
],
[
217,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
212,
227
],
[
227,
228
],
[
227,
229
],
[
212,
230
],
[
230,
231
],
[
231,
232
],
[
230,
233
],
[
212,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
212,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
240,
243
],
[
238,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
245,
248
],
[
244,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
212,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
129,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
259,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
259,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
277,
279
],
[
259,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
282,
284
],
[
284,
285
],
[
259,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
288,
293
],
[
287,
294
],
[
294,
295
],
[
294,
296
],
[
286,
297
],
[
297,
298
],
[
298,
299
],
[
298,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
301,
305
],
[
300,
306
],
[
259,
307
],
[
307,
308
],
[
307,
309
],
[
309,
310
],
[
310,
311
],
[
259,
312
],
[
312,
313
],
[
129,
314
],
[
314,
315
],
[
314,
316
],
[
316,
317
],
[
317,
318
],
[
317,
319
],
[
316,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
321,
326
],
[
326,
327
],
[
326,
328
],
[
321,
329
],
[
329,
330
],
[
330,
331
],
[
321,
332
],
[
333,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
334,
338
],
[
338,
339
],
[
316,
340
],
[
340,
341
],
[
314,
342
],
[
342,
343
],
[
129,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
347,
349
],
[
346,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
346,
354
],
[
354,
355
],
[
355,
356
],
[
355,
357
],
[
354,
358
],
[
358,
359
],
[
358,
360
],
[
360,
361
],
[
346,
362
],
[
362,
363
],
[
362,
364
],
[
364,
365
],
[
364,
366
],
[
346,
367
],
[
367,
368
],
[
367,
369
],
[
369,
370
],
[
369,
371
],
[
371,
372
],
[
346,
373
],
[
373,
374
],
[
374,
375
],
[
375,
376
],
[
376,
377
],
[
376,
378
],
[
378,
379
],
[
375,
380
],
[
374,
381
],
[
381,
382
],
[
381,
383
],
[
373,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
388,
389
],
[
389,
390
],
[
389,
391
],
[
388,
392
],
[
387,
393
],
[
346,
394
],
[
394,
395
],
[
394,
396
],
[
396,
397
],
[
397,
398
],
[
346,
399
],
[
399,
400
],
[
129,
401
],
[
401,
402
],
[
401,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
403,
408
],
[
408,
409
],
[
409,
410
],
[
410,
411
],
[
410,
412
],
[
408,
413
],
[
413,
414
],
[
413,
415
],
[
408,
416
],
[
416,
417
],
[
417,
418
],
[
408,
419
],
[
420,
420
],
[
420,
421
],
[
421,
422
],
[
422,
423
],
[
422,
424
],
[
421,
425
],
[
425,
426
],
[
403,
427
],
[
427,
428
],
[
401,
429
],
[
429,
430
],
[
129,
431
],
[
431,
432
],
[
431,
433
],
[
433,
434
],
[
434,
435
],
[
434,
436
],
[
436,
437
],
[
433,
438
],
[
438,
439
],
[
439,
440
],
[
440,
441
],
[
439,
442
],
[
438,
443
],
[
443,
444
],
[
444,
445
],
[
444,
446
],
[
446,
447
],
[
433,
448
],
[
448,
449
],
[
129,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
453,
455
],
[
452,
456
],
[
456,
457
],
[
456,
458
],
[
452,
459
],
[
459,
460
],
[
459,
461
],
[
461,
462
],
[
452,
463
],
[
463,
464
],
[
464,
465
],
[
464,
466
],
[
463,
467
],
[
467,
468
],
[
467,
469
],
[
469,
470
],
[
452,
471
],
[
471,
472
],
[
471,
473
],
[
473,
474
],
[
473,
475
],
[
452,
476
],
[
476,
477
],
[
476,
478
],
[
478,
479
],
[
478,
480
],
[
480,
481
],
[
452,
482
],
[
482,
483
],
[
483,
484
],
[
484,
485
],
[
485,
486
],
[
485,
487
],
[
487,
488
],
[
484,
489
],
[
483,
490
],
[
490,
491
],
[
490,
492
],
[
482,
493
],
[
493,
494
],
[
494,
495
],
[
494,
496
],
[
496,
497
],
[
497,
498
],
[
498,
499
],
[
498,
500
],
[
497,
501
],
[
496,
502
],
[
452,
503
],
[
503,
504
],
[
504,
505
],
[
504,
506
],
[
503,
507
],
[
507,
508
],
[
508,
509
],
[
509,
510
],
[
510,
511
],
[
511,
512
],
[
511,
513
],
[
513,
514
],
[
510,
515
],
[
509,
516
],
[
516,
517
],
[
516,
518
],
[
508,
519
],
[
519,
520
],
[
520,
521
],
[
520,
522
],
[
522,
523
],
[
523,
524
],
[
523,
525
],
[
522,
526
],
[
526,
527
],
[
526,
528
],
[
452,
529
],
[
529,
530
],
[
529,
531
],
[
531,
532
],
[
532,
533
],
[
452,
534
],
[
534,
535
],
[
129,
536
],
[
536,
537
],
[
536,
538
],
[
538,
539
],
[
539,
540
],
[
539,
541
],
[
538,
543
],
[
543,
544
],
[
544,
545
],
[
545,
546
],
[
545,
547
],
[
543,
548
],
[
548,
549
],
[
548,
550
],
[
543,
551
],
[
551,
552
],
[
552,
553
],
[
543,
554
],
[
555,
555
],
[
555,
556
],
[
556,
557
],
[
557,
558
],
[
557,
559
],
[
556,
560
],
[
560,
561
],
[
538,
562
],
[
562,
563
],
[
536,
564
],
[
564,
565
],
[
129,
566
],
[
566,
567
],
[
566,
568
],
[
568,
569
],
[
569,
570
],
[
569,
571
],
[
571,
572
],
[
572,
573
],
[
571,
574
],
[
571,
575
],
[
575,
576
],
[
575,
577
],
[
571,
578
],
[
568,
579
],
[
579,
580
],
[
580,
581
],
[
580,
582
],
[
582,
583
],
[
579,
584
],
[
584,
585
],
[
585,
586
],
[
585,
587
],
[
584,
588
],
[
588,
589
],
[
129,
590
],
[
590,
591
],
[
590,
592
],
[
592,
593
],
[
593,
594
],
[
594,
595
],
[
594,
596
],
[
593,
597
],
[
597,
598
],
[
592,
599
],
[
599,
600
],
[
600,
601
],
[
600,
602
],
[
602,
603
],
[
129,
604
],
[
604,
605
],
[
604,
606
],
[
606,
607
],
[
607,
608
],
[
608,
609
],
[
608,
610
],
[
607,
611
],
[
606,
612
],
[
612,
613
],
[
613,
614
],
[
0,
615
],
[
615,
616
],
[
615,
617
]
] |
[
"import java.util.*;\nimport java.io.*;\npublic class Main{\n\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass FastScanner{\t\n private int BUFFER_SIZE = 1 << 16;\n \n private DataInputStream din;\n \n private byte[] buffer;\n \n private int bufferPointer, bytesRead;\n \n public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n \n public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n \n public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n \n public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }\n \n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n}\n ",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }\n\n}",
"Main",
"public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }",
"main",
"{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }",
"FastScanner sc=new FastScanner();",
"sc",
"new FastScanner()",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long [] a=sc.nextLongArray(n);",
"a",
"sc.nextLongArray(n)",
"sc.nextLongArray",
"sc",
"n",
"boolean zero=false;",
"zero",
"false",
"for(int i=0;i<n;i++)if(a[i]==0)zero=true;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"if(a[i]==0)zero=true;",
"if(a[i]==0)zero=true;",
"a[i]==0",
"a[i]",
"a",
"i",
"0",
"zero=true",
"zero",
"true",
"if(zero){\n System.out.println(0);\n return;\n }",
"zero",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"double ans=0;",
"ans",
"0",
"long prod=1;",
"prod",
"1",
"for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }",
"{\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }",
"ans+=Math.log(a[i])",
"ans",
"Math.log(a[i])",
"Math.log",
"Math",
"a[i]",
"a",
"i",
"prod=prod*a[i]",
"prod",
"prod*a[i]",
"prod",
"a[i]",
"a",
"i",
"double maxAns=Math.log((long)(1e18));",
"maxAns",
"Math.log((long)(1e18))",
"Math.log",
"Math",
"(long)(1e18)",
"if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }",
"ans>maxAns || prod>(long)(1e18)|| prod<0",
"ans>maxAns || prod>(long)(1e18)|| prod<0",
"ans>maxAns",
"ans",
"maxAns",
"prod>(long)(1e18)",
"prod",
"(long)(1e18)",
"prod<0",
"prod",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(prod);\n }",
"System.out.println(prod)",
"System.out.println",
"System.out",
"System",
"System.out",
"prod",
"String [] args",
"args",
"class FastScanner{\t\n private int BUFFER_SIZE = 1 << 16;\n \n private DataInputStream din;\n \n private byte[] buffer;\n \n private int bufferPointer, bytesRead;\n \n public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n \n public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n \n public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n \n public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }\n \n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n}",
"FastScanner",
"private int BUFFER_SIZE = 1 << 16;",
"BUFFER_SIZE",
"1 << 16",
"1",
"16",
"private DataInputStream din;",
"din",
"private byte[] buffer;",
"buffer",
"private int bufferPointer",
"bufferPointer",
"bytesRead;",
"bytesRead",
"public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(System.in)",
"din",
"new DataInputStream(System.in)",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(new FileInputStream(file_name))",
"din",
"new DataInputStream(new FileInputStream(file_name))",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"String file_name",
"file_name",
"public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"readLine",
"{\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"byte[] buf = new byte[64];",
"buf",
"new byte[64]",
"64",
"int cnt = 0",
"cnt",
"0",
"c;",
"c",
"while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"(c = read()) != -1",
"(c = read())",
"c",
"read()",
"read",
"-1",
"1",
"{\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"if (c == '\\n')\n break;",
"c == '\\n'",
"c",
"'\\n'",
"break;",
"buf[cnt++] = (byte) c",
"buf[cnt++]",
"buf",
"cnt++",
"cnt",
"(byte) c",
"return new String(buf, 0, cnt);",
"new String(buf, 0, cnt)",
"public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }",
"next",
"{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }",
"byte c = read();",
"c",
"read()",
"read",
"while(Character.isWhitespace(c)){\n c = read();\n }",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"StringBuilder builder = new StringBuilder();",
"builder",
"new StringBuilder()",
"builder.append((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }",
"!Character.isWhitespace(c)",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n builder.append((char)c);\n c = read();\n }",
"builder.append((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"return builder.toString();",
"builder.toString()",
"builder.toString",
"builder",
"public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextInt",
"{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }",
"nextIntArray",
"{\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }",
"int arr[] = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextInt();\n }",
"{\n arr[i] = nextInt();\n }",
"arr[i] = nextInt()",
"arr[i]",
"arr",
"i",
"nextInt()",
"nextInt",
"return arr;",
"arr",
"int n",
"n",
"public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"nextLong",
"{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"long ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }",
"nextLongArray",
"{\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextLong();\n }",
"{\n arr[i] = nextLong();\n }",
"arr[i] = nextLong()",
"arr[i]",
"arr",
"i",
"nextLong()",
"nextLong",
"return arr;",
"arr",
"int n",
"n",
"public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }",
"nextChar",
"{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }",
"byte c = read();",
"c",
"read()",
"read",
"while(Character.isWhitespace(c)){\n c = read();\n }",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"return (char) c;",
"(char) c",
"public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextDouble",
"{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"double ret = 0",
"ret",
"0",
"div = 1;",
"div",
"1",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"c == '.'",
"c",
"'.'",
"{\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret += (c - '0') / (div *= 10);\n }",
"ret += (c - '0') / (div *= 10)",
"ret",
"(c - '0') / (div *= 10)",
"(c - '0')",
"c",
"'0'",
"(div *= 10)",
"div",
"10",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }",
"nextDoubleArray",
"{\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }",
"double arr[] = new double[n];",
"arr",
"new double[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextDouble();\n }",
"{\n arr[i] = nextDouble();\n }",
"arr[i] = nextDouble()",
"arr[i]",
"arr",
"i",
"nextDouble()",
"nextDouble",
"return arr;",
"arr",
"int n",
"n",
"private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"fillBuffer",
"{\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"bytesRead",
"din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"din.read",
"din",
"buffer",
"bufferPointer = 0",
"bufferPointer",
"0",
"BUFFER_SIZE",
"if (bytesRead == -1)\n buffer[0] = -1;",
"bytesRead == -1",
"bytesRead",
"-1",
"1",
"buffer[0] = -1",
"buffer[0]",
"buffer",
"0",
"-1",
"1",
"private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"read",
"{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"if (bufferPointer == bytesRead)\n fillBuffer();",
"bufferPointer == bytesRead",
"bufferPointer",
"bytesRead",
"fillBuffer()",
"fillBuffer",
"return buffer[bufferPointer++];",
"buffer[bufferPointer++]",
"buffer",
"bufferPointer++",
"bufferPointer",
"public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }",
"close",
"{\n if (din == null)\n return;\n din.close();\n }",
"if (din == null)\n return;",
"din == null",
"din",
"null",
"return;",
"din.close()",
"din.close",
"din",
"public class Main{\n\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }\n\n}",
"public class Main{\n\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int n=sc.nextInt();\n long [] a=sc.nextLongArray(n);\n boolean zero=false;\n for(int i=0;i<n;i++)if(a[i]==0)zero=true;\n if(zero){\n System.out.println(0);\n return;\n }\n double ans=0;\n long prod=1;\n for(int i=0;i<n;i++){\n ans+=Math.log(a[i]);\n prod=prod*a[i];\n }\n double maxAns=Math.log((long)(1e18));\n // System.out.println(ans+\" \"+maxAns);\n if(ans>maxAns || prod>(long)(1e18)|| prod<0){\n System.out.println(-1);\n }\n else{\n System.out.println(prod);\n }\n }\n\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main{
public static void main(String [] args) throws IOException{
FastScanner sc=new FastScanner();
int n=sc.nextInt();
long [] a=sc.nextLongArray(n);
boolean zero=false;
for(int i=0;i<n;i++)if(a[i]==0)zero=true;
if(zero){
System.out.println(0);
return;
}
double ans=0;
long prod=1;
for(int i=0;i<n;i++){
ans+=Math.log(a[i]);
prod=prod*a[i];
}
double maxAns=Math.log((long)(1e18));
// System.out.println(ans+" "+maxAns);
if(ans>maxAns || prod>(long)(1e18)|| prod<0){
System.out.println(-1);
}
else{
System.out.println(prod);
}
}
}
class FastScanner{
private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public FastScanner() {
din = new DataInputStream(System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public FastScanner( String file_name) throws IOException {
din = new DataInputStream(new FileInputStream(file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public String readLine() throws IOException {
byte[] buf = new byte[64];
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf, 0, cnt);
}
public String next() throws IOException{
byte c = read();
while(Character.isWhitespace(c)){
c = read();
}
StringBuilder builder = new StringBuilder();
builder.append((char)c);
c = read();
while(!Character.isWhitespace(c)){
builder.append((char)c);
c = read();
}
return builder.toString();
}
public int nextInt() throws IOException {
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public int[] nextIntArray( int n) throws IOException {
int arr[] = new int[n];
for(int i = 0; i < n; i++){
arr[i] = nextInt();
}
return arr;
}
public long nextLong() throws IOException {
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public long[] nextLongArray( int n) throws IOException {
long arr[] = new long[n];
for(int i = 0; i < n; i++){
arr[i] = nextLong();
}
return arr;
}
public char nextChar() throws IOException{
byte c = read();
while(Character.isWhitespace(c)){
c = read();
}
return (char) c;
}
public double nextDouble() throws IOException {
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (c == '.') {
while ((c = read()) >= '0' && c <= '9') {
ret += (c - '0') / (div *= 10);
}
}
if (neg)
return -ret;
return ret;
}
public double[] nextDoubleArray( int n) throws IOException {
double arr[] = new double[n];
for(int i = 0; i < n; i++){
arr[i] = nextDouble();
}
return arr;
}
private void fillBuffer() throws IOException {
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
private byte read() throws IOException {
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException {
if (din == null)
return;
din.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
20,
14,
2,
4,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
113,
8
],
[
113,
9
],
[
9,
10
],
[
9,
11
],
[
113,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
47,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
53,
60
],
[
14,
61
],
[
61,
62
],
[
61,
63
],
[
14,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
76,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
84,
89
],
[
83,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
90,
98
],
[
14,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
105,
106
],
[
14,
107
],
[
107,
108
],
[
108,
109
],
[
12,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] |
[
"import java.math.BigDecimal;\nimport java.util.*;\n\npublic class Main {\n\n static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }\n\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }\n\n}",
"Main",
"static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);",
"MAX",
"new BigDecimal(1_000_000_000_000_000_000L)",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }",
"{\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n \tSystem.out.println(0);\n \treturn;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"BigDecimal d = new BigDecimal(a[0]);",
"d",
"new BigDecimal(a[0])",
"for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }",
"{\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }",
"d = d.multiply(new BigDecimal(a[i]))",
"d",
"d.multiply(new BigDecimal(a[i]))",
"d.multiply",
"d",
"new BigDecimal(a[i])",
"if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }",
"d.compareTo(MAX) == 1",
"d.compareTo(MAX)",
"d.compareTo",
"d",
"MAX",
"1",
"{\n \tSystem.out.println(-1);\n \treturn; \n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(d.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"d.longValue()",
"d.longValue",
"d",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }\n\n}",
"public class Main {\n\n static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n if(a[i] == 0) {\n \tSystem.out.println(0);\n \treturn;\n }\n }\n BigDecimal d = new BigDecimal(a[0]);\n for (int i = 1; i < n; i++) {\n d = d.multiply(new BigDecimal(a[i]));\n if(d.compareTo(MAX) == 1){\n \tSystem.out.println(-1);\n \treturn; \n }\n }\n System.out.println(d.longValue());\n \n sc.close();\n\n }\n\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.*;
public class Main {
static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextLong();
if(a[i] == 0) {
System.out.println(0);
return;
}
}
BigDecimal d = new BigDecimal(a[0]);
for (int i = 1; i < n; i++) {
d = d.multiply(new BigDecimal(a[i]));
if(d.compareTo(MAX) == 1){
System.out.println(-1);
return;
}
}
System.out.println(d.longValue());
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
14,
2,
18,
13,
13,
13,
30,
0,
13,
40,
17,
14,
2,
2,
13,
17,
2,
13,
40,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
4,
18,
13,
13,
4,
18,
13,
18,
13,
13,
17,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
40,
17,
3,
30,
14,
2,
2,
4,
18,
13,
13,
4,
18,
13,
18,
13,
13,
17,
30,
0,
13,
40,
17,
3,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
155,
5
],
[
155,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
43,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
72,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
97,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
96,
108
],
[
95,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
119,
124
],
[
95,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
128,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
136,
138
],
[
127,
139
],
[
126,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
140,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
6,
152
],
[
152,
153
],
[
0,
154
],
[
154,
155
],
[
154,
156
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long a[]=new long[n];",
"a",
"new long[n]",
"n",
"long ans=1;",
"ans",
"1",
"long x=(long)(Math.pow(10, 18));",
"x",
"(long)(Math.pow(10, 18))",
"Math.pow",
"Math",
"10",
"18",
"for(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}",
"a[i]=sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}",
"a[i]==0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\tans=0;\n\t\t\t}",
"ans=0",
"ans",
"0",
"if(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}",
"a[i]>x",
"a[i]",
"a",
"i",
"x",
"{\n\t\t\t\tans=-1;\n\t\t\t}",
"ans=-1",
"ans",
"-1",
"1",
"if(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}",
"ans!=0&&ans!=-1",
"ans!=0",
"ans",
"0",
"ans!=-1",
"ans",
"-1",
"1",
"{\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}",
"if(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"Math.log10(ans)+Math.log10(a[i])<18.5",
"Math.log10(ans)+Math.log10(a[i])",
"Math.log10(ans)",
"Math.log10",
"Math",
"ans",
"Math.log10(a[i])",
"Math.log10",
"Math",
"a[i]",
"a",
"i",
"18.5",
"{\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}",
"ans*=a[i]",
"ans",
"a[i]",
"a",
"i",
"if(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"ans>x",
"ans",
"x",
"{\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"ans=-1",
"ans",
"-1",
"1",
"break;",
"{\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"if(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}",
"Math.log(ans)+Math.log10(a[i])>18",
"Math.log(ans)+Math.log10(a[i])",
"Math.log(ans)",
"Math.log",
"Math",
"ans",
"Math.log10(a[i])",
"Math.log10",
"Math",
"a[i]",
"a",
"i",
"18",
"{\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}",
"ans=-1",
"ans",
"-1",
"1",
"break;",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong a[]=new long[n];\n\t\tlong ans=1;\n\t\tlong x=(long)(Math.pow(10, 18));\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i]=sc.nextLong();\n\t\t\tif(a[i]==0) {\n\t\t\t\tans=0;\n\t\t\t}\n\t\t\tif(a[i]>x) {\n\t\t\t\tans=-1;\n\t\t\t}\n\t\t}\n\t\tif(ans!=0&&ans!=-1) {\n\t\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\t\tif(Math.log10(ans)+Math.log10(a[i])<18.5) {\n\t\t\t\t\tans*=a[i];\n\t\t\t\t\tif(ans>x) {\n\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Math.log(ans)+Math.log10(a[i])>18) {\n\t\t\t\t\t\t\tans=-1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
long a[]=new long[n];
long ans=1;
long x=(long)(Math.pow(10, 18));
for(int i=0;i<n;i++) {
a[i]=sc.nextLong();
if(a[i]==0) {
ans=0;
}
if(a[i]>x) {
ans=-1;
}
}
if(ans!=0&&ans!=-1) {
for(int i=0;i<n;i++) {
if(Math.log10(ans)+Math.log10(a[i])<18.5) {
ans*=a[i];
if(ans>x) {
ans=-1;
break;
}
}
else {
if(Math.log(ans)+Math.log10(a[i])>18) {
ans=-1;
break;
}
}
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
0,
13,
13,
14,
2,
2,
13,
17,
2,
13,
17,
30,
3,
14,
2,
2,
13,
17,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
122,
5
],
[
122,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
47,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
53,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
76,
83
],
[
83,
84
],
[
83,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
86,
94
],
[
94,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
96,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
6,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
]
] |
[
"import java.util.*;\n \npublic class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }",
"main",
"{\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"List<Long> list = new ArrayList<Long>();",
"list",
"new ArrayList<Long>()",
"for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"{\n long a = scan.nextLong();\n list.add(a);\n }",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"list.add(a)",
"list.add",
"list",
"a",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }",
"list.get(0) == 0",
"list.get(0)",
"list.get",
"list",
"0",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans = 1l;",
"ans",
"1l",
"for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }",
"{\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }",
"long a = list.get(i);",
"a",
"list.get(i)",
"list.get",
"list",
"i",
"ans *= a",
"ans",
"a",
"if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }",
"ans > 1000000000000000000l || ans <= 0",
"ans > 1000000000000000000l",
"ans",
"1000000000000000000l",
"ans <= 0",
"ans",
"0",
"{\n break;\n }",
"break;",
"if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }",
"ans > 1000000000000000000l || ans <= 0",
"ans > 1000000000000000000l",
"ans",
"1000000000000000000l",
"ans <= 0",
"ans",
"0",
"{\n //System.out.println(ans);\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n int n = scan.nextInt();\n\n List<Long> list = new ArrayList<Long>();\n for (int i = 0; i < n; i++) {\n long a = scan.nextLong();\n list.add(a);\n }\n\n Collections.sort(list);//System.out.println(list);\n // listの先頭が0だったら、0を出力して即終了\n if (list.get(0) == 0) {\n System.out.println(0);\n return;\n }\n\n long ans = 1l;\n for (int i = 0; i < n; i++) {\n long a = list.get(i);\n ans *= a;\n if (ans > 1000000000000000000l || ans <= 0) {\n break;\n }\n }\n if (ans > 1000000000000000000l || ans <= 0) {\n //System.out.println(ans);\n System.out.println(-1);\n } else {\n System.out.println(ans);\n }\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
List<Long> list = new ArrayList<Long>();
for (int i = 0; i < n; i++) {
long a = scan.nextLong();
list.add(a);
}
Collections.sort(list);//System.out.println(list);
// listの先頭が0だったら、0を出力して即終了
if (list.get(0) == 0) {
System.out.println(0);
return;
}
long ans = 1l;
for (int i = 0; i < n; i++) {
long a = list.get(i);
ans *= a;
if (ans > 1000000000000000000l || ans <= 0) {
break;
}
}
if (ans > 1000000000000000000l || ans <= 0) {
//System.out.println(ans);
System.out.println(-1);
} else {
System.out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
14,
4,
18,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
28,
13,
13,
30,
30,
14,
2,
4,
18,
4,
18,
13,
20,
20,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
4,
18,
13,
20,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
103,
11
],
[
103,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
14,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
49,
50
],
[
14,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
51,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
14,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
71,
77
],
[
70,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
79,
87
],
[
68,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
14,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
12,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.*;\nimport java.math.BigInteger;\nimport java.math.RoundingMode;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"final int N = Integer.parseInt(s.next());",
"N",
"Integer.parseInt(s.next())",
"Integer.parseInt",
"Integer",
"s.next()",
"s.next",
"s",
"BigInteger result = new BigInteger(\"1\");",
"result",
"new BigInteger(\"1\")",
"List<String> aList = new ArrayList<String>();",
"aList",
"new ArrayList<String>()",
"for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n aList.add(s.next());\n }",
"{\n aList.add(s.next());\n }",
"aList.add(s.next())",
"aList.add",
"aList",
"s.next()",
"s.next",
"s",
"if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }",
"aList.contains(\"0\")",
"aList.contains",
"aList",
"\"0\"",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }",
"String aStr",
"aList",
"{\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }",
"{\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }",
"if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }",
"result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0",
"result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\"))",
"result.multiply(new BigInteger(aStr)).compareTo",
"result.multiply(new BigInteger(aStr))",
"result.multiply",
"result",
"new BigInteger(aStr)",
"new BigInteger(\"1000000000000000000\")",
"0",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"result = result.multiply(new BigInteger(aStr))",
"result",
"result.multiply(new BigInteger(aStr))",
"result.multiply",
"result",
"new BigInteger(aStr)",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n final int N = Integer.parseInt(s.next());\n BigInteger result = new BigInteger(\"1\");\n List<String> aList = new ArrayList<String>();\n\n for (int i = 0 ; i < N ; i++) {\n aList.add(s.next());\n }\n\n if (aList.contains(\"0\")) {\n System.out.println(0);\n return;\n }\n\n for (String aStr : aList) {\n if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger(\"1000000000000000000\")) > 0) {\n System.out.println(-1);\n return;\n }\n result = result.multiply(new BigInteger(aStr));\n }\n System.out.println(result);\n }\n}",
"Main"
] |
import java.util.*;
import java.math.BigInteger;
import java.math.RoundingMode;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
final int N = Integer.parseInt(s.next());
BigInteger result = new BigInteger("1");
List<String> aList = new ArrayList<String>();
for (int i = 0 ; i < N ; i++) {
aList.add(s.next());
}
if (aList.contains("0")) {
System.out.println(0);
return;
}
for (String aStr : aList) {
if (result.multiply(new BigInteger(aStr)).compareTo(new BigInteger("1000000000000000000")) > 0) {
System.out.println(-1);
return;
}
result = result.multiply(new BigInteger(aStr));
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
4,
18,
13,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
13,
29,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
18,
13,
13,
29,
40,
17,
0,
13,
18,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
4,
13,
17,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
14,
2,
18,
13,
13,
17,
0,
13,
17,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
252,
20
],
[
252,
21
],
[
21,
22
],
[
252,
23
],
[
23,
24
],
[
252,
25
],
[
25,
26
],
[
25,
27
],
[
252,
28
],
[
28,
29
],
[
252,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
32,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
32,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
32,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
32,
57
],
[
57,
58
],
[
58,
59
],
[
30,
60
],
[
60,
61
],
[
252,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
84,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
64,
101
],
[
101,
102
],
[
62,
103
],
[
103,
104
],
[
62,
105
],
[
105,
106
],
[
252,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
107,
111
],
[
111,
112
],
[
107,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
107,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
122,
131
],
[
131,
132
],
[
131,
133
],
[
121,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
107,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
107,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
154,
155
],
[
107,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
107,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
169,
173
],
[
107,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
186,
188
],
[
181,
189
],
[
189,
190
],
[
190,
191
],
[
181,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
197,
198
],
[
176,
199
],
[
199,
200
],
[
174,
201
],
[
201,
202
],
[
107,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
215,
217
],
[
210,
218
],
[
218,
219
],
[
219,
220
],
[
210,
221
],
[
222,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
227,
228
],
[
222,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
229,
235
],
[
235,
236
],
[
235,
237
],
[
205,
238
],
[
238,
239
],
[
203,
240
],
[
240,
241
],
[
107,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
0,
251
],
[
251,
252
],
[
251,
253
]
] |
[
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n static PrintWriter out;\n static CF_Reader in;\n static long E = 1000000000000000000L;\n static boolean zeros;\n\n public static void main(String[] args) throws IOException {\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }\n\n static long solve(int n, long[] nums) throws IOException {\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }\n\n\n static class CF_Reader {\n BufferedReader br;\n StringTokenizer st;\n\n public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n\n long longNext() throws IOException {\n return Long.parseLong(next());\n }\n\n int intNext() throws IOException {\n return Integer.parseInt(next());\n }\n\n double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }\n\n char charNext() throws IOException {\n return next().charAt(0);\n }\n\n public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }\n\n public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }\n\n String line() throws IOException {\n return br.readLine().trim();\n }\n }\n}\n ",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n static PrintWriter out;\n static CF_Reader in;\n static long E = 1000000000000000000L;\n static boolean zeros;\n\n public static void main(String[] args) throws IOException {\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }\n\n static long solve(int n, long[] nums) throws IOException {\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }\n\n\n static class CF_Reader {\n BufferedReader br;\n StringTokenizer st;\n\n public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n\n long longNext() throws IOException {\n return Long.parseLong(next());\n }\n\n int intNext() throws IOException {\n return Integer.parseInt(next());\n }\n\n double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }\n\n char charNext() throws IOException {\n return next().charAt(0);\n }\n\n public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }\n\n public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }\n\n String line() throws IOException {\n return br.readLine().trim();\n }\n }\n}",
"Main",
"static PrintWriter out;",
"out",
"static CF_Reader in;",
"in",
"static long E = 1000000000000000000L;",
"E",
"1000000000000000000L",
"static boolean zeros;",
"zeros",
"public static void main(String[] args) throws IOException {\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }",
"main",
"{\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }",
"out = new PrintWriter(new OutputStreamWriter(System.out))",
"out",
"new PrintWriter(new OutputStreamWriter(System.out))",
"in = new CF_Reader()",
"in",
"new CF_Reader()",
"int n = in.intNext();",
"n",
"in.intNext()",
"in.intNext",
"in",
"long[] nums = in.nextLongArray(n);",
"nums",
"in.nextLongArray(n)",
"in.nextLongArray",
"in",
"n",
"out.println(solve(n, nums))",
"out.println",
"out",
"solve(n, nums)",
"solve",
"n",
"nums",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static long solve(int n, long[] nums) throws IOException {\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }",
"solve",
"{\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }",
"if (zeros) return 0;",
"zeros",
"return 0;",
"0",
"long res = 1;",
"res",
"1",
"for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }",
"{\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }",
"if (res > E/nums[i]) return -1;",
"res > E/nums[i]",
"res",
"E/nums[i]",
"E",
"nums[i]",
"nums",
"i",
"return -1;",
"-1",
"1",
"res *= nums[i]",
"res",
"nums[i]",
"nums",
"i",
"return res;",
"res",
"int n",
"n",
"long[] nums",
"nums",
"static class CF_Reader {\n BufferedReader br;\n StringTokenizer st;\n\n public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n\n long longNext() throws IOException {\n return Long.parseLong(next());\n }\n\n int intNext() throws IOException {\n return Integer.parseInt(next());\n }\n\n double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }\n\n char charNext() throws IOException {\n return next().charAt(0);\n }\n\n public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }\n\n public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }\n\n String line() throws IOException {\n return br.readLine().trim();\n }\n }",
"CF_Reader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"CF_Reader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine().trim())",
"st",
"new StringTokenizer(br.readLine().trim())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"long longNext() throws IOException {\n return Long.parseLong(next());\n }",
"longNext",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"int intNext() throws IOException {\n return Integer.parseInt(next());\n }",
"intNext",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }",
"doubleNext",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"char charNext() throws IOException {\n return next().charAt(0);\n }",
"charNext",
"{\n return next().charAt(0);\n }",
"return next().charAt(0);",
"next().charAt(0)",
"next().charAt",
"next()",
"next",
"0",
"public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }",
"nextIntArray",
"{\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }",
"final int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n a[i] = intNext();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = intNext();",
"a[i] = intNext()",
"a[i]",
"a",
"i",
"intNext()",
"intNext",
"return a;",
"a",
"final int n",
"n",
"public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }",
"nextLongArray",
"{\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }",
"final long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }",
"{\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }",
"a[i] = longNext()",
"a[i]",
"a",
"i",
"longNext()",
"longNext",
"if (a[i] == 0) zeros = true;",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"zeros = true",
"zeros",
"true",
"return a;",
"a",
"final int n",
"n",
"String line() throws IOException {\n return br.readLine().trim();\n }",
"line",
"{\n return br.readLine().trim();\n }",
"return br.readLine().trim();",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"public class Main {\n static PrintWriter out;\n static CF_Reader in;\n static long E = 1000000000000000000L;\n static boolean zeros;\n\n public static void main(String[] args) throws IOException {\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }\n\n static long solve(int n, long[] nums) throws IOException {\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }\n\n\n static class CF_Reader {\n BufferedReader br;\n StringTokenizer st;\n\n public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n\n long longNext() throws IOException {\n return Long.parseLong(next());\n }\n\n int intNext() throws IOException {\n return Integer.parseInt(next());\n }\n\n double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }\n\n char charNext() throws IOException {\n return next().charAt(0);\n }\n\n public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }\n\n public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }\n\n String line() throws IOException {\n return br.readLine().trim();\n }\n }\n}",
"public class Main {\n static PrintWriter out;\n static CF_Reader in;\n static long E = 1000000000000000000L;\n static boolean zeros;\n\n public static void main(String[] args) throws IOException {\n out = new PrintWriter(new OutputStreamWriter(System.out));\n in = new CF_Reader();\n\n\n int n = in.intNext();\n long[] nums = in.nextLongArray(n);\n out.println(solve(n, nums));\n\n out.close();\n }\n\n static long solve(int n, long[] nums) throws IOException {\n if (zeros) return 0;\n long res = 1;\n for (int i = 0; i < n; i++) {\n if (res > E/nums[i]) return -1;\n res *= nums[i];\n }\n\n return res;\n }\n\n\n static class CF_Reader {\n BufferedReader br;\n StringTokenizer st;\n\n public CF_Reader() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n\n long longNext() throws IOException {\n return Long.parseLong(next());\n }\n\n int intNext() throws IOException {\n return Integer.parseInt(next());\n }\n\n double doubleNext() throws IOException {\n return Double.parseDouble(next());\n }\n\n char charNext() throws IOException {\n return next().charAt(0);\n }\n\n public int[] nextIntArray(final int n) throws IOException {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = intNext();\n return a;\n }\n\n public long[] nextLongArray(final int n) throws IOException {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = longNext();\n if (a[i] == 0) zeros = true;\n }\n return a;\n }\n\n String line() throws IOException {\n return br.readLine().trim();\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main {
static PrintWriter out;
static CF_Reader in;
static long E = 1000000000000000000L;
static boolean zeros;
public static void main(String[] args) throws IOException {
out = new PrintWriter(new OutputStreamWriter(System.out));
in = new CF_Reader();
int n = in.intNext();
long[] nums = in.nextLongArray(n);
out.println(solve(n, nums));
out.close();
}
static long solve(int n, long[] nums) throws IOException {
if (zeros) return 0;
long res = 1;
for (int i = 0; i < n; i++) {
if (res > E/nums[i]) return -1;
res *= nums[i];
}
return res;
}
static class CF_Reader {
BufferedReader br;
StringTokenizer st;
public CF_Reader() throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine().trim());
return st.nextToken();
}
long longNext() throws IOException {
return Long.parseLong(next());
}
int intNext() throws IOException {
return Integer.parseInt(next());
}
double doubleNext() throws IOException {
return Double.parseDouble(next());
}
char charNext() throws IOException {
return next().charAt(0);
}
public int[] nextIntArray(final int n) throws IOException {
final int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = intNext();
return a;
}
public long[] nextLongArray(final int n) throws IOException {
final long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = longNext();
if (a[i] == 0) zeros = true;
}
return a;
}
String line() throws IOException {
return br.readLine().trim();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
2,
2,
13,
13,
13,
30,
0,
13,
13,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
22,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
39,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
54,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
6,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long result=1;",
"result",
"1",
"long zyou = (long) Math.pow(10, 18);",
"zyou",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}",
"a==0",
"a",
"0",
"{\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}",
"result=0",
"result",
"0",
"break;",
"if(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}",
"zyou/result>=a",
"zyou/result",
"zyou",
"result",
"a",
"{\n\t\t\t\tresult*=a;\n\t\t\t}",
"result*=a",
"result",
"a",
"{\n\t\t\t\tresult=-1;\n\t\t\t}",
"result=-1",
"result",
"-1",
"1",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc=new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\t\t//n個の整数\n\t\t/*long zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tlong result=0;\n\n\t\tfor(int i=0;i<n;i++) {\t\t//n個の整数を計算\n\t\t\tlong a=sc.nextLong();\n\t\t\t\n\t\t\tif(i==0) {\n\t\t\t\tresult=a;\n\t\t\t}else {\n\t\t\t\tresult=result*a;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(zyou);\n\t\t//System.out.println(result);\n\t\t\n\t\tif(zyou<result) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(result);\n\t\t}*/\n\t\t\n\t\tlong result=1;\n\t\tlong zyou = (long) Math.pow(10, 18);\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(a==0) {\n\t\t\t\tresult=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(zyou/result>=a) {\n\t\t\t\tresult*=a;\n\t\t\t}else {\n\t\t\t\tresult=-1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc=new Scanner(System.in);
int n=sc.nextInt(); //n個の整数
/*long zyou = (long) Math.pow(10, 18);
long result=0;
for(int i=0;i<n;i++) { //n個の整数を計算
long a=sc.nextLong();
if(i==0) {
result=a;
}else {
result=result*a;
}
}
//System.out.println(zyou);
//System.out.println(result);
if(zyou<result) {
System.out.println(-1);
}else {
System.out.println(result);
}*/
long result=1;
long zyou = (long) Math.pow(10, 18);
for(int i=0;i<n;i++) {
long a=sc.nextLong();
if(a==0) {
result=0;
break;
}
if(zyou/result>=a) {
result*=a;
}else {
result=-1;
}
}
System.out.println(result);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
2,
17,
17,
41,
13,
2,
18,
13,
13,
17,
41,
13,
2,
18,
13,
13,
17,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
13,
17,
30,
41,
13,
20,
41,
13,
20,
28,
13,
13,
30,
30,
0,
13,
4,
18,
13,
20,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
20,
3,
4,
18,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
13,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
18,
4,
18,
4,
13,
17,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
290,
11
],
[
290,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
14,
16
],
[
290,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
290,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
290,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
33,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
33,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
33,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
49,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
71,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
78,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
60,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
94,
95
],
[
31,
96
],
[
96,
97
],
[
31,
98
],
[
98,
99
],
[
290,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
106,
108
],
[
102,
109
],
[
109,
110
],
[
109,
111
],
[
109,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
100,
116
],
[
116,
117
],
[
290,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
118,
122
],
[
122,
123
],
[
118,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
130,
132
],
[
124,
133
],
[
133,
134
],
[
118,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
138,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
137,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
118,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
169,
170
],
[
118,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
118,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
118,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
193,
198
],
[
118,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
211,
213
],
[
206,
214
],
[
214,
215
],
[
215,
216
],
[
206,
217
],
[
218,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
201,
225
],
[
225,
226
],
[
199,
227
],
[
227,
228
],
[
118,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
241,
243
],
[
236,
244
],
[
244,
245
],
[
245,
246
],
[
236,
247
],
[
248,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
253,
254
],
[
231,
255
],
[
255,
256
],
[
229,
257
],
[
257,
258
],
[
118,
259
],
[
259,
260
],
[
259,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
261,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
266,
271
],
[
271,
272
],
[
271,
273
],
[
266,
274
],
[
274,
275
],
[
275,
276
],
[
266,
277
],
[
278,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
283
],
[
283,
284
],
[
261,
285
],
[
285,
286
],
[
259,
287
],
[
287,
288
],
[
0,
289
],
[
289,
290
],
[
289,
291
]
] |
[
"import java.io.*;\nimport java.math.BigInteger;\nimport java.util.*;\n\npublic class Main {\n public static final long mod = (long)1e9+7;\n public static final long INF = Long.MAX_VALUE/2;\n public static final int inf = Integer.MAX_VALUE/2;\n\n static void solve(InputReader in, PrintWriter out){\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }\n\n public static void main(String[] args){\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }\n public static class InputReader{\n private BufferedReader br;\n private StringTokenizer st;\n public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }\n public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n public int ni(){\n return Integer.parseInt(ns());\n }\n public long nl(){\n return Long.parseLong(ns());\n }\n public double nd(){\n return Double.parseDouble(ns());\n }\n public char nc(){\n return ns().toCharArray()[0];\n }\n public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }\n public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }\n public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static final long mod = (long)1e9+7;\n public static final long INF = Long.MAX_VALUE/2;\n public static final int inf = Integer.MAX_VALUE/2;\n\n static void solve(InputReader in, PrintWriter out){\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }\n\n public static void main(String[] args){\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }\n public static class InputReader{\n private BufferedReader br;\n private StringTokenizer st;\n public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }\n public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n public int ni(){\n return Integer.parseInt(ns());\n }\n public long nl(){\n return Long.parseLong(ns());\n }\n public double nd(){\n return Double.parseDouble(ns());\n }\n public char nc(){\n return ns().toCharArray()[0];\n }\n public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }\n public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }\n public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }\n }\n}",
"Main",
"public static final long mod = (long)1e9+7;",
"mod",
"(long)1e9+7",
"(long)1e9",
"7",
"public static final long INF = Long.MAX_VALUE/2;",
"INF",
"Long.MAX_VALUE/2",
"Long.MAX_VALUE",
"Long",
"Long.MAX_VALUE",
"2",
"public static final int inf = Integer.MAX_VALUE/2;",
"inf",
"Integer.MAX_VALUE/2",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"2",
"static void solve(InputReader in, PrintWriter out){\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }",
"solve",
"{\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }",
"int n = in.ni();",
"n",
"in.ni()",
"in.ni",
"in",
"long[] a = in.nl(n);",
"a",
"in.nl(n)",
"in.nl",
"in",
"n",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }",
"a[0]==0",
"a[0]",
"a",
"0",
"0",
"{\n out.println(0);\n }",
"out.println(0)",
"out.println",
"out",
"0",
"{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }",
"BigInteger max = new BigInteger(\"1000000000000000000\");",
"max",
"new BigInteger(\"1000000000000000000\")",
"BigInteger b = new BigInteger(\"1\");",
"b",
"new BigInteger(\"1\")",
"for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }",
"long i",
"a",
"{\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }",
"{\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }",
"b = b.multiply(new BigInteger(Long.toString(i)))",
"b",
"b.multiply(new BigInteger(Long.toString(i)))",
"b.multiply",
"b",
"new BigInteger(Long.toString(i))",
"if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }",
"b.compareTo(max)==1",
"b.compareTo(max)",
"b.compareTo",
"b",
"max",
"1",
"{\n b = new BigInteger(\"-1\");\n break;\n }",
"b = new BigInteger(\"-1\")",
"b",
"new BigInteger(\"-1\")",
"break;",
"out.println(b.toString())",
"out.println",
"out",
"b.toString()",
"b.toString",
"b",
"InputReader in",
"in",
"PrintWriter out",
"out",
"public static void main(String[] args){\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }",
"main",
"{\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }",
"InputReader in = new InputReader(System.in);",
"in",
"new InputReader(System.in)",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"solve(in, out)",
"solve",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public static class InputReader{\n private BufferedReader br;\n private StringTokenizer st;\n public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }\n public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n public int ni(){\n return Integer.parseInt(ns());\n }\n public long nl(){\n return Long.parseLong(ns());\n }\n public double nd(){\n return Double.parseDouble(ns());\n }\n public char nc(){\n return ns().toCharArray()[0];\n }\n public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }\n public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }\n public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }\n }",
"InputReader",
"private BufferedReader br;",
"br",
"private StringTokenizer st;",
"st",
"public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }",
"InputReader",
"{\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }",
"br = new BufferedReader(new InputStreamReader(is))",
"br",
"new BufferedReader(new InputStreamReader(is))",
"st = null",
"st",
"null",
"InputStream is",
"is",
"public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }",
"ns",
"{\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }",
"if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }",
"try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }",
"catch (Exception e){\n throw new RuntimeException(e);\n }",
"Exception e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int ni(){\n return Integer.parseInt(ns());\n }",
"ni",
"{\n return Integer.parseInt(ns());\n }",
"return Integer.parseInt(ns());",
"Integer.parseInt(ns())",
"Integer.parseInt",
"Integer",
"ns()",
"ns",
"public long nl(){\n return Long.parseLong(ns());\n }",
"nl",
"{\n return Long.parseLong(ns());\n }",
"return Long.parseLong(ns());",
"Long.parseLong(ns())",
"Long.parseLong",
"Long",
"ns()",
"ns",
"public double nd(){\n return Double.parseDouble(ns());\n }",
"nd",
"{\n return Double.parseDouble(ns());\n }",
"return Double.parseDouble(ns());",
"Double.parseDouble(ns())",
"Double.parseDouble",
"Double",
"ns()",
"ns",
"public char nc(){\n return ns().toCharArray()[0];\n }",
"nc",
"{\n return ns().toCharArray()[0];\n }",
"return ns().toCharArray()[0];",
"ns().toCharArray()[0]",
"ns().toCharArray()",
"ns().toCharArray",
"ns()",
"ns",
"0",
"public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }",
"ni",
"{\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = ni();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = ni();\n }",
"{\n a[i] = ni();\n }",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"return a;",
"a",
"int n",
"n",
"public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }",
"nl",
"{\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = nl();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = nl();\n }",
"{\n a[i] = nl();\n }",
"a[i] = nl()",
"a[i]",
"a",
"i",
"nl()",
"nl",
"return a;",
"a",
"int n",
"n",
"public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }",
"nd",
"{\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }",
"double[] a = new double[n];",
"a",
"new double[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = nd();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = nd();\n }",
"{\n a[i] = nd();\n }",
"a[i] = nd()",
"a[i]",
"a",
"i",
"nd()",
"nd",
"return a;",
"a",
"int n",
"n",
"public class Main {\n public static final long mod = (long)1e9+7;\n public static final long INF = Long.MAX_VALUE/2;\n public static final int inf = Integer.MAX_VALUE/2;\n\n static void solve(InputReader in, PrintWriter out){\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }\n\n public static void main(String[] args){\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }\n public static class InputReader{\n private BufferedReader br;\n private StringTokenizer st;\n public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }\n public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n public int ni(){\n return Integer.parseInt(ns());\n }\n public long nl(){\n return Long.parseLong(ns());\n }\n public double nd(){\n return Double.parseDouble(ns());\n }\n public char nc(){\n return ns().toCharArray()[0];\n }\n public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }\n public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }\n public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }\n }\n}",
"public class Main {\n public static final long mod = (long)1e9+7;\n public static final long INF = Long.MAX_VALUE/2;\n public static final int inf = Integer.MAX_VALUE/2;\n\n static void solve(InputReader in, PrintWriter out){\n int n = in.ni();\n long[] a = in.nl(n);\n Arrays.sort(a);\n if(a[0]==0){\n out.println(0);\n }else{\n BigInteger max = new BigInteger(\"1000000000000000000\");\n BigInteger b = new BigInteger(\"1\");\n for(long i: a){\n b = b.multiply(new BigInteger(Long.toString(i)));\n if(b.compareTo(max)==1){\n b = new BigInteger(\"-1\");\n break;\n }\n }\n out.println(b.toString());\n }\n }\n\n public static void main(String[] args){\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n solve(in, out);\n out.close();\n }\n public static class InputReader{\n private BufferedReader br;\n private StringTokenizer st;\n public InputReader(InputStream is){\n br = new BufferedReader(new InputStreamReader(is));\n st = null;\n }\n public String ns(){\n if(st == null || !st.hasMoreTokens()){\n try{\n st = new StringTokenizer(br.readLine());\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n public int ni(){\n return Integer.parseInt(ns());\n }\n public long nl(){\n return Long.parseLong(ns());\n }\n public double nd(){\n return Double.parseDouble(ns());\n }\n public char nc(){\n return ns().toCharArray()[0];\n }\n public int[] ni(int n){\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = ni();\n }\n return a;\n }\n public long[] nl(int n){\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nl();\n }\n return a;\n }\n public double[] nd(int n){\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nd();\n }\n return a;\n }\n }\n}",
"Main"
] |
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
public static final long mod = (long)1e9+7;
public static final long INF = Long.MAX_VALUE/2;
public static final int inf = Integer.MAX_VALUE/2;
static void solve(InputReader in, PrintWriter out){
int n = in.ni();
long[] a = in.nl(n);
Arrays.sort(a);
if(a[0]==0){
out.println(0);
}else{
BigInteger max = new BigInteger("1000000000000000000");
BigInteger b = new BigInteger("1");
for(long i: a){
b = b.multiply(new BigInteger(Long.toString(i)));
if(b.compareTo(max)==1){
b = new BigInteger("-1");
break;
}
}
out.println(b.toString());
}
}
public static void main(String[] args){
InputReader in = new InputReader(System.in);
PrintWriter out = new PrintWriter(System.out);
solve(in, out);
out.close();
}
public static class InputReader{
private BufferedReader br;
private StringTokenizer st;
public InputReader(InputStream is){
br = new BufferedReader(new InputStreamReader(is));
st = null;
}
public String ns(){
if(st == null || !st.hasMoreTokens()){
try{
st = new StringTokenizer(br.readLine());
}catch (Exception e){
throw new RuntimeException(e);
}
}
return st.nextToken();
}
public int ni(){
return Integer.parseInt(ns());
}
public long nl(){
return Long.parseLong(ns());
}
public double nd(){
return Double.parseDouble(ns());
}
public char nc(){
return ns().toCharArray()[0];
}
public int[] ni(int n){
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = ni();
}
return a;
}
public long[] nl(int n){
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = nl();
}
return a;
}
public double[] nd(int n){
double[] a = new double[n];
for (int i = 0; i < n; i++) {
a[i] = nd();
}
return a;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
13,
41,
13,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
4,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
0,
13,
17,
3,
14,
40,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
135,
11
],
[
135,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
14,
48
],
[
48,
49
],
[
48,
50
],
[
14,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
14,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
14,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
60,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
89,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
100,
106
],
[
99,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
108,
116
],
[
116,
117
],
[
116,
118
],
[
108,
119
],
[
73,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
130,
131
],
[
12,
132
],
[
132,
133
],
[
0,
134
],
[
134,
135
],
[
134,
136
]
] |
[
"import java.math.BigDecimal;\nimport java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"BigDecimal[] nums = new BigDecimal[N];",
"nums",
"new BigDecimal[N]",
"N",
"for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n nums[i] = new BigDecimal(sc.next());\n }",
"{\n nums[i] = new BigDecimal(sc.next());\n }",
"nums[i] = new BigDecimal(sc.next())",
"nums[i]",
"nums",
"i",
"new BigDecimal(sc.next())",
"final BigDecimal limit = new BigDecimal(\"1000000000000000000\");",
"limit",
"new BigDecimal(\"1000000000000000000\")",
"final BigDecimal zero = new BigDecimal(0);",
"zero",
"new BigDecimal(0)",
"Arrays.sort(nums)",
"Arrays.sort",
"Arrays",
"nums",
"BigDecimal ans = nums[0];",
"ans",
"nums[0]",
"nums",
"0",
"if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }",
"ans.longValue() == 0",
"ans.longValue()",
"ans.longValue",
"ans",
"0",
"{\n System.out.println(0);\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"{\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }",
"boolean over = false;",
"over",
"false",
"for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }",
"{\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }",
"ans = ans.multiply(nums[i])",
"ans",
"ans.multiply(nums[i])",
"ans.multiply",
"ans",
"nums[i]",
"nums",
"i",
"if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }",
"limit.subtract(ans).compareTo(zero) < 0",
"limit.subtract(ans).compareTo(zero)",
"limit.subtract(ans).compareTo",
"limit.subtract(ans)",
"limit.subtract",
"limit",
"ans",
"zero",
"0",
"{\n System.out.println(-1);\n over = true;\n break;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"over = true",
"over",
"true",
"break;",
"if (!over) {\n System.out.println(ans.longValue());\n }",
"!over",
"over",
"{\n System.out.println(ans.longValue());\n }",
"System.out.println(ans.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.longValue()",
"ans.longValue",
"ans",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigDecimal[] nums = new BigDecimal[N];\n for (int i = 0; i < N; i++) {\n nums[i] = new BigDecimal(sc.next());\n }\n final BigDecimal limit = new BigDecimal(\"1000000000000000000\");\n final BigDecimal zero = new BigDecimal(0);\n Arrays.sort(nums);\n BigDecimal ans = nums[0];\n if (ans.longValue() == 0) {\n System.out.println(0);\n } else {\n boolean over = false;\n for (int i = 1; i < N; i++) {\n ans = ans.multiply(nums[i]);\n if (limit.subtract(ans).compareTo(zero) < 0) {\n System.out.println(-1);\n over = true;\n break;\n }\n }\n if (!over) {\n System.out.println(ans.longValue());\n }\n }\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
BigDecimal[] nums = new BigDecimal[N];
for (int i = 0; i < N; i++) {
nums[i] = new BigDecimal(sc.next());
}
final BigDecimal limit = new BigDecimal("1000000000000000000");
final BigDecimal zero = new BigDecimal(0);
Arrays.sort(nums);
BigDecimal ans = nums[0];
if (ans.longValue() == 0) {
System.out.println(0);
} else {
boolean over = false;
for (int i = 1; i < N; i++) {
ans = ans.multiply(nums[i]);
if (limit.subtract(ans).compareTo(zero) < 0) {
System.out.println(-1);
over = true;
break;
}
}
if (!over) {
System.out.println(ans.longValue());
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
17,
13,
18,
13,
13,
30,
4,
18,
13,
40,
17,
29,
0,
13,
18,
13,
13,
14,
2,
2,
13,
17,
2,
13,
17,
30,
4,
18,
13,
40,
17,
29,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
166,
20
],
[
166,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
26,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
23,
34
],
[
34,
35
],
[
34,
36
],
[
23,
37
],
[
37,
38
],
[
37,
39
],
[
23,
40
],
[
40,
41
],
[
40,
42
],
[
23,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
43,
47
],
[
43,
48
],
[
23,
49
],
[
49,
50
],
[
50,
51
],
[
21,
52
],
[
52,
53
],
[
166,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
58,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
58,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
98,
103
],
[
58,
104
],
[
104,
105
],
[
104,
106
],
[
58,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
112,
113
],
[
112,
114
],
[
107,
115
],
[
115,
116
],
[
116,
117
],
[
107,
118
],
[
119,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
125,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
128,
134
],
[
119,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
119,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
148,
154
],
[
58,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
56,
159
],
[
159,
160
],
[
56,
161
],
[
161,
162
],
[
56,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author silviase\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"Scanner in = new Scanner(inputStream);",
"in",
"new Scanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"BMultiplication2 solver = new BMultiplication2();",
"solver",
"new BMultiplication2()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class BMultiplication2 {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }\n\n }",
"BMultiplication2",
"public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }",
"solve",
"{\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long[] num = new long[n];",
"num",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n num[i] = in.nextLong();\n }",
"{\n num[i] = in.nextLong();\n }",
"num[i] = in.nextLong()",
"num[i]",
"num",
"i",
"in.nextLong()",
"in.nextLong",
"in",
"Arrays.sort(num)",
"Arrays.sort",
"Arrays",
"num",
"if (num[0] == 0) {\n out.println(0);\n return;\n }",
"num[0] == 0",
"num[0]",
"num",
"0",
"0",
"{\n out.println(0);\n return;\n }",
"out.println(0)",
"out.println",
"out",
"0",
"return;",
"long ans = 1;",
"ans",
"1",
"for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }",
"{\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }",
"if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }",
"1000000000000000000L / ans < num[i]",
"1000000000000000000L / ans",
"1000000000000000000L",
"ans",
"num[i]",
"num",
"i",
"{\n out.println(-1);\n return;\n }",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"return;",
"ans *= num[i]",
"ans",
"num[i]",
"num",
"i",
"if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }",
"ans > 1000000000000000000L || ans < 0",
"ans > 1000000000000000000L",
"ans",
"1000000000000000000L",
"ans < 0",
"ans",
"0",
"{\n out.println(-1);\n return;\n }",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"return;",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"Scanner in",
"in",
"PrintWriter out",
"out",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n long[] num = new long[n];\n for (int i = 0; i < n; i++) {\n num[i] = in.nextLong();\n }\n Arrays.sort(num);\n if (num[0] == 0) {\n out.println(0);\n return;\n }\n\n long ans = 1;\n for (int i = 0; i < n; i++) {\n if (1000000000000000000L / ans < num[i]) {\n out.println(-1);\n return;\n }\n ans *= num[i];\n if (ans > 1000000000000000000L || ans < 0) {\n out.println(-1);\n return;\n }\n }\n out.println(ans);\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author silviase
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
BMultiplication2 solver = new BMultiplication2();
solver.solve(1, in, out);
out.close();
}
static class BMultiplication2 {
public void solve(int testNumber, Scanner in, PrintWriter out) {
int n = in.nextInt();
long[] num = new long[n];
for (int i = 0; i < n; i++) {
num[i] = in.nextLong();
}
Arrays.sort(num);
if (num[0] == 0) {
out.println(0);
return;
}
long ans = 1;
for (int i = 0; i < n; i++) {
if (1000000000000000000L / ans < num[i]) {
out.println(-1);
return;
}
ans *= num[i];
if (ans > 1000000000000000000L || ans < 0) {
out.println(-1);
return;
}
}
out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
4,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
14,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
40,
17,
30,
14,
2,
2,
13,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
119,
5
],
[
119,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
45,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
58,
63
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
64,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
64,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
8,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
8,
87
],
[
87,
88
],
[
88,
89
],
[
6,
90
],
[
90,
91
],
[
119,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
98,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
94,
114
],
[
114,
115
],
[
92,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] |
[
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }\n static long pow10(int n){\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }\n static long pow10(int n){\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long res = 1;",
"res",
"1",
"long sup = pow10(18);",
"sup",
"pow10(18)",
"pow10",
"18",
"long num;",
"num",
"for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }",
"{\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }",
"num = sc.nextLong()",
"num",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }",
"res == 0",
"res",
"0",
"{\n }",
"if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }",
"num == 0",
"num",
"0",
"{\n res = 0;\n }",
"res = 0",
"res",
"0",
"if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }",
"res == -1",
"res",
"-1",
"1",
"{\n }",
"if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }",
"sup / res >= num",
"sup / res",
"sup",
"res",
"num",
"{\n res = res * num;\n }",
"res = res * num",
"res",
"res * num",
"res",
"num",
"{\n res = -1;\n }",
"res = -1",
"res",
"-1",
"1",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static long pow10(int n){\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }",
"pow10",
"{\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }",
"long c = 1;",
"c",
"1",
"for(int i = 0; i < n; i++){\n c *= 10;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n c *= 10;\n }",
"{\n c *= 10;\n }",
"c *= 10",
"c",
"10",
"return c;",
"c",
"int n",
"n",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }\n static long pow10(int n){\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n\n long res = 1;\n long sup = pow10(18);\n long num;\n for(int i = 0; i < n; i++){\n num = sc.nextLong();\n if(res == 0){\n } else if(num == 0){\n res = 0;\n } else if(res == -1){\n } else if(sup / res >= num){\n res = res * num;\n } else{\n res = -1;\n }\n }\n System.out.println(res);\n sc.close();\n }\n static long pow10(int n){\n long c = 1;\n for(int i = 0; i < n; i++){\n c *= 10;\n }\n return c;\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long res = 1;
long sup = pow10(18);
long num;
for(int i = 0; i < n; i++){
num = sc.nextLong();
if(res == 0){
} else if(num == 0){
res = 0;
} else if(res == -1){
} else if(sup / res >= num){
res = res * num;
} else{
res = -1;
}
}
System.out.println(res);
sc.close();
}
static long pow10(int n){
long c = 1;
for(int i = 0; i < n; i++){
c *= 10;
}
return c;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
18,
13,
13,
41,
13,
4,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
4,
18,
13,
20,
14,
2,
4,
18,
13,
20,
17,
30,
4,
13,
17,
29,
4,
13,
13,
12,
13,
30,
41,
13,
17,
14,
13,
30,
0,
13,
20,
0,
13,
20,
30,
0,
13,
20,
0,
13,
20,
41,
13,
17,
42,
2,
40,
13,
17,
30,
4,
13,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
17,
2,
17,
4,
13,
2,
13,
2,
13,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
393,
11
],
[
393,
12
],
[
12,
13
],
[
393,
14
],
[
14,
15
],
[
393,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
18,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
25,
27
],
[
18,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
18,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
18,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
49,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
49,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
65,
70
],
[
64,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
18,
76
],
[
76,
77
],
[
76,
78
],
[
393,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
85,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
81,
101
],
[
101,
102
],
[
101,
103
],
[
81,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
81,
112
],
[
112,
113
],
[
113,
114
],
[
81,
115
],
[
115,
116
],
[
116,
117
],
[
79,
118
],
[
118,
119
],
[
393,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
120,
127
],
[
127,
128
],
[
393,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
129,
136
],
[
136,
137
],
[
393,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
140,
145
],
[
145,
146
],
[
146,
147
],
[
138,
148
],
[
148,
149
],
[
393,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
393,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
393,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
393,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
393,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
190,
192
],
[
185,
193
],
[
193,
194
],
[
194,
195
],
[
185,
196
],
[
197,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
198,
202
],
[
202,
203
],
[
180,
204
],
[
204,
205
],
[
178,
206
],
[
206,
207
],
[
393,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
215,
223
],
[
223,
224
],
[
224,
225
],
[
215,
226
],
[
227,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
228,
232
],
[
232,
233
],
[
210,
234
],
[
234,
235
],
[
208,
236
],
[
236,
237
],
[
393,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
242,
247
],
[
247,
248
],
[
247,
249
],
[
247,
250
],
[
250,
251
],
[
250,
252
],
[
238,
253
],
[
253,
254
],
[
238,
255
],
[
255,
256
],
[
393,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
261,
265
],
[
261,
266
],
[
266,
267
],
[
266,
268
],
[
266,
269
],
[
269,
270
],
[
269,
271
],
[
257,
272
],
[
272,
273
],
[
257,
274
],
[
274,
275
],
[
393,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
281,
282
],
[
281,
283
],
[
280,
284
],
[
280,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
287,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
291,
293
],
[
276,
294
],
[
294,
295
],
[
393,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
296,
300
],
[
300,
301
],
[
296,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
296,
308
],
[
308,
309
],
[
308,
310
],
[
310,
311
],
[
311,
312
],
[
311,
313
],
[
308,
314
],
[
314,
315
],
[
296,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
319,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
320,
324
],
[
324,
325
],
[
325,
326
],
[
326,
327
],
[
319,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
329,
336
],
[
336,
337
],
[
337,
338
],
[
337,
339
],
[
318,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
296,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
349,
350
],
[
348,
351
],
[
351,
352
],
[
296,
353
],
[
353,
354
],
[
353,
355
],
[
355,
356
],
[
356,
357
],
[
357,
358
],
[
358,
359
],
[
357,
360
],
[
360,
361
],
[
296,
362
],
[
362,
363
],
[
362,
364
],
[
364,
365
],
[
365,
366
],
[
366,
367
],
[
367,
368
],
[
366,
369
],
[
369,
370
],
[
296,
371
],
[
371,
372
],
[
371,
373
],
[
373,
374
],
[
374,
375
],
[
374,
376
],
[
373,
377
],
[
377,
378
],
[
378,
379
],
[
378,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
377,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
388,
389
],
[
373,
390
],
[
390,
391
],
[
0,
392
],
[
392,
393
],
[
392,
394
]
] |
[
"import java.util.*;import java.io.*;import java.math.*;\npublic class Main\n{\n public static void process()throws IOException\n {\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}\n static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main\n{\n public static void process()throws IOException\n {\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}\n static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"Main",
"static AnotherReader sc;",
"sc",
"static PrintWriter out;",
"out",
"public static void process()throws IOException\n {\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }",
"process",
"{\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }",
"int n=ni();",
"n",
"ni()",
"ni",
"BigInteger prod=BigInteger.ONE;",
"prod",
"BigInteger.ONE",
"BigInteger",
"BigInteger.ONE",
"long[]A=nal(n);",
"A",
"nal(n)",
"nal",
"n",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }",
"{\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }",
"String s=Long.toString(A[i]);",
"s",
"Long.toString(A[i])",
"Long.toString",
"Long",
"A[i]",
"A",
"i",
"prod=prod.multiply(new BigInteger(s))",
"prod",
"prod.multiply(new BigInteger(s))",
"prod.multiply",
"prod",
"new BigInteger(s)",
"if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }",
"prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0",
"prod.compareTo(new BigInteger(Long.toString((long)1e18)))",
"prod.compareTo",
"prod",
"new BigInteger(Long.toString((long)1e18))",
"0",
"{\n pn(\"-1\");\n return;\n }",
"pn(\"-1\")",
"pn",
"\"-1\"",
"return;",
"pn(prod)",
"pn",
"prod",
"public static void main(String[]args)throws IOException\n {\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }",
"main",
"{\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }",
"boolean oj =true;",
"oj",
"true",
"if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}",
"oj",
"{sc=new AnotherReader();out=new PrintWriter(System.out);}",
"sc=new AnotherReader()",
"sc",
"new AnotherReader()",
"out=new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}",
"sc=new AnotherReader(100)",
"sc",
"new AnotherReader(100)",
"out=new PrintWriter(\"output.txt\")",
"out",
"new PrintWriter(\"output.txt\")",
"int t=1;",
"t",
"1",
"while(t-->0) {process();}",
"t-->0",
"t--",
"t",
"0",
"{process();}",
"process()",
"process",
"out.flush()",
"out.flush",
"out",
"out.close()",
"out.close",
"out",
"String[]args",
"args",
"static void pn(Object o){out.println(o);}",
"pn",
"{out.println(o);}",
"out.println(o)",
"out.println",
"out",
"o",
"Object o",
"o",
"static void p(Object o){out.print(o);}",
"p",
"{out.print(o);}",
"out.print(o)",
"out.print",
"out",
"o",
"Object o",
"o",
"static void pni(Object o){out.println(o);out.flush();}",
"pni",
"{out.println(o);out.flush();}",
"out.println(o)",
"out.println",
"out",
"o",
"out.flush()",
"out.flush",
"out",
"Object o",
"o",
"static int ni()throws IOException{return sc.nextInt();}",
"ni",
"{return sc.nextInt();}",
"return sc.nextInt();",
"sc.nextInt()",
"sc.nextInt",
"sc",
"static long nl()throws IOException{return sc.nextLong();}",
"nl",
"{return sc.nextLong();}",
"return sc.nextLong();",
"sc.nextLong()",
"sc.nextLong",
"sc",
"static double nd()throws IOException{return sc.nextDouble();}",
"nd",
"{return sc.nextDouble();}",
"return sc.nextDouble();",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"static String nln()throws IOException{return sc.nextLine();}",
"nln",
"{return sc.nextLine();}",
"return sc.nextLine();",
"sc.nextLine()",
"sc.nextLine",
"sc",
"static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}",
"nai",
"{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}",
"int[]A=new int[N];",
"A",
"new int[N]",
"N",
"for(int i=0;i!=N;i++){A[i]=ni();}",
"int i=0;",
"int i=0;",
"i",
"0",
"i!=N",
"i",
"N",
"i++",
"i++",
"i",
"{A[i]=ni();}",
"{A[i]=ni();}",
"A[i]=ni()",
"A[i]",
"A",
"i",
"ni()",
"ni",
"return A;",
"A",
"int N",
"N",
"static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}",
"nal",
"{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}",
"long[]A=new long[N];",
"A",
"new long[N]",
"N",
"for(int i=0;i!=N;i++){A[i]=nl();}",
"int i=0;",
"int i=0;",
"i",
"0",
"i!=N",
"i",
"N",
"i++",
"i++",
"i",
"{A[i]=nl();}",
"{A[i]=nl();}",
"A[i]=nl()",
"A[i]",
"A",
"i",
"nl()",
"nl",
"return A;",
"A",
"int N",
"N",
"static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}",
"bit",
"{return (n==0)?0:(1+bit(n&(n-1)));}",
"return (n==0)?0:(1+bit(n&(n-1)));",
"(n==0)?0:(1+bit(n&(n-1)))",
"(n==0)",
"n",
"0",
"0",
"(1+bit(n&(n-1)))",
"1",
"bit(n&(n-1))",
"bit",
"n&(n-1)",
"n",
"(n-1)",
"n",
"1",
"long n",
"n",
"static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}",
"AnotherReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}",
"AnotherReader",
"{\n br=new BufferedReader(new InputStreamReader(System.in));}",
"br=new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}",
"AnotherReader",
"{\n br = new BufferedReader(new FileReader(\"input.txt\"));}",
"br = new BufferedReader(new FileReader(\"input.txt\"))",
"br",
"new BufferedReader(new FileReader(\"input.txt\"))",
"int a",
"a",
"String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); }",
"while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}",
"try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }",
"catch (IOException e){ e.printStackTrace(); }",
"IOException e",
"{ e.printStackTrace(); }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());}",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() throws IOException{\n return Integer.parseInt(next());}",
"nextInt",
"{\n return Integer.parseInt(next());}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() throws IOException\n {return Long.parseLong(next());}",
"nextLong",
"{return Long.parseLong(next());}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble()throws IOException { return Double.parseDouble(next()); }",
"nextDouble",
"{ return Double.parseDouble(next()); }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}",
"nextLine",
"{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}",
"String str = \"\";",
"str",
"\"\"",
"try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();}",
"catch (IOException e){\n e.printStackTrace();}",
"IOException e",
"{\n e.printStackTrace();}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main\n{\n public static void process()throws IOException\n {\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}\n static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"public class Main\n{\n public static void process()throws IOException\n {\n int n=ni();\n BigInteger prod=BigInteger.ONE;\n long[]A=nal(n);\n Arrays.sort(A);\n for(int i=0;i<n;i++)\n {\n String s=Long.toString(A[i]);\n prod=prod.multiply(new BigInteger(s));\n if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)\n {\n pn(\"-1\");\n return;\n }\n }\n pn(prod);\n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n boolean oj =true;\n if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}\n else{sc=new AnotherReader(100);out=new PrintWriter(\"output.txt\");}\n int t=1;\n // t=ni();\n while(t-->0) {process();}\n out.flush();out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}\n static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"Main"
] |
import java.util.*;import java.io.*;import java.math.*;
public class Main
{
public static void process()throws IOException
{
int n=ni();
BigInteger prod=BigInteger.ONE;
long[]A=nal(n);
Arrays.sort(A);
for(int i=0;i<n;i++)
{
String s=Long.toString(A[i]);
prod=prod.multiply(new BigInteger(s));
if(prod.compareTo(new BigInteger(Long.toString((long)1e18)))>0)
{
pn("-1");
return;
}
}
pn(prod);
}
static AnotherReader sc;
static PrintWriter out;
public static void main(String[]args)throws IOException
{
boolean oj =true;
if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
int t=1;
// t=ni();
while(t-->0) {process();}
out.flush();out.close();
}
static void pn(Object o){out.println(o);}
static void p(Object o){out.print(o);}
static void pni(Object o){out.println(o);out.flush();}
static int ni()throws IOException{return sc.nextInt();}
static long nl()throws IOException{return sc.nextLong();}
static double nd()throws IOException{return sc.nextDouble();}
static String nln()throws IOException{return sc.nextLine();}
static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
static class AnotherReader{BufferedReader br; StringTokenizer st;
AnotherReader()throws FileNotFoundException{
br=new BufferedReader(new InputStreamReader(System.in));}
AnotherReader(int a)throws FileNotFoundException{
br = new BufferedReader(new FileReader("input.txt"));}
String next()throws IOException{
while (st == null || !st.hasMoreElements()) {try{
st = new StringTokenizer(br.readLine());}
catch (IOException e){ e.printStackTrace(); }}
return st.nextToken(); } int nextInt() throws IOException{
return Integer.parseInt(next());}
long nextLong() throws IOException
{return Long.parseLong(next());}
double nextDouble()throws IOException { return Double.parseDouble(next()); }
String nextLine() throws IOException{ String str = ""; try{
str = br.readLine();} catch (IOException e){
e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
17,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
8,
55
],
[
55,
56
],
[
55,
57
],
[
8,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
79,
87
],
[
71,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
8,
100
],
[
100,
101
],
[
101,
102
],
[
6,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long a[] = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long prod = 1;",
"prod",
"1",
"for (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}",
"if (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}",
"1000000000000000000l / prod< a[i]",
"1000000000000000000l / prod",
"1000000000000000000l",
"prod",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"{\n\t\t\t\tprod *= a[i];\n\t\t\t}",
"prod *= a[i]",
"prod",
"a[i]",
"a",
"i",
"System.out.println(prod)",
"System.out.println",
"System.out",
"System",
"System.out",
"prod",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif (a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlong prod = 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (1000000000000000000l / prod< a[i]) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tprod *= a[i];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(prod);\n\n\t\tsc.close();\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long a[] = new long[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextLong();
if (a[i] == 0) {
System.out.println(0);
return;
}
}
long prod = 1;
for (int i = 0; i < n; i++) {
if (1000000000000000000l / prod< a[i]) {
System.out.println(-1);
return;
} else {
prod *= a[i];
}
}
System.out.println(prod);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
17,
17,
4,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
4,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
17,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
142,
8
],
[
142,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
35,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
11,
60
],
[
60,
61
],
[
60,
62
],
[
11,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
75,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
88,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
11,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
115,
119
],
[
114,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
11,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
9,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
]
] |
[
"import java.util.*; \nimport java.lang.*; \n\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ArrayList<Long> a = new ArrayList<>();",
"a",
"new ArrayList<>()",
"for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }",
"{\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }",
"long A1 = scan.nextLong();",
"A1",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(A1==0){\n System.out.println(0);\n System.exit(0);\n }",
"A1==0",
"A1",
"0",
"{\n System.out.println(0);\n System.exit(0);\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"System.exit(0)",
"System.exit",
"System",
"0",
"a.add(A1)",
"a.add",
"a",
"A1",
"long ans = 1;",
"ans",
"1",
"for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n }",
"{\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n }",
"long q = (long)Math.pow(10,18)/(long)a.get(i);",
"q",
"(long)Math.pow(10,18)/(long)a.get(i)",
"(long)Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"(long)a.get(i)",
"a.get",
"a",
"i",
"if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }",
"ans<=q",
"ans",
"q",
"{\n ans = ans * a.get(i);\n }",
"ans = ans * a.get(i)",
"ans",
"ans * a.get(i)",
"ans",
"a.get(i)",
"a.get",
"a",
"i",
"{\n System.out.println(-1);\n System.exit(0);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.exit(0)",
"System.exit",
"System",
"0",
"if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }",
"(long)Math.pow(10,18)<ans",
"(long)Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"ans",
"{\n System.out.println(-1);\n System.exit(0);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.exit(0)",
"System.exit",
"System",
"0",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n ArrayList<Long> a = new ArrayList<>(); \n for(int i=0; i<N;i++){\n long A1 = scan.nextLong();\n if(A1==0){\n System.out.println(0);\n System.exit(0);\n }\n a.add(A1);\n }\n long ans = 1;\n for(int i=0; i<N;i++){\n long q = (long)Math.pow(10,18)/(long)a.get(i);\n if(ans<=q){\n ans = ans * a.get(i);\n }else{\n System.out.println(-1);\n System.exit(0);\n }\n } \n if((long)Math.pow(10,18)<ans){\n System.out.println(-1);\n System.exit(0);\n }\n System.out.println(ans);\n \n }\n}",
"Main"
] |
import java.util.*;
import java.lang.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
ArrayList<Long> a = new ArrayList<>();
for(int i=0; i<N;i++){
long A1 = scan.nextLong();
if(A1==0){
System.out.println(0);
System.exit(0);
}
a.add(A1);
}
long ans = 1;
for(int i=0; i<N;i++){
long q = (long)Math.pow(10,18)/(long)a.get(i);
if(ans<=q){
ans = ans * a.get(i);
}else{
System.out.println(-1);
System.exit(0);
}
}
if((long)Math.pow(10,18)<ans){
System.out.println(-1);
System.exit(0);
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
29,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
0,
13,
17,
3,
14,
2,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
18,
13,
13,
14,
2,
2,
4,
18,
13,
13,
17,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
0,
13,
17,
3,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
18,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
23,
32
],
[
32,
33
],
[
32,
34
],
[
23,
35
],
[
35,
36
],
[
35,
37
],
[
23,
38
],
[
38,
39
],
[
38,
40
],
[
23,
41
],
[
41,
42
],
[
41,
43
],
[
23,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
23,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
84,
91
],
[
91,
92
],
[
91,
93
],
[
84,
94
],
[
23,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
121,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
132,
134
],
[
124,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
135,
142
],
[
142,
143
],
[
142,
144
],
[
135,
145
],
[
99,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
15,
156
],
[
156,
157
]
] |
[
"import java.util.*;\nimport java.lang.*;\nimport java.io.*;\nimport java.math.BigInteger;\n/* Name of the class has to be \"Main\" only if the class is public. */\nclass Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{try {\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}\n\t\t\tcatch(Exception e) {\n\treturn;}\n\t}}\n\t\n",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{try {\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}\n\t\t\tcatch(Exception e) {\n\treturn;}\n\t}}",
"Main",
"public static void main (String[] args) throws java.lang.Exception\n\t{try {\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}\n\t\t\tcatch(Exception e) {\n\treturn;}\n\t}",
"main",
"{try {\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}\n\t\t\tcatch(Exception e) {\n\treturn;}\n\t}",
"try {\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}\n\t\t\tcatch(Exception e) {\n\treturn;}",
"catch(Exception e) {\n\treturn;}",
"Exception e",
"{\n\treturn;}",
"return;",
"{\n\t \n\t\n\t Scanner k=new Scanner(System.in);\n\t\tint n=k.nextInt();int kg=0;\n\t\tBigInteger f=new BigInteger(\"1\");\t\n\t\tBigInteger ff=new BigInteger(\"1000000000000000000\");\n\t\tlong ar[]=new long[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}\n\t\t if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}}",
"Scanner k=new Scanner(System.in);",
"k",
"new Scanner(System.in)",
"int n=k.nextInt();",
"n",
"k.nextInt()",
"k.nextInt",
"k",
"int kg=0;",
"kg",
"0",
"BigInteger f=new BigInteger(\"1\");",
"f",
"new BigInteger(\"1\")",
"BigInteger ff=new BigInteger(\"1000000000000000000\");",
"ff",
"new BigInteger(\"1000000000000000000\")",
"long ar[]=new long[n];",
"ar",
"new long[n]",
"n",
"for(int i=0;i<n;i++)\n\t\t{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}",
"{\n\t\t ar[i]=k.nextLong();\n\t\t \n\t\t}",
"ar[i]=k.nextLong()",
"ar[i]",
"ar",
"i",
"k.nextLong()",
"k.nextLong",
"k",
"for(int i=0;i<n;i++)\n\t\t{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}",
"{\n\t\t if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }}",
"if(ar[i]==0)\n\t\t {\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }",
"ar[i]==0",
"ar[i]",
"ar",
"i",
"0",
"{\n\t\t System.out.print(0);kg=99;\n\t\t break;\n\t\t }",
"System.out.print(0)",
"System.out.print",
"System.out",
"System",
"System.out",
"0",
"kg=99",
"kg",
"99",
"break;",
"if(kg==0)\n\t\t { for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}",
"kg==0",
"kg",
"0",
"{ for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}\n\t\tif(kg==0)\n\t\t\tSystem.out.print(f);}",
"for(int i=0;i<n;i++)\n\t\t{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}",
"{\n\t\t f=f.multiply(BigInteger.valueOf(ar[i]));\n\t\t if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}\n\t\t}",
"f=f.multiply(BigInteger.valueOf(ar[i]))",
"f",
"f.multiply(BigInteger.valueOf(ar[i]))",
"f.multiply",
"f",
"BigInteger.valueOf(ar[i])",
"BigInteger.valueOf",
"BigInteger",
"ar[i]",
"ar",
"i",
"if(f.compareTo(ff)==1 && kg==0)\n\t\t{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}",
"f.compareTo(ff)==1 && kg==0",
"f.compareTo(ff)==1",
"f.compareTo(ff)",
"f.compareTo",
"f",
"ff",
"1",
"kg==0",
"kg",
"0",
"{\n\t\t System.out.print(\"-1\");kg=99;\n\t\tbreak;}",
"System.out.print(\"-1\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"-1\"",
"kg=99",
"kg",
"99",
"break;",
"if(kg==0)\n\t\t\tSystem.out.print(f);",
"kg==0",
"kg",
"0",
"System.out.print(f)",
"System.out.print",
"System.out",
"System",
"System.out",
"f",
"String[] args",
"args"
] |
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{try {
Scanner k=new Scanner(System.in);
int n=k.nextInt();int kg=0;
BigInteger f=new BigInteger("1");
BigInteger ff=new BigInteger("1000000000000000000");
long ar[]=new long[n];
for(int i=0;i<n;i++)
{
ar[i]=k.nextLong();
}
for(int i=0;i<n;i++)
{
if(ar[i]==0)
{
System.out.print(0);kg=99;
break;
}}
if(kg==0)
{ for(int i=0;i<n;i++)
{
f=f.multiply(BigInteger.valueOf(ar[i]));
if(f.compareTo(ff)==1 && kg==0)
{
System.out.print("-1");kg=99;
break;}
}
if(kg==0)
System.out.print(f);}}
catch(Exception e) {
return;}
}}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
13,
17,
29,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
17,
13,
30,
0,
13,
18,
13,
13,
30,
4,
13,
40,
17,
29,
4,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
115,
8
],
[
115,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
45,
46
],
[
11,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
11,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
11,
62
],
[
62,
63
],
[
62,
64
],
[
11,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
78,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
92,
97
],
[
11,
98
],
[
98,
99
],
[
98,
100
],
[
9,
101
],
[
101,
102
],
[
115,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
103,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] |
[
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}\n\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}\n\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"for(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tA[i] = sc.nextLong();\n\t\t}",
"{\n\t\t\tA[i] = sc.nextLong();\n\t\t}",
"A[i] = sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"sc.close()",
"sc.close",
"sc",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"if(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}",
"A[0] == 0",
"A[0]",
"A",
"0",
"0",
"{\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}",
"prtln(0)",
"prtln",
"0",
"return;",
"long answer = 1L;",
"answer",
"1L",
"for(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}",
"A[i] <= (long)(1e18) / answer",
"A[i]",
"A",
"i",
"(long)(1e18) / answer",
"(long)(1e18)",
"answer",
"{\n\t\t\t\tanswer *= A[i];\n\t\t\t}",
"answer *= A[i]",
"answer",
"A[i]",
"A",
"i",
"{\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}",
"prtln(-1)",
"prtln",
"-1",
"1",
"return;",
"prtln(answer)",
"prtln",
"answer",
"String[] args",
"args",
"public static <T> void prtln(T t) { System.out.println(t); }",
"prtln",
"{ System.out.println(t); }",
"System.out.println(t)",
"System.out.println",
"System.out",
"System",
"System.out",
"t",
"T t",
"t",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}\n\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tArrays.sort(A);\n\t\t// 0があるなら答えは必ず0\n\t\tif(A[0] == 0) {\n\t\t\tprtln(0);\n\t\t\treturn;\n\t\t}\n\t\tlong answer = 1L;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(A[i] <= (long)(1e18) / answer) {\n\t\t\t\tanswer *= A[i];\n\t\t\t} else {\n\t\t\t\tprtln(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tprtln(answer);\n\t}\n\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[] A = new long[N];
for(int i = 0; i < N; i++) {
A[i] = sc.nextLong();
}
sc.close();
Arrays.sort(A);
// 0があるなら答えは必ず0
if(A[0] == 0) {
prtln(0);
return;
}
long answer = 1L;
for(int i = 0; i < N; i++) {
if(A[i] <= (long)(1e18) / answer) {
answer *= A[i];
} else {
prtln(-1);
return;
}
}
prtln(answer);
}
public static <T> void prtln(T t) { System.out.println(t); }
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
40,
17,
30,
14,
2,
13,
17,
30,
0,
13,
17,
3,
30,
9,
14,
2,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
40,
17,
9,
0,
13,
2,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
99,
5
],
[
99,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
47,
56
],
[
56,
57
],
[
35,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
61,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
60,
70
],
[
59,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
58,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
76,
81
],
[
35,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
8,
87
],
[
87,
88
],
[
88,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
6,
96
],
[
96,
97
],
[
0,
98
],
[
98,
99
],
[
98,
100
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }\n}",
"Main",
"public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }",
"main",
"{\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }",
"final Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long k = 1;",
"k",
"1",
"long l = 1;",
"l",
"1",
"for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }",
"{\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }",
"l = sc.nextLong()",
"l",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }",
"k == -1",
"k",
"-1",
"1",
"{\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }",
"if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }",
"l == 0",
"l",
"0",
"{\n k = 0;\n break;\n }",
"k = 0",
"k",
"0",
"break;",
"{\n continue;\n }",
"continue;",
"if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }",
"Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L",
"Math.log10(k) + Math.log10(l) > 18",
"Math.log10(k) + Math.log10(l)",
"Math.log10(k)",
"Math.log10",
"Math",
"k",
"Math.log10(l)",
"Math.log10",
"Math",
"l",
"18",
"l * k > 1000000000000000000L",
"l * k",
"l",
"k",
"1000000000000000000L",
"{\n k = -1;\n continue;\n }",
"k = -1",
"k",
"-1",
"1",
"continue;",
"k = l * k",
"k",
"l * k",
"l",
"k",
"sc.close()",
"sc.close",
"sc",
"System.out.println(k)",
"System.out.println",
"System.out",
"System",
"System.out",
"k",
"final String[] args",
"args",
"public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }\n}",
"public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n long n = sc.nextInt();\n long k = 1;\n long l = 1;\n for (int i = 0; i < n; i++) {\n l = sc.nextLong();\n if (k == -1) {\n if (l == 0) {\n k = 0;\n break;\n } else {\n continue;\n }\n }\n if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {\n k = -1;\n continue;\n }\n k = l * k;\n }\n\n sc.close();\n System.out.println(k);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(final String[] args) {
final Scanner sc = new Scanner(System.in);
// 整数の入力
// final int a = sc.nextInt();
// 文字列の入力
// final String s1 = sc.next();
long n = sc.nextInt();
long k = 1;
long l = 1;
for (int i = 0; i < n; i++) {
l = sc.nextLong();
if (k == -1) {
if (l == 0) {
k = 0;
break;
} else {
continue;
}
}
if (Math.log10(k) + Math.log10(l) > 18 || l * k > 1000000000000000000L) {
k = -1;
continue;
}
k = l * k;
}
sc.close();
System.out.println(k);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
2,
4,
18,
13,
17,
17,
17,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
0,
13,
13,
14,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
13,
30,
0,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
2,
13,
13,
30,
0,
13,
17,
0,
13,
13,
14,
13,
30,
0,
13,
17,
14,
2,
2,
2,
13,
2,
13,
13,
13,
13,
30,
0,
13,
40,
17,
4,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
4,
18,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
29,
17,
30,
29,
2,
13,
4,
13,
2,
13,
17,
23,
13,
12,
13,
30,
29,
8,
2,
2,
13,
17,
2,
13,
17,
13,
2,
4,
13,
2,
13,
17,
4,
13,
2,
13,
17,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
495,
5
],
[
495,
6
],
[
6,
7
],
[
6,
8
],
[
495,
9
],
[
9,
10
],
[
9,
11
],
[
495,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
15,
18
],
[
15,
19
],
[
14,
20
],
[
495,
21
],
[
21,
22
],
[
21,
23
],
[
495,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
36,
40
],
[
26,
41
],
[
41,
42
],
[
41,
43
],
[
26,
44
],
[
44,
45
],
[
44,
46
],
[
26,
47
],
[
47,
48
],
[
47,
49
],
[
26,
50
],
[
50,
51
],
[
50,
52
],
[
26,
53
],
[
53,
54
],
[
53,
55
],
[
26,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
68,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
68,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
68,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
68,
109
],
[
109,
110
],
[
109,
111
],
[
26,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
112,
118
],
[
118,
119
],
[
121,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
120,
126
],
[
121,
127
],
[
118,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
26,
133
],
[
133,
134
],
[
133,
135
],
[
24,
136
],
[
136,
137
],
[
495,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
495,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
495,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
495,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
495,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
495,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
183,
184
],
[
183,
185
],
[
178,
186
],
[
186,
187
],
[
187,
188
],
[
178,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
195,
197
],
[
175,
198
],
[
198,
199
],
[
495,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
209,
211
],
[
204,
212
],
[
204,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
216,
218
],
[
213,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
221,
223
],
[
200,
224
],
[
224,
225
],
[
495,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
234,
236
],
[
234,
237
],
[
226,
238
],
[
238,
239
],
[
226,
240
],
[
240,
241
],
[
495,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
250,
251
],
[
250,
252
],
[
250,
253
],
[
242,
254
],
[
254,
255
],
[
242,
256
],
[
256,
257
],
[
495,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
262,
266
],
[
262,
267
],
[
267,
268
],
[
267,
269
],
[
267,
270
],
[
270,
271
],
[
270,
272
],
[
258,
273
],
[
273,
274
],
[
258,
275
],
[
275,
276
],
[
495,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
281,
285
],
[
281,
286
],
[
286,
287
],
[
286,
288
],
[
286,
289
],
[
289,
290
],
[
289,
291
],
[
277,
292
],
[
292,
293
],
[
277,
294
],
[
294,
295
],
[
495,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
299,
304
],
[
296,
305
],
[
305,
306
],
[
495,
307
],
[
307,
308
],
[
307,
309
],
[
309,
310
],
[
310,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
310,
315
],
[
307,
316
],
[
316,
317
],
[
495,
318
],
[
318,
319
],
[
318,
320
],
[
320,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
321,
326
],
[
318,
327
],
[
327,
328
],
[
495,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
334,
336
],
[
332,
337
],
[
329,
338
],
[
338,
339
],
[
495,
340
],
[
340,
341
],
[
340,
342
],
[
342,
343
],
[
343,
344
],
[
344,
345
],
[
345,
346
],
[
345,
347
],
[
343,
348
],
[
340,
349
],
[
349,
350
],
[
495,
351
],
[
351,
352
],
[
351,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
356,
357
],
[
356,
358
],
[
354,
359
],
[
359,
360
],
[
360,
361
],
[
351,
362
],
[
362,
363
],
[
495,
364
],
[
364,
365
],
[
364,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
367,
372
],
[
364,
373
],
[
373,
374
],
[
495,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
378,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
378,
383
],
[
375,
384
],
[
384,
385
],
[
495,
386
],
[
386,
387
],
[
386,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
391,
392
],
[
391,
393
],
[
389,
394
],
[
386,
395
],
[
395,
396
],
[
495,
397
],
[
397,
398
],
[
397,
399
],
[
399,
400
],
[
400,
401
],
[
401,
402
],
[
402,
403
],
[
402,
404
],
[
400,
405
],
[
397,
406
],
[
406,
407
],
[
495,
408
],
[
408,
409
],
[
408,
410
],
[
410,
411
],
[
411,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
411,
416
],
[
408,
417
],
[
417,
418
],
[
495,
419
],
[
419,
420
],
[
419,
421
],
[
421,
422
],
[
422,
423
],
[
423,
424
],
[
424,
425
],
[
423,
426
],
[
423,
427
],
[
419,
428
],
[
428,
429
],
[
419,
430
],
[
430,
431
],
[
495,
432
],
[
432,
433
],
[
432,
434
],
[
434,
435
],
[
435,
436
],
[
436,
437
],
[
437,
438
],
[
436,
439
],
[
436,
440
],
[
432,
441
],
[
441,
442
],
[
432,
443
],
[
443,
444
],
[
495,
445
],
[
445,
446
],
[
445,
447
],
[
447,
448
],
[
448,
449
],
[
449,
450
],
[
450,
451
],
[
449,
452
],
[
449,
453
],
[
445,
454
],
[
454,
455
],
[
445,
456
],
[
456,
457
],
[
495,
458
],
[
458,
459
],
[
458,
460
],
[
460,
461
],
[
461,
462
],
[
462,
463
],
[
463,
464
],
[
462,
465
],
[
462,
466
],
[
458,
467
],
[
467,
468
],
[
458,
469
],
[
469,
470
],
[
0,
471
],
[
471,
472
],
[
471,
473
],
[
473,
474
],
[
471,
475
],
[
475,
476
],
[
471,
477
],
[
477,
478
],
[
477,
479
],
[
479,
480
],
[
480,
481
],
[
481,
482
],
[
481,
483
],
[
480,
484
],
[
479,
485
],
[
485,
486
],
[
486,
487
],
[
486,
488
],
[
485,
489
],
[
477,
490
],
[
490,
491
],
[
477,
492
],
[
492,
493
],
[
0,
494
],
[
494,
495
],
[
494,
496
]
] |
[
"import java.util.Scanner;\n\n\npublic class Main {\n\n public static String Y = \"Yes\";\n public static String N = \"No\";\n public static long MOD = (long) (Math.pow(10, 9) + 7);\n public static Scanner sc = new Scanner(System.in);\n\n public static void main(String[] args) {\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }\n\n /*\n * 以下メソッド集\n */\n static int ni() {\n\n return sc.nextInt();\n }\n\n static long nl() {\n\n return sc.nextLong();\n }\n\n static double nd() {\n\n return sc.nextDouble();\n }\n\n static String n() {\n\n return sc.next();\n }\n\n static char[] nc() {\n\n return sc.next().toCharArray();\n }\n\n static int kaijo(int n) {\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }\n\n static int fib(int n) {\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }\n\n static long lcm(long m, long n) {\n\n return m * n / gcd(m, n);\n }\n\n static int lcm(int m, int n) {\n\n return m * n / gcd(m, n);\n }\n\n static long gcd(long a, long b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static int gcd(int a, int b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static void out(String info) {\n\n System.out.println(info);\n }\n\n static void out(int info) {\n\n System.out.println(info);\n }\n\n static void out(double info) {\n\n System.out.println(info);\n }\n\n static void out(long info) {\n\n System.out.println(info);\n }\n\n static void out(char info) {\n\n System.out.println(info);\n }\n\n static void out(Object obj) {\n\n System.out.println(obj.toString());\n }\n\n static void outn(String info) {\n\n System.out.print(info);\n }\n\n static void outn(int info) {\n\n System.out.print(info);\n }\n\n static void outn(double info) {\n\n System.out.print(info);\n }\n\n static void outn(long info) {\n\n System.out.print(info);\n }\n\n static void outn(char info) {\n\n System.out.print(info);\n }\n\n static int max(int a, int b) {\n\n return Math.max(a, b);\n }\n\n static long max(long a, long b) {\n\n return Math.max(a, b);\n }\n\n static int min(int a, int b) {\n\n return Math.min(a, b);\n }\n\n static long min(long a, long b) {\n\n return Math.min(a, b);\n }\n}\n\n\nclass XY {\n\n int h;\n int c;\n\n XY(int h, int c) {\n this.h = h;\n this.c = c;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static String Y = \"Yes\";\n public static String N = \"No\";\n public static long MOD = (long) (Math.pow(10, 9) + 7);\n public static Scanner sc = new Scanner(System.in);\n\n public static void main(String[] args) {\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }\n\n /*\n * 以下メソッド集\n */\n static int ni() {\n\n return sc.nextInt();\n }\n\n static long nl() {\n\n return sc.nextLong();\n }\n\n static double nd() {\n\n return sc.nextDouble();\n }\n\n static String n() {\n\n return sc.next();\n }\n\n static char[] nc() {\n\n return sc.next().toCharArray();\n }\n\n static int kaijo(int n) {\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }\n\n static int fib(int n) {\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }\n\n static long lcm(long m, long n) {\n\n return m * n / gcd(m, n);\n }\n\n static int lcm(int m, int n) {\n\n return m * n / gcd(m, n);\n }\n\n static long gcd(long a, long b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static int gcd(int a, int b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static void out(String info) {\n\n System.out.println(info);\n }\n\n static void out(int info) {\n\n System.out.println(info);\n }\n\n static void out(double info) {\n\n System.out.println(info);\n }\n\n static void out(long info) {\n\n System.out.println(info);\n }\n\n static void out(char info) {\n\n System.out.println(info);\n }\n\n static void out(Object obj) {\n\n System.out.println(obj.toString());\n }\n\n static void outn(String info) {\n\n System.out.print(info);\n }\n\n static void outn(int info) {\n\n System.out.print(info);\n }\n\n static void outn(double info) {\n\n System.out.print(info);\n }\n\n static void outn(long info) {\n\n System.out.print(info);\n }\n\n static void outn(char info) {\n\n System.out.print(info);\n }\n\n static int max(int a, int b) {\n\n return Math.max(a, b);\n }\n\n static long max(long a, long b) {\n\n return Math.max(a, b);\n }\n\n static int min(int a, int b) {\n\n return Math.min(a, b);\n }\n\n static long min(long a, long b) {\n\n return Math.min(a, b);\n }\n}",
"Main",
"public static String Y = \"Yes\";",
"Y",
"\"Yes\"",
"public static String N = \"No\";",
"N",
"\"No\"",
"public static long MOD = (long) (Math.pow(10, 9) + 7);",
"MOD",
"(long) (Math.pow(10, 9) + 7)",
"Math.pow(10, 9)",
"Math.pow",
"Math",
"10",
"9",
"7",
"public static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }",
"main",
"{\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }",
"int n = ni();",
"n",
"ni()",
"ni",
"long ans = 1l;",
"ans",
"1l",
"long limit = (long) Math.pow(10, 18);",
"limit",
"(long) Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"boolean minusflg = false;",
"minusflg",
"false",
"boolean zeroflg = false;",
"zeroflg",
"false",
"boolean flg = false;",
"flg",
"false",
"boolean over = false;",
"over",
"false",
"long tmpsum = 0;",
"tmpsum",
"0",
"for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }",
"{\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }",
"long tmp = nl();",
"tmp",
"nl()",
"nl",
"ans *= tmp",
"ans",
"tmp",
"if (ans < 0l) {\n minusflg = true;\n }",
"ans < 0l",
"ans",
"0l",
"{\n minusflg = true;\n }",
"minusflg = true",
"minusflg",
"true",
"if (ans > limit) {\n flg = true;\n }",
"ans > limit",
"ans",
"limit",
"{\n flg = true;\n }",
"flg = true",
"flg",
"true",
"if (tmp == 0l) {\n zeroflg = true;\n break;\n }",
"tmp == 0l",
"tmp",
"0l",
"{\n zeroflg = true;\n break;\n }",
"zeroflg = true",
"zeroflg",
"true",
"break;",
"if (tmpsum > ans) {\n over = true;\n }",
"tmpsum > ans",
"tmpsum",
"ans",
"{\n over = true;\n }",
"over = true",
"over",
"true",
"tmpsum = ans",
"tmpsum",
"ans",
"if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }",
"zeroflg",
"{\n ans = 0l;\n }",
"ans = 0l",
"ans",
"0l",
"if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }",
"minusflg || ans > limit || flg || over",
"flg",
"minusflg || ans > limit || flg || over",
"minusflg",
"ans > limit",
"ans",
"limit",
"flg",
"over",
"{\n ans = -1l;\n }",
"ans = -1l",
"ans",
"-1l",
"1l",
"out(ans)",
"out",
"ans",
"String[] args",
"args",
"/*\n * 以下メソッド集\n */\n static int ni() {\n\n return sc.nextInt();\n }",
"ni",
"{\n\n return sc.nextInt();\n }",
"return sc.nextInt();",
"sc.nextInt()",
"sc.nextInt",
"sc",
"static long nl() {\n\n return sc.nextLong();\n }",
"nl",
"{\n\n return sc.nextLong();\n }",
"return sc.nextLong();",
"sc.nextLong()",
"sc.nextLong",
"sc",
"static double nd() {\n\n return sc.nextDouble();\n }",
"nd",
"{\n\n return sc.nextDouble();\n }",
"return sc.nextDouble();",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"static String n() {\n\n return sc.next();\n }",
"n",
"{\n\n return sc.next();\n }",
"return sc.next();",
"sc.next()",
"sc.next",
"sc",
"static char[] nc() {\n\n return sc.next().toCharArray();\n }",
"nc",
"{\n\n return sc.next().toCharArray();\n }",
"return sc.next().toCharArray();",
"sc.next().toCharArray()",
"sc.next().toCharArray",
"sc.next()",
"sc.next",
"sc",
"static int kaijo(int n) {\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }",
"kaijo",
"{\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }",
"if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }",
"n == 0 || n == 1",
"n == 0",
"n",
"0",
"n == 1",
"n",
"1",
"{\n return 1;\n }",
"return 1;",
"1",
"{\n return n * kaijo(n - 1);\n }",
"return n * kaijo(n - 1);",
"n * kaijo(n - 1)",
"n",
"kaijo(n - 1)",
"kaijo",
"n - 1",
"n",
"1",
"int n",
"n",
"static int fib(int n) {\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }",
"fib",
"{\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }",
"return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);",
"(n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1)",
"(n == 1 || n == 0)",
"n == 1",
"n",
"1",
"n == 0",
"n",
"0",
"n",
"fib(n - 2) + fib(n - 1)",
"fib(n - 2)",
"fib",
"n - 2",
"n",
"2",
"fib(n - 1)",
"fib",
"n - 1",
"n",
"1",
"int n",
"n",
"static long lcm(long m, long n) {\n\n return m * n / gcd(m, n);\n }",
"lcm",
"{\n\n return m * n / gcd(m, n);\n }",
"return m * n / gcd(m, n);",
"m * n / gcd(m, n)",
"m * n",
"m",
"n",
"gcd(m, n)",
"gcd",
"m",
"n",
"long m",
"m",
"long n",
"n",
"static int lcm(int m, int n) {\n\n return m * n / gcd(m, n);\n }",
"lcm",
"{\n\n return m * n / gcd(m, n);\n }",
"return m * n / gcd(m, n);",
"m * n / gcd(m, n)",
"m * n",
"m",
"n",
"gcd(m, n)",
"gcd",
"m",
"n",
"int m",
"m",
"int n",
"n",
"static long gcd(long a, long b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }",
"gcd",
"{\n\n return (b == 0) ? a : gcd(b, a % b);\n }",
"return (b == 0) ? a : gcd(b, a % b);",
"(b == 0) ? a : gcd(b, a % b)",
"(b == 0)",
"b",
"0",
"a",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static int gcd(int a, int b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }",
"gcd",
"{\n\n return (b == 0) ? a : gcd(b, a % b);\n }",
"return (b == 0) ? a : gcd(b, a % b);",
"(b == 0) ? a : gcd(b, a % b)",
"(b == 0)",
"b",
"0",
"a",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static void out(String info) {\n\n System.out.println(info);\n }",
"out",
"{\n\n System.out.println(info);\n }",
"System.out.println(info)",
"System.out.println",
"System.out",
"System",
"System.out",
"info",
"String info",
"info",
"static void out(int info) {\n\n System.out.println(info);\n }",
"out",
"{\n\n System.out.println(info);\n }",
"System.out.println(info)",
"System.out.println",
"System.out",
"System",
"System.out",
"info",
"int info",
"info",
"static void out(double info) {\n\n System.out.println(info);\n }",
"out",
"{\n\n System.out.println(info);\n }",
"System.out.println(info)",
"System.out.println",
"System.out",
"System",
"System.out",
"info",
"double info",
"info",
"static void out(long info) {\n\n System.out.println(info);\n }",
"out",
"{\n\n System.out.println(info);\n }",
"System.out.println(info)",
"System.out.println",
"System.out",
"System",
"System.out",
"info",
"long info",
"info",
"static void out(char info) {\n\n System.out.println(info);\n }",
"out",
"{\n\n System.out.println(info);\n }",
"System.out.println(info)",
"System.out.println",
"System.out",
"System",
"System.out",
"info",
"char info",
"info",
"static void out(Object obj) {\n\n System.out.println(obj.toString());\n }",
"out",
"{\n\n System.out.println(obj.toString());\n }",
"System.out.println(obj.toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"obj.toString()",
"obj.toString",
"obj",
"Object obj",
"obj",
"static void outn(String info) {\n\n System.out.print(info);\n }",
"outn",
"{\n\n System.out.print(info);\n }",
"System.out.print(info)",
"System.out.print",
"System.out",
"System",
"System.out",
"info",
"String info",
"info",
"static void outn(int info) {\n\n System.out.print(info);\n }",
"outn",
"{\n\n System.out.print(info);\n }",
"System.out.print(info)",
"System.out.print",
"System.out",
"System",
"System.out",
"info",
"int info",
"info",
"static void outn(double info) {\n\n System.out.print(info);\n }",
"outn",
"{\n\n System.out.print(info);\n }",
"System.out.print(info)",
"System.out.print",
"System.out",
"System",
"System.out",
"info",
"double info",
"info",
"static void outn(long info) {\n\n System.out.print(info);\n }",
"outn",
"{\n\n System.out.print(info);\n }",
"System.out.print(info)",
"System.out.print",
"System.out",
"System",
"System.out",
"info",
"long info",
"info",
"static void outn(char info) {\n\n System.out.print(info);\n }",
"outn",
"{\n\n System.out.print(info);\n }",
"System.out.print(info)",
"System.out.print",
"System.out",
"System",
"System.out",
"info",
"char info",
"info",
"static int max(int a, int b) {\n\n return Math.max(a, b);\n }",
"max",
"{\n\n return Math.max(a, b);\n }",
"return Math.max(a, b);",
"Math.max(a, b)",
"Math.max",
"Math",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static long max(long a, long b) {\n\n return Math.max(a, b);\n }",
"max",
"{\n\n return Math.max(a, b);\n }",
"return Math.max(a, b);",
"Math.max(a, b)",
"Math.max",
"Math",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static int min(int a, int b) {\n\n return Math.min(a, b);\n }",
"min",
"{\n\n return Math.min(a, b);\n }",
"return Math.min(a, b);",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static long min(long a, long b) {\n\n return Math.min(a, b);\n }",
"min",
"{\n\n return Math.min(a, b);\n }",
"return Math.min(a, b);",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"long a",
"a",
"long b",
"b",
"class XY {\n\n int h;\n int c;\n\n XY(int h, int c) {\n this.h = h;\n this.c = c;\n }\n}",
"XY",
"int h;",
"h",
"int c;",
"c",
"XY(int h, int c) {\n this.h = h;\n this.c = c;\n }",
"XY",
"{\n this.h = h;\n this.c = c;\n }",
"this.h = h",
"this.h",
"this",
"this.h",
"h",
"this.c = c",
"this.c",
"this",
"this.c",
"c",
"int h",
"h",
"int c",
"c",
"public class Main {\n\n public static String Y = \"Yes\";\n public static String N = \"No\";\n public static long MOD = (long) (Math.pow(10, 9) + 7);\n public static Scanner sc = new Scanner(System.in);\n\n public static void main(String[] args) {\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }\n\n /*\n * 以下メソッド集\n */\n static int ni() {\n\n return sc.nextInt();\n }\n\n static long nl() {\n\n return sc.nextLong();\n }\n\n static double nd() {\n\n return sc.nextDouble();\n }\n\n static String n() {\n\n return sc.next();\n }\n\n static char[] nc() {\n\n return sc.next().toCharArray();\n }\n\n static int kaijo(int n) {\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }\n\n static int fib(int n) {\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }\n\n static long lcm(long m, long n) {\n\n return m * n / gcd(m, n);\n }\n\n static int lcm(int m, int n) {\n\n return m * n / gcd(m, n);\n }\n\n static long gcd(long a, long b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static int gcd(int a, int b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static void out(String info) {\n\n System.out.println(info);\n }\n\n static void out(int info) {\n\n System.out.println(info);\n }\n\n static void out(double info) {\n\n System.out.println(info);\n }\n\n static void out(long info) {\n\n System.out.println(info);\n }\n\n static void out(char info) {\n\n System.out.println(info);\n }\n\n static void out(Object obj) {\n\n System.out.println(obj.toString());\n }\n\n static void outn(String info) {\n\n System.out.print(info);\n }\n\n static void outn(int info) {\n\n System.out.print(info);\n }\n\n static void outn(double info) {\n\n System.out.print(info);\n }\n\n static void outn(long info) {\n\n System.out.print(info);\n }\n\n static void outn(char info) {\n\n System.out.print(info);\n }\n\n static int max(int a, int b) {\n\n return Math.max(a, b);\n }\n\n static long max(long a, long b) {\n\n return Math.max(a, b);\n }\n\n static int min(int a, int b) {\n\n return Math.min(a, b);\n }\n\n static long min(long a, long b) {\n\n return Math.min(a, b);\n }\n}",
"public class Main {\n\n public static String Y = \"Yes\";\n public static String N = \"No\";\n public static long MOD = (long) (Math.pow(10, 9) + 7);\n public static Scanner sc = new Scanner(System.in);\n\n public static void main(String[] args) {\n\n int n = ni();\n\n long ans = 1l;\n\n long limit = (long) Math.pow(10, 18);\n\n boolean minusflg = false;\n boolean zeroflg = false;\n boolean flg = false;\n boolean over = false;\n long tmpsum = 0;\n\n for (int i = 0; i < n; i++) {\n long tmp = nl();\n ans *= tmp;\n\n if (ans < 0l) {\n minusflg = true;\n }\n\n if (ans > limit) {\n flg = true;\n }\n\n if (tmp == 0l) {\n zeroflg = true;\n break;\n }\n\n if (tmpsum > ans) {\n over = true;\n }\n\n tmpsum = ans;\n\n }\n\n if (zeroflg) {\n ans = 0l;\n } else if (minusflg || ans > limit || flg || over) {\n ans = -1l;\n }\n out(ans);\n\n // double a = nd();\n // double b = nd();\n //\n // out((long) (a * b));\n\n }\n\n /*\n * 以下メソッド集\n */\n static int ni() {\n\n return sc.nextInt();\n }\n\n static long nl() {\n\n return sc.nextLong();\n }\n\n static double nd() {\n\n return sc.nextDouble();\n }\n\n static String n() {\n\n return sc.next();\n }\n\n static char[] nc() {\n\n return sc.next().toCharArray();\n }\n\n static int kaijo(int n) {\n\n if (n == 0 || n == 1) {\n return 1;\n } else {\n return n * kaijo(n - 1);\n }\n }\n\n static int fib(int n) {\n\n return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);\n }\n\n static long lcm(long m, long n) {\n\n return m * n / gcd(m, n);\n }\n\n static int lcm(int m, int n) {\n\n return m * n / gcd(m, n);\n }\n\n static long gcd(long a, long b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static int gcd(int a, int b) {\n\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n static void out(String info) {\n\n System.out.println(info);\n }\n\n static void out(int info) {\n\n System.out.println(info);\n }\n\n static void out(double info) {\n\n System.out.println(info);\n }\n\n static void out(long info) {\n\n System.out.println(info);\n }\n\n static void out(char info) {\n\n System.out.println(info);\n }\n\n static void out(Object obj) {\n\n System.out.println(obj.toString());\n }\n\n static void outn(String info) {\n\n System.out.print(info);\n }\n\n static void outn(int info) {\n\n System.out.print(info);\n }\n\n static void outn(double info) {\n\n System.out.print(info);\n }\n\n static void outn(long info) {\n\n System.out.print(info);\n }\n\n static void outn(char info) {\n\n System.out.print(info);\n }\n\n static int max(int a, int b) {\n\n return Math.max(a, b);\n }\n\n static long max(long a, long b) {\n\n return Math.max(a, b);\n }\n\n static int min(int a, int b) {\n\n return Math.min(a, b);\n }\n\n static long min(long a, long b) {\n\n return Math.min(a, b);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static String Y = "Yes";
public static String N = "No";
public static long MOD = (long) (Math.pow(10, 9) + 7);
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int n = ni();
long ans = 1l;
long limit = (long) Math.pow(10, 18);
boolean minusflg = false;
boolean zeroflg = false;
boolean flg = false;
boolean over = false;
long tmpsum = 0;
for (int i = 0; i < n; i++) {
long tmp = nl();
ans *= tmp;
if (ans < 0l) {
minusflg = true;
}
if (ans > limit) {
flg = true;
}
if (tmp == 0l) {
zeroflg = true;
break;
}
if (tmpsum > ans) {
over = true;
}
tmpsum = ans;
}
if (zeroflg) {
ans = 0l;
} else if (minusflg || ans > limit || flg || over) {
ans = -1l;
}
out(ans);
// double a = nd();
// double b = nd();
//
// out((long) (a * b));
}
/*
* 以下メソッド集
*/
static int ni() {
return sc.nextInt();
}
static long nl() {
return sc.nextLong();
}
static double nd() {
return sc.nextDouble();
}
static String n() {
return sc.next();
}
static char[] nc() {
return sc.next().toCharArray();
}
static int kaijo(int n) {
if (n == 0 || n == 1) {
return 1;
} else {
return n * kaijo(n - 1);
}
}
static int fib(int n) {
return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);
}
static long lcm(long m, long n) {
return m * n / gcd(m, n);
}
static int lcm(int m, int n) {
return m * n / gcd(m, n);
}
static long gcd(long a, long b) {
return (b == 0) ? a : gcd(b, a % b);
}
static int gcd(int a, int b) {
return (b == 0) ? a : gcd(b, a % b);
}
static void out(String info) {
System.out.println(info);
}
static void out(int info) {
System.out.println(info);
}
static void out(double info) {
System.out.println(info);
}
static void out(long info) {
System.out.println(info);
}
static void out(char info) {
System.out.println(info);
}
static void out(Object obj) {
System.out.println(obj.toString());
}
static void outn(String info) {
System.out.print(info);
}
static void outn(int info) {
System.out.print(info);
}
static void outn(double info) {
System.out.print(info);
}
static void outn(long info) {
System.out.print(info);
}
static void outn(char info) {
System.out.print(info);
}
static int max(int a, int b) {
return Math.max(a, b);
}
static long max(long a, long b) {
return Math.max(a, b);
}
static int min(int a, int b) {
return Math.min(a, b);
}
static long min(long a, long b) {
return Math.min(a, b);
}
}
class XY {
int h;
int c;
XY(int h, int c) {
this.h = h;
this.c = c;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
40,
17,
14,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
40,
17,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
40,
50
],
[
39,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
38,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
38,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
69,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
6,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] |
[
"import java.util.*;\n\npublic class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main",
"static public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long aa=1L;",
"aa",
"1L",
"for(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L",
"Math.log10(a)+Math.log10(aa)>18",
"Math.log10(a)+Math.log10(aa)",
"Math.log10(a)",
"Math.log10",
"Math",
"a",
"Math.log10(aa)",
"Math.log10",
"Math",
"aa",
"18",
"aa*a>1000000000000000000L",
"aa*a",
"aa",
"a",
"1000000000000000000L",
"{\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}",
"aa=-1",
"aa",
"-1",
"1",
"if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"a==0",
"a",
"0",
"{\n\t\t\t\taa*=0;\n\t\t\t}",
"aa*=0",
"aa",
"0",
"if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"aa!=-1",
"aa",
"-1",
"1",
"{\n\t\t\t\taa*=a;\n\t\t\t}",
"aa*=a",
"aa",
"a",
"System.out.println(aa)",
"System.out.println",
"System.out",
"System",
"System.out",
"aa",
"String args[]",
"args",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
static public void main(String args[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
long aa=1L;
for(int i=0;i<n;i++){
long a=sc.nextLong();
if(Math.log10(a)+Math.log10(aa)>18||
aa*a>1000000000000000000L){
//1000000000000000000L
aa=-1;
}
else if(a==0){
aa*=0;
}
else if(aa!=-1){
aa*=a;
}
}
System.out.println(aa);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
17,
3,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
13,
30,
14,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
22,
23
],
[
23,
24
],
[
13,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
27,
32
],
[
13,
33
],
[
33,
34
],
[
33,
35
],
[
13,
37
],
[
37,
38
],
[
37,
39
],
[
13,
40
],
[
40,
41
],
[
40,
42
],
[
13,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
13,
76
],
[
76,
77
],
[
76,
78
],
[
13,
79
],
[
79,
80
],
[
79,
81
],
[
13,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
100,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
13,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
118,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
9,
144
],
[
144,
145
]
] |
[
"import java.util.*;\nimport java.io.*;\n\nclass Main{\n public static void main(String args[])throws IOException{\n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main{\n public static void main(String args[])throws IOException{\n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }\n }\n}",
"Main",
"public static void main(String args[])throws IOException{\n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }\n }",
"main",
"{\n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }\n }",
"try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }",
"{\n int N = Integer.parseInt(br.readLine());\n String[] num_s = br.readLine().split(\" \");\n long[] num = new long[N];\n boolean z_flag = false;\n boolean flag = false;\n\n for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }\n\n long result = 1;\n long cmp = 1000000000000000000L;\n\n for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }\n\n if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"String[] num_s = br.readLine().split(\" \");",
"num_s",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"long[] num = new long[N];",
"num",
"new long[N]",
"N",
"boolean z_flag = false;",
"z_flag",
"false",
"boolean flag = false;",
"flag",
"false",
"for(int i = 0; i < N; i++){\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }",
"{\n num[i] = Long.parseLong(num_s[i]);\n if(num[i] == 0){\n z_flag = true;\n }\n }",
"num[i] = Long.parseLong(num_s[i])",
"num[i]",
"num",
"i",
"Long.parseLong(num_s[i])",
"Long.parseLong",
"Long",
"num_s[i]",
"num_s",
"i",
"if(num[i] == 0){\n z_flag = true;\n }",
"num[i] == 0",
"num[i]",
"num",
"i",
"0",
"{\n z_flag = true;\n }",
"z_flag = true",
"z_flag",
"true",
"long result = 1;",
"result",
"1",
"long cmp = 1000000000000000000L;",
"cmp",
"1000000000000000000L",
"for(int i = 0; i < N; i++){\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }",
"{\n result *= num[i];\n if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }\n //System.out.println(result);\n }",
"result *= num[i]",
"result",
"num[i]",
"num",
"i",
"if(result > cmp){\n flag = true;\n break;\n }else if(result < 1){\n flag = true;\n break;\n }",
"result > cmp",
"result",
"cmp",
"{\n flag = true;\n break;\n }",
"flag = true",
"flag",
"true",
"break;",
"if(result < 1){\n flag = true;\n break;\n }",
"result < 1",
"result",
"1",
"{\n flag = true;\n break;\n }",
"flag = true",
"flag",
"true",
"break;",
"if(flag){\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }else{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }",
"flag",
"{\n if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }\n }",
"if(z_flag){\n System.out.println(\"0\");\n }else{\n System.out.println(\"-1\");\n }",
"z_flag",
"{\n System.out.println(\"0\");\n }",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n //System.out.println(Long.MAX_VALUE);\n System.out.println(result);\n }",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String args[]",
"args"
] |
import java.util.*;
import java.io.*;
class Main{
public static void main(String args[])throws IOException{
try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
int N = Integer.parseInt(br.readLine());
String[] num_s = br.readLine().split(" ");
long[] num = new long[N];
boolean z_flag = false;
boolean flag = false;
for(int i = 0; i < N; i++){
num[i] = Long.parseLong(num_s[i]);
if(num[i] == 0){
z_flag = true;
}
}
long result = 1;
long cmp = 1000000000000000000L;
for(int i = 0; i < N; i++){
result *= num[i];
if(result > cmp){
flag = true;
break;
}else if(result < 1){
flag = true;
break;
}
//System.out.println(result);
}
if(flag){
if(z_flag){
System.out.println("0");
}else{
System.out.println("-1");
}
}else{
//System.out.println(Long.MAX_VALUE);
System.out.println(result);
}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
13,
13,
30,
0,
13,
40,
17,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
113,
5
],
[
113,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
26,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
85,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
8,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
6,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }",
"main",
"{\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N= sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"long result = 1;",
"result",
"1",
"long max = (long)Math.pow(10,18);",
"max",
"(long)Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"++i",
"++i",
"i",
"{\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }",
"{\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }",
"A[i] = sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n System.out.println(0);\n System.exit(0);\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"System.exit(0)",
"System.exit",
"System",
"0",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"++i",
"++i",
"i",
"{\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }",
"{\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }",
"if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }",
"A[i] > max/result",
"A[i]",
"A",
"i",
"max/result",
"max",
"result",
"{ //上限を超えそうなら終了\n result = -1;\n }",
"result = -1",
"result",
"-1",
"1",
"{ //超えなければ乗算を続行\n result *= A[i];\n }",
"result *= A[i]",
"result",
"A[i]",
"A",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n //値を取得\n Scanner sc = new Scanner(System.in);\n int N= sc.nextInt();\n long[] A = new long[N];\n long result = 1; //計算結果を格納\n long max = (long)Math.pow(10,18); //上限\n \n for (int i = 0; i < N; ++i){\n A[i] = sc.nextLong();\n //0が含まれている場合は何を掛けても0になるため、ここで終了\n if (A[i] == 0){\n System.out.println(0);\n System.exit(0);\n }\n }\n \n //配列を昇順にソート\n Arrays.sort(A);\n \n //各要素を順番に乗算する\n for (int i = 0; i < N; ++i){\n \n if (A[i] > max/result){ //上限を超えそうなら終了\n result = -1;\n } else{ //超えなければ乗算を続行\n result *= A[i];\n }\n }\n \n //出力\n System.out.println(result);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
//値を取得
Scanner sc = new Scanner(System.in);
int N= sc.nextInt();
long[] A = new long[N];
long result = 1; //計算結果を格納
long max = (long)Math.pow(10,18); //上限
for (int i = 0; i < N; ++i){
A[i] = sc.nextLong();
//0が含まれている場合は何を掛けても0になるため、ここで終了
if (A[i] == 0){
System.out.println(0);
System.exit(0);
}
}
//配列を昇順にソート
Arrays.sort(A);
//各要素を順番に乗算する
for (int i = 0; i < N; ++i){
if (A[i] > max/result){ //上限を超えそうなら終了
result = -1;
} else{ //超えなければ乗算を続行
result *= A[i];
}
}
//出力
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
0,
18,
13,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
17,
14,
2,
4,
18,
13,
4,
18,
18,
13,
13,
17,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
152,
8
],
[
152,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
43,
50
],
[
42,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
51,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
36,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
11,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
86,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
96,
106
],
[
95,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
107,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
11,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
120,
130
],
[
119,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
119,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
11,
146
],
[
146,
147
],
[
147,
148
],
[
9,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] |
[
"import java.math.BigDecimal;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}\n\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}",
"main",
"{\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"BigDecimal[] an = new BigDecimal[n];",
"an",
"new BigDecimal[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}",
"{\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}",
"BigDecimal a = scan.nextBigDecimal();",
"a",
"scan.nextBigDecimal()",
"scan.nextBigDecimal",
"scan",
"if (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"BigDecimal.ZERO.compareTo(a) == 0",
"BigDecimal.ZERO.compareTo(a)",
"BigDecimal.ZERO.compareTo",
"BigDecimal.ZERO",
"BigDecimal",
"BigDecimal.ZERO",
"a",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"System.exit(0)",
"System.exit",
"System",
"0",
"an[i] = a",
"an[i]",
"an",
"i",
"a",
"BigDecimal ans = BigDecimal.ONE;",
"ans",
"BigDecimal.ONE",
"BigDecimal",
"BigDecimal.ONE",
"for (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < an.length",
"i",
"an.length",
"an",
"an.length",
"i++",
"i++",
"i",
"{\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"{\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}",
"ans = ans.multiply(an[i])",
"ans",
"ans.multiply(an[i])",
"ans.multiply",
"ans",
"an[i]",
"an",
"i",
"if (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0",
"ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18))",
"ans.compareTo",
"ans",
"BigDecimal.ONE.scaleByPowerOfTen(18)",
"BigDecimal.ONE.scaleByPowerOfTen",
"BigDecimal.ONE",
"BigDecimal",
"BigDecimal.ONE",
"18",
"0",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.exit(0)",
"System.exit",
"System",
"0",
"if (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0",
"ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18))",
"ans.compareTo",
"ans",
"BigDecimal.ONE.scaleByPowerOfTen(18)",
"BigDecimal.ONE.scaleByPowerOfTen",
"BigDecimal.ONE",
"BigDecimal",
"BigDecimal.ONE",
"18",
"0",
"{\n\t\t\tSystem.out.println(ans);\n\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tBigDecimal[] an = new BigDecimal[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tBigDecimal a = scan.nextBigDecimal();\n\t\t\tif (BigDecimal.ZERO.compareTo(a) == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tan[i] = a;\n\t\t}\n\n\t\tBigDecimal ans = BigDecimal.ONE;\n\t\tfor (int i = 0; i < an.length; i++) {\n\t\t\tans = ans.multiply(an[i]);\n\t\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscan.close();\n\t}\n\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
BigDecimal[] an = new BigDecimal[n];
for (int i = 0; i < n; i++) {
BigDecimal a = scan.nextBigDecimal();
if (BigDecimal.ZERO.compareTo(a) == 0) {
System.out.println(0);
System.exit(0);
}
an[i] = a;
}
BigDecimal ans = BigDecimal.ONE;
for (int i = 0; i < an.length; i++) {
ans = ans.multiply(an[i]);
if (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) > 0) {
System.out.println(-1);
System.exit(0);
}
}
if (ans.compareTo(BigDecimal.ONE.scaleByPowerOfTen(18)) <= 0) {
System.out.println(ans);
} else {
System.out.println(-1);
}
scan.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
17,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
159,
8
],
[
159,
9
],
[
9,
10
],
[
159,
11
],
[
11,
12
],
[
159,
13
],
[
13,
14
],
[
159,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
17,
25
],
[
25,
26
],
[
25,
27
],
[
17,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
41,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
54,
61
],
[
17,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
17,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
88,
96
],
[
79,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
17,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
15,
110
],
[
110,
111
],
[
159,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
159,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
159,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
159,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
142,
151
],
[
151,
152
],
[
151,
153
],
[
141,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
0,
158
],
[
158,
159
],
[
158,
160
]
] |
[
"import java.util.*; \nimport java.io.*;\n\npublic class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"Main",
"static StringTokenizer st;",
"st",
"static BufferedReader br;",
"br",
"static PrintWriter out;",
"out",
"public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }",
"main",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = nextInt();",
"N",
"nextInt()",
"nextInt",
"long[] input = new long[N];",
"input",
"new long[N]",
"N",
"for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }",
"{\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }",
"input[i] = nextLong()",
"input[i]",
"input",
"i",
"nextLong()",
"nextLong",
"if(input[i]==0) {\n System.out.println(0);\n return;\n }",
"input[i]==0",
"input[i]",
"input",
"i",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans =input[0];",
"ans",
"input[0]",
"input",
"0",
"for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }",
"{\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }",
"if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }",
"(ans > (long)(1e18)/ input[i])",
"ans",
"(long)(1e18)/ input[i]",
"(long)(1e18)",
"input[i]",
"input",
"i",
"{ \n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"ans = ans * input[i]",
"ans",
"ans * input[i]",
"ans",
"input[i]",
"input",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine().trim())",
"st",
"new StringTokenizer(br.readLine().trim())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n long[] input = new long[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextLong();\n if(input[i]==0) {\n System.out.println(0);\n return;\n }\n }\n\n long ans =input[0];\n\n for (int i=1; i<N; i++) {\n // If you directly perform multiplication on 64-bit integers, it causes overflow\n // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){\n //if(ans> 1e18/ input[i]){ \n // > not working, need use <=, because 1e18/ input[i] will lose 0.000001\n if((ans > (long)(1e18)/ input[i])){ \n System.out.println(-1);\n return;\n }\n ans = ans * input[i];\n }\n\n System.out.println(ans);\n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
static StringTokenizer st;
static BufferedReader br;
static PrintWriter out;
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
int N = nextInt();
long[] input = new long[N];
for (int i=0; i<N; i++) {
input[i] = nextLong();
if(input[i]==0) {
System.out.println(0);
return;
}
}
long ans =input[0];
for (int i=1; i<N; i++) {
// If you directly perform multiplication on 64-bit integers, it causes overflow
// if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
//if(ans> 1e18/ input[i]){
// > not working, need use <=, because 1e18/ input[i] will lose 0.000001
if((ans > (long)(1e18)/ input[i])){
System.out.println(-1);
return;
}
ans = ans * input[i];
}
System.out.println(ans);
}
public static int nextInt() throws IOException {
return Integer.parseInt(next());
}
public static long nextLong() throws IOException {
return Long.parseLong(next());
}
public static double nextDouble() throws IOException {
return Double.parseDouble(next());
}
static String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine().trim());
return st.nextToken();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
30,
0,
18,
13,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
4,
18,
13,
17,
17,
13,
30,
0,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
112,
5
],
[
112,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
33,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
43,
50
],
[
39,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
79,
83
],
[
78,
84
],
[
73,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
73,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
91,
99
],
[
8,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
8,
106
],
[
106,
107
],
[
107,
108
],
[
6,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}\n}\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}",
"long l = sc.nextLong();",
"l",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}",
"l == 0",
"l",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"{\n\t\t\t\ta[i] = l;\n\t\t\t}",
"a[i] = l",
"a[i]",
"a",
"i",
"l",
"long prod = 1;",
"prod",
"1",
"for (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"a[i] <= (long)Math.pow(10, 18) / prod",
"a[i]",
"a",
"i",
"(long)Math.pow(10, 18) / prod",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"prod",
"{\n\t\t\t\tprod *= a[i];\n\t\t\t}",
"prod *= a[i]",
"prod",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(prod)",
"System.out.println",
"System.out",
"System",
"System.out",
"prod",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong l = sc.nextLong();\n\t\t\t\n\t\t\tif (l == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ta[i] = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong prod = 1;\n\t\t\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (a[i] <= (long)Math.pow(10, 18) / prod) {\n\t\t\t\tprod *= a[i];\n\t\t\t} else {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(prod);\n\t\t\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
long l = sc.nextLong();
if (l == 0) {
System.out.println(0);
return;
} else {
a[i] = l;
}
}
long prod = 1;
for (int i = 0; i < n; i++) {
if (a[i] <= (long)Math.pow(10, 18) / prod) {
prod *= a[i];
} else {
System.out.println(-1);
return;
}
}
System.out.println(prod);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
0,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
20,
3,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
121,
11
],
[
121,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
31,
36
],
[
14,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
49,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
62,
69
],
[
14,
70
],
[
70,
71
],
[
70,
72
],
[
14,
73
],
[
73,
74
],
[
73,
75
],
[
14,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
99,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
14,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
12,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] |
[
"import java.util.*;\nimport java.io.*;\nimport java.math.*;\n\npublic class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }\n}",
"Main",
"public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = Integer.parseInt(sc.nextLine());",
"N",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] S = sc.nextLine().split(\" \");",
"S",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }",
"{\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }",
"long a = Long.parseLong(S[i]);",
"a",
"Long.parseLong(S[i])",
"Long.parseLong",
"Long",
"S[i]",
"S",
"i",
"if(a == 0){\n System.out.println(0);\n return;\n }",
"a == 0",
"a",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"BigDecimal now = new BigDecimal(\"1\");",
"now",
"new BigDecimal(\"1\")",
"BigDecimal max = new BigDecimal(\"1000000000000000000\");",
"max",
"new BigDecimal(\"1000000000000000000\")",
"for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }",
"{\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }",
"BigDecimal A = new BigDecimal(S[i]);",
"A",
"new BigDecimal(S[i])",
"now = now.multiply(A)",
"now",
"now.multiply(A)",
"now.multiply",
"now",
"A",
"if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }",
"now.compareTo(max) == 1",
"now.compareTo(max)",
"now.compareTo",
"now",
"max",
"1",
"{\n now = new BigDecimal(\"-1\");\n break;\n }",
"now = new BigDecimal(\"-1\")",
"now",
"new BigDecimal(\"-1\")",
"break;",
"System.out.println(now.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"now.longValue()",
"now.longValue",
"now",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }\n}",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.nextLine());\n String[] S = sc.nextLine().split(\" \");\n for(int i = 0; i < N; i++){\n long a = Long.parseLong(S[i]);\n if(a == 0){\n System.out.println(0);\n return;\n }\n }\n BigDecimal now = new BigDecimal(\"1\");\n BigDecimal max = new BigDecimal(\"1000000000000000000\");\n for(int i = 0; i < N; i++){\n BigDecimal A = new BigDecimal(S[i]);\n now = now.multiply(A);\n if(now.compareTo(max) == 1){\n now = new BigDecimal(\"-1\");\n break;\n }\n }\n System.out.println(now.longValue());\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
import java.math.*;
public class Main{
public static void main(String[] args)throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.nextLine());
String[] S = sc.nextLine().split(" ");
for(int i = 0; i < N; i++){
long a = Long.parseLong(S[i]);
if(a == 0){
System.out.println(0);
return;
}
}
BigDecimal now = new BigDecimal("1");
BigDecimal max = new BigDecimal("1000000000000000000");
for(int i = 0; i < N; i++){
BigDecimal A = new BigDecimal(S[i]);
now = now.multiply(A);
if(now.compareTo(max) == 1){
now = new BigDecimal("-1");
break;
}
}
System.out.println(now.longValue());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
14,
2,
18,
13,
13,
17,
30,
4,
18,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
38,
5,
13,
30,
4,
18,
13,
17,
29,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
17,
29,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
4,
13,
20,
23,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
17,
13,
17,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
37,
20,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
29,
17,
0,
13,
20,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
2,
17,
13,
17,
13,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
312,
32
],
[
312,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
35,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
35,
46
],
[
46,
47
],
[
46,
48
],
[
35,
49
],
[
49,
50
],
[
49,
51
],
[
35,
52
],
[
52,
53
],
[
52,
54
],
[
35,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
55,
60
],
[
35,
61
],
[
61,
62
],
[
62,
63
],
[
33,
64
],
[
64,
65
],
[
312,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
70,
82
],
[
82,
83
],
[
82,
84
],
[
70,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
103,
108
],
[
70,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
125,
130
],
[
122,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
134,
138
],
[
138,
139
],
[
138,
140
],
[
131,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
145,
150
],
[
70,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
68,
155
],
[
155,
156
],
[
68,
157
],
[
157,
158
],
[
68,
159
],
[
159,
160
],
[
312,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
161,
165
],
[
165,
166
],
[
161,
167
],
[
167,
168
],
[
167,
169
],
[
161,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
170,
176
],
[
176,
177
],
[
161,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
178,
184
],
[
184,
185
],
[
161,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
200,
200
],
[
200,
201
],
[
200,
202
],
[
200,
203
],
[
188,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
204,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
217,
221
],
[
221,
222
],
[
214,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
227,
228
],
[
223,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
223,
235
],
[
235,
236
],
[
235,
237
],
[
188,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
188,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
243,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
248,
253
],
[
255,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
254,
258
],
[
255,
259
],
[
188,
260
],
[
260,
261
],
[
161,
262
],
[
262,
263
],
[
262,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
266,
269
],
[
269,
270
],
[
161,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
275,
278
],
[
278,
279
],
[
161,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
282,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
287,
292
],
[
292,
293
],
[
292,
294
],
[
294,
295
],
[
294,
296
],
[
287,
297
],
[
297,
298
],
[
298,
299
],
[
287,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
301,
305
],
[
305,
306
],
[
282,
307
],
[
307,
308
],
[
280,
309
],
[
309,
310
],
[
0,
311
],
[
311,
312
],
[
311,
313
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.io.PrintStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\nimport java.io.BufferedReader;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author Eric\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.io.PrintStream;",
"PrintStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"FastReader in = new FastReader(inputStream);",
"in",
"new FastReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"BMultiplication2 solver = new BMultiplication2();",
"solver",
"new BMultiplication2()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class BMultiplication2 {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }",
"BMultiplication2",
"public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }",
"solve",
"{\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long[] a = in.nextArrLong(n);",
"a",
"in.nextArrLong(n)",
"in.nextArrLong",
"in",
"n",
"long res = 1;",
"res",
"1",
"for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"if (a[i] == 0) {\n out.println(\"0\");\n return;\n }",
"if (a[i] == 0) {\n out.println(\"0\");\n return;\n }",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n out.println(\"0\");\n return;\n }",
"out.println(\"0\")",
"out.println",
"out",
"\"0\"",
"return;",
"for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }",
"{\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }",
"try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }",
"catch (Exception e) {\n out.println(\"-1\");\n return;\n }",
"Exception e",
"{\n out.println(\"-1\");\n return;\n }",
"out.println(\"-1\")",
"out.println",
"out",
"\"-1\"",
"return;",
"{\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n }",
"res = Math.multiplyExact(res, a[i])",
"res",
"Math.multiplyExact(res, a[i])",
"Math.multiplyExact",
"Math",
"res",
"a[i]",
"a",
"i",
"if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }",
"res > 1_000_000_000_000_000_000L",
"res",
"1_000_000_000_000_000_000L",
"{\n out.println(\"-1\");\n return;\n }",
"out.println(\"-1\")",
"out.println",
"out",
"\"-1\"",
"return;",
"out.println(res)",
"out.println",
"out",
"res",
"int testNumber",
"testNumber",
"FastReader in",
"in",
"PrintWriter out",
"out",
"static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }\n\n }",
"FastReader",
"public BufferedReader br;",
"br",
"public StringTokenizer st;",
"st",
"String context = null;",
"context",
"null",
"public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }",
"FastReader",
"{\n this(new InputStreamReader(in));\n }",
"this(new InputStreamReader(in))",
"this",
"new InputStreamReader(in)",
"InputStream in",
"in",
"public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }",
"FastReader",
"{\n br = new BufferedReader(input);\n }",
"br = new BufferedReader(input)",
"br",
"new BufferedReader(input)",
"InputStreamReader input",
"input",
"public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }",
"next",
"{\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }",
"if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }",
"context != null",
"context",
"null",
"{\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }",
"System.err.print(\"[\" + context + \"] Wait for input ...\")",
"System.err.print",
"System.err",
"System",
"System.err",
"\"[\" + context + \"] Wait for input ...\"",
"\"[\" + context + \"] Wait for input ...\"",
"\"[\"",
"context",
"\"] Wait for input ...\"",
"while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }",
"try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"IOException e",
"{\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"throw new RuntimeException(\"Could not read\");",
"new RuntimeException(\"Could not read\")",
"{\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n }",
"String s = br.readLine();",
"s",
"br.readLine()",
"br.readLine",
"br",
"if (s == null)\n return null;",
"s == null",
"s",
"null",
"return null;",
"null",
"st = new StringTokenizer(s)",
"st",
"new StringTokenizer(s)",
"String res = st.nextToken();",
"res",
"st.nextToken()",
"st.nextToken",
"st",
"if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }",
"context != null",
"context",
"null",
"{\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }",
"System.err.println(\"[\" + context + \"] ... received : \" + res)",
"System.err.println",
"System.err",
"System",
"System.err",
"\"[\" + context + \"] ... received : \" + res",
"\"] ... received : \"",
"\"[\" + context + \"] ... received : \" + res",
"\"[\"",
"context",
"\"] ... received : \"",
"res",
"return res;",
"res",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }",
"nextArrLong",
"{\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < a.length; i++)\n a[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"a[i] = nextLong();",
"a[i] = nextLong()",
"a[i]",
"a",
"i",
"nextLong()",
"nextLong",
"return a;",
"a",
"int n",
"n",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n long[] a = in.nextArrLong(n);\n long res = 1;\n for (int i = 0; i < n; i++)\n if (a[i] == 0) {\n out.println(\"0\");\n return;\n }\n for (int i = 0; i < n; i++) {\n try {\n res = Math.multiplyExact(res, a[i]);\n if (res > 1_000_000_000_000_000_000L) {\n out.println(\"-1\");\n return;\n }\n } catch (Exception e) {\n out.println(\"-1\");\n return;\n }\n }\n out.println(res);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextArrLong(int n) {\n long[] a = new long[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextLong();\n return a;\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Eric
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
FastReader in = new FastReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
BMultiplication2 solver = new BMultiplication2();
solver.solve(1, in, out);
out.close();
}
static class BMultiplication2 {
public void solve(int testNumber, FastReader in, PrintWriter out) {
int n = in.nextInt();
long[] a = in.nextArrLong(n);
long res = 1;
for (int i = 0; i < n; i++)
if (a[i] == 0) {
out.println("0");
return;
}
for (int i = 0; i < n; i++) {
try {
res = Math.multiplyExact(res, a[i]);
if (res > 1_000_000_000_000_000_000L) {
out.println("-1");
return;
}
} catch (Exception e) {
out.println("-1");
return;
}
}
out.println(res);
//out.print("Case #"+ testNumber + ": ");
}
}
static class FastReader {
public BufferedReader br;
public StringTokenizer st;
String context = null;
public FastReader(InputStream in) {
this(new InputStreamReader(in));
}
public FastReader(InputStreamReader input) {
br = new BufferedReader(input);
}
public String next() {
if (context != null) {
System.err.print("[" + context + "] Wait for input ...");
}
while (st == null || !st.hasMoreElements()) {
try {
String s = br.readLine();
if (s == null)
return null;
st = new StringTokenizer(s);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Could not read");
}
}
String res = st.nextToken();
if (context != null) {
System.err.println("[" + context + "] ... received : " + res);
}
return res;
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public long[] nextArrLong(int n) {
long[] a = new long[n];
for (int i = 0; i < a.length; i++)
a[i] = nextLong();
return a;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
0,
13,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
17,
13,
30,
4,
18,
18,
13,
13,
40,
17,
0,
13,
17,
3,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
134,
5
],
[
134,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
8,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
71,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
92,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
100,
108
],
[
108,
109
],
[
108,
110
],
[
100,
111
],
[
92,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
8,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
6,
131
],
[
131,
132
],
[
0,
133
],
[
133,
134
],
[
133,
135
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] number = new long[a];",
"number",
"new long[a]",
"a",
"for(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}",
"{\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}",
"number[i] = sc.nextLong()",
"number[i]",
"number",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long result = 0;",
"result",
"0",
"result = number[0]",
"result",
"number[0]",
"number",
"0",
"boolean flag = true;",
"flag",
"true",
"for(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"number[i] == 0",
"number[i]",
"number",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"for(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}",
"if(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}",
"number[i] > 1000000000000000000l / result",
"number[i]",
"number",
"i",
"1000000000000000000l / result",
"1000000000000000000l",
"result",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"flag = false",
"flag",
"false",
"break;",
"{\n\t\t\t\tresult = result*number[i];\n\t\t\t}",
"result = result*number[i]",
"result",
"result*number[i]",
"result",
"number[i]",
"number",
"i",
"if(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}",
"flag == true",
"flag",
"true",
"{\n\t\t\tSystem.out.println(result);\n\t\t}",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\t\n\t\tlong[] number = new long[a];\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tnumber[i] = sc.nextLong();\n\t\t}\n\t\tlong result = 0;\n\t\tresult = number[0];\n\t\tboolean flag = true;\n\t\tfor(int i=0;i<a;i++) {\n\t\t\tif(number[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=1;i<a;i++) {\n\t\t\t\n\t\t\tif(number[i] > 1000000000000000000l / result) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tresult = result*number[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(flag == true) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
long[] number = new long[a];
for(int i=0;i<a;i++) {
number[i] = sc.nextLong();
}
long result = 0;
result = number[0];
boolean flag = true;
for(int i=0;i<a;i++) {
if(number[i] == 0) {
System.out.println(0);
return;
}
}
for(int i=1;i<a;i++) {
if(number[i] > 1000000000000000000l / result) {
System.out.println(-1);
flag = false;
break;
}else {
result = result*number[i];
}
}
if(flag == true) {
System.out.println(result);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
17,
3,
14,
2,
13,
40,
17,
30,
14,
2,
2,
17,
13,
13,
30,
0,
13,
40,
17,
30,
0,
13,
13,
30,
9,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
35,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
35,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
53,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
53,
74
],
[
74,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = Integer.parseInt(sc.next());",
"N",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"long sum = 1;",
"sum",
"1",
"for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }",
"{\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }",
"long next = Long.parseLong(sc.next());",
"next",
"Long.parseLong(sc.next())",
"Long.parseLong",
"Long",
"sc.next()",
"sc.next",
"sc",
"if(next == 0) {\n sum = 0;\n break;\n }",
"next == 0",
"next",
"0",
"{\n sum = 0;\n break;\n }",
"sum = 0",
"sum",
"0",
"break;",
"if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }",
"sum != -1",
"sum",
"-1",
"1",
"{\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }",
"if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }",
"1000000000000000000L / next < sum",
"1000000000000000000L / next",
"1000000000000000000L",
"next",
"sum",
"{\n sum = -1;\n }",
"sum = -1",
"sum",
"-1",
"1",
"{\n sum *= next;\n }",
"sum *= next",
"sum",
"next",
"{\n continue;\n }",
"continue;",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n long sum = 1;\n for(int i=0; i<N; i++) {\n long next = Long.parseLong(sc.next());\n if(next == 0) {\n sum = 0;\n break;\n }\n if(sum != -1) {\n if(1000000000000000000L / next < sum) {\n sum = -1;\n }else {\n sum *= next;\n }\n }else {\n continue;\n }\n }\n System.out.println(sum);\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
long sum = 1;
for(int i=0; i<N; i++) {
long next = Long.parseLong(sc.next());
if(next == 0) {
sum = 0;
break;
}
if(sum != -1) {
if(1000000000000000000L / next < sum) {
sum = -1;
}else {
sum *= next;
}
}else {
continue;
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
40,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
4,
13,
13,
18,
13,
13,
2,
2,
13,
18,
13,
13,
17,
30,
0,
13,
2,
13,
18,
13,
13,
30,
0,
13,
17,
4,
18,
18,
13,
13,
40,
17,
3,
14,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
2,
13,
13,
13,
30,
29,
17,
29,
17,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
154,
5
],
[
154,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
64,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
71,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
85,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
92,
98
],
[
84,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
84,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
107,
118
],
[
64,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
6,
128
],
[
128,
129
],
[
154,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
138,
144
],
[
144,
145
],
[
145,
146
],
[
132,
147
],
[
147,
148
],
[
130,
149
],
[
149,
150
],
[
130,
151
],
[
151,
152
],
[
0,
153
],
[
153,
154
],
[
153,
155
]
] |
[
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static boolean checklong(long a, long b) {\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static boolean checklong(long a, long b) {\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"long N = scn.nextInt();",
"N",
"scn.nextInt()",
"scn.nextInt",
"scn",
"long[] arr = new long[(int) N];",
"arr",
"new long[(int) N]",
"(int) N",
"int zero = 0;",
"zero",
"0",
"for (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}",
"{\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}",
"arr[i] = scn.nextLong()",
"arr[i]",
"arr",
"i",
"scn.nextLong()",
"scn.nextLong",
"scn",
"if (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}",
"arr[i] == 0",
"arr[i]",
"arr",
"i",
"0",
"{\n\t\t\t\tzero++;\n\t\t\t}",
"zero++",
"zero",
"if (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}",
"zero != 0",
"zero",
"0",
"{\n\t\t\tSystem.out.println(0);\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"{\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}",
"long ans = 1;",
"ans",
"1",
"boolean check = true;",
"check",
"true",
"for (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L",
"checklong(ans, arr[i])",
"checklong",
"ans",
"arr[i]",
"arr",
"i",
"ans * arr[i] <= 1000000000000000000L",
"ans * arr[i]",
"ans",
"arr[i]",
"arr",
"i",
"1000000000000000000L",
"{\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t}",
"ans = ans * arr[i]",
"ans",
"ans * arr[i]",
"ans",
"arr[i]",
"arr",
"i",
"{\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"check = false",
"check",
"false",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"break;",
"if (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}",
"check",
"{\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static boolean checklong(long a, long b) {\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"checklong",
"{\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"long c = a * b;",
"c",
"a * b",
"a",
"b",
"if ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}",
"(c / (a)) == b",
"(c / (a))",
"c",
"(a)",
"b",
"{\n\t\t\treturn true;\n\t\t}",
"return true;",
"true",
"return false;",
"false",
"long a",
"a",
"long b",
"b",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static boolean checklong(long a, long b) {\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tlong[] arr = new long[(int) N];\n\t\tint zero = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextLong();\n\t\t\tif (arr[i] == 0) {\n\t\t\t\tzero++;\n\t\t\t}\n\t\t}\n\t\tif (zero != 0) {\n\t\t\tSystem.out.println(0);\n\t\t} else {\n\t\t\tlong ans = 1;\n\t\t\tboolean check = true;\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tif (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {\n\t\t\t\t\tans = ans * arr[i];\n\t\t\t\t} else {\n\t\t\t\t\tcheck = false;\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (check) {\n\t\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static boolean checklong(long a, long b) {\n\t\tlong c = a * b;\n\t\tif ((c / (a)) == b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
long N = scn.nextInt();
long[] arr = new long[(int) N];
int zero = 0;
for (int i = 0; i < N; i++) {
arr[i] = scn.nextLong();
if (arr[i] == 0) {
zero++;
}
}
if (zero != 0) {
System.out.println(0);
} else {
long ans = 1;
boolean check = true;
for (int i = 0; i < N; i++) {
if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
ans = ans * arr[i];
} else {
check = false;
System.out.println(-1);
break;
}
}
if (check) {
System.out.println(ans);
}
}
}
public static boolean checklong(long a, long b) {
long c = a * b;
if ((c / (a)) == b) {
return true;
}
return false;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
14,
2,
18,
13,
17,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
2,
2,
13,
17,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
17,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
110,
8
],
[
110,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
54,
61
],
[
11,
62
],
[
62,
63
],
[
62,
64
],
[
11,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
73,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
71,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
69,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
11,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
100,
106
],
[
9,
107
],
[
107,
108
],
[
0,
109
],
[
109,
110
],
[
109,
111
]
] |
[
"import java.util.Scanner;\nimport java.util.Arrays;\npublic class Main{\n public static void main(String[] args){\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n } \n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main{\n public static void main(String[] args){\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n } \n}",
"Main",
"public static void main(String[] args){\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n }",
"main",
"{\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n }",
"final Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int n = cin.nextInt();",
"n",
"cin.nextInt()",
"cin.nextInt",
"cin",
"long[] arr=new long[n];",
"arr",
"new long[n]",
"n",
"for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i]=cin.nextLong();\n }",
"{\n arr[i]=cin.nextLong();\n }",
"arr[i]=cin.nextLong()",
"arr[i]",
"arr",
"i",
"cin.nextLong()",
"cin.nextLong",
"cin",
"Arrays.parallelSort(arr)",
"Arrays.parallelSort",
"Arrays",
"arr",
"if(arr[0]==0){\n System.out.print(0);\n return;\n }",
"arr[0]==0",
"arr[0]",
"arr",
"0",
"0",
"{\n System.out.print(0);\n return;\n }",
"System.out.print(0)",
"System.out.print",
"System.out",
"System",
"System.out",
"0",
"return;",
"long mul=1L;",
"mul",
"1L",
"for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n }",
"long a",
"arr",
"{\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n }",
"{\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n }",
"if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n }",
"mul*1.0*a>(long)1e18",
"mul*1.0*a",
"mul*1.0*a",
"mul",
"1.0",
"a",
"(long)1e18",
"{\n System.out.print(-1);\n System.exit(0);\n }",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.exit(0)",
"System.exit",
"System",
"0",
"mul=mul*a",
"mul",
"mul*a",
"mul",
"a",
"System.out.print(mul>(long)1e18?-1:mul)",
"System.out.print",
"System.out",
"System",
"System.out",
"mul>(long)1e18?-1:mul",
"mul>(long)1e18",
"mul",
"(long)1e18",
"-1",
"1",
"mul",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n } \n}",
"public class Main{\n public static void main(String[] args){\n final Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n long[] arr=new long[n];\n for(int i=0;i<n;i++){\n arr[i]=cin.nextLong();\n } \n Arrays.parallelSort(arr);\n if(arr[0]==0){\n System.out.print(0);\n return;\n } \n long mul=1L;\n for(long a:arr){\n if(mul*1.0*a>(long)1e18){\n System.out.print(-1);\n System.exit(0);\n } \n mul=mul*a;\n } \n System.out.print(mul>(long)1e18?-1:mul);\n } \n}",
"Main"
] |
import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String[] args){
final Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
long[] arr=new long[n];
for(int i=0;i<n;i++){
arr[i]=cin.nextLong();
}
Arrays.parallelSort(arr);
if(arr[0]==0){
System.out.print(0);
return;
}
long mul=1L;
for(long a:arr){
if(mul*1.0*a>(long)1e18){
System.out.print(-1);
System.exit(0);
}
mul=mul*a;
}
System.out.print(mul>(long)1e18?-1:mul);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
13,
17,
29,
41,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
2,
13,
13,
13,
30,
4,
18,
13,
40,
17,
29,
0,
13,
13,
4,
18,
13,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
17,
42,
2,
40,
13,
17,
4,
13,
4,
18,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
4,
13,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
4,
18,
13,
17,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
491,
8
],
[
491,
9
],
[
9,
10
],
[
491,
11
],
[
11,
12
],
[
491,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
21,
22
],
[
21,
23
],
[
15,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
45,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
51,
56
],
[
15,
57
],
[
57,
58
],
[
57,
59
],
[
15,
60
],
[
60,
61
],
[
60,
62
],
[
15,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
74,
80
],
[
67,
81
],
[
81,
82
],
[
81,
83
],
[
15,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
491,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
90,
97
],
[
97,
98
],
[
97,
99
],
[
90,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
100,
105
],
[
105,
106
],
[
90,
107
],
[
107,
108
],
[
108,
109
],
[
88,
110
],
[
110,
111
],
[
491,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
132,
136
],
[
136,
137
],
[
136,
138
],
[
129,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
129,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
148,
149
],
[
148,
150
],
[
129,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
112,
156
],
[
156,
157
],
[
491,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
161,
171
],
[
171,
172
],
[
172,
173
],
[
161,
174
],
[
175,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
178,
182
],
[
182,
183
],
[
182,
184
],
[
175,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
175,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
194,
196
],
[
175,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
158,
202
],
[
202,
203
],
[
491,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
204,
208
],
[
208,
209
],
[
204,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
210,
216
],
[
216,
217
],
[
204,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
218,
224
],
[
224,
225
],
[
204,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
229,
238
],
[
238,
239
],
[
238,
240
],
[
228,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
204,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
252,
257
],
[
257,
258
],
[
257,
259
],
[
252,
260
],
[
260,
261
],
[
261,
262
],
[
252,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
264,
268
],
[
268,
269
],
[
247,
270
],
[
270,
271
],
[
245,
272
],
[
272,
273
],
[
204,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
277,
278
],
[
277,
279
],
[
276,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
281,
286
],
[
286,
287
],
[
286,
288
],
[
281,
289
],
[
289,
290
],
[
290,
291
],
[
281,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
297,
298
],
[
276,
299
],
[
299,
300
],
[
274,
301
],
[
301,
302
],
[
204,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
306,
308
],
[
305,
310
],
[
310,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
310,
315
],
[
315,
316
],
[
315,
317
],
[
310,
318
],
[
318,
319
],
[
319,
320
],
[
310,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
322,
326
],
[
326,
327
],
[
305,
328
],
[
328,
329
],
[
328,
330
],
[
305,
331
],
[
331,
332
],
[
332,
333
],
[
331,
334
],
[
305,
335
],
[
335,
336
],
[
303,
337
],
[
337,
338
],
[
204,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
341,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
348,
350
],
[
346,
351
],
[
351,
352
],
[
351,
353
],
[
346,
354
],
[
354,
355
],
[
355,
356
],
[
346,
357
],
[
357,
358
],
[
358,
359
],
[
359,
360
],
[
359,
361
],
[
358,
362
],
[
362,
363
],
[
341,
364
],
[
364,
365
],
[
364,
366
],
[
341,
367
],
[
367,
368
],
[
368,
369
],
[
367,
370
],
[
341,
371
],
[
371,
372
],
[
339,
373
],
[
373,
374
],
[
204,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
378,
379
],
[
378,
380
],
[
377,
382
],
[
382,
383
],
[
383,
384
],
[
384,
385
],
[
384,
386
],
[
382,
387
],
[
387,
388
],
[
387,
389
],
[
382,
390
],
[
390,
391
],
[
391,
392
],
[
382,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
394,
398
],
[
398,
399
],
[
377,
400
],
[
400,
401
],
[
375,
402
],
[
402,
403
],
[
204,
404
],
[
404,
405
],
[
404,
406
],
[
406,
407
],
[
407,
408
],
[
407,
409
],
[
406,
411
],
[
411,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
411,
416
],
[
416,
417
],
[
416,
418
],
[
411,
419
],
[
419,
420
],
[
420,
421
],
[
411,
422
],
[
422,
423
],
[
423,
424
],
[
424,
425
],
[
424,
426
],
[
423,
427
],
[
427,
428
],
[
406,
429
],
[
429,
430
],
[
404,
431
],
[
431,
432
],
[
204,
433
],
[
433,
434
],
[
433,
435
],
[
435,
436
],
[
436,
437
],
[
437,
438
],
[
438,
439
],
[
204,
440
],
[
440,
441
],
[
440,
442
],
[
442,
443
],
[
443,
444
],
[
444,
445
],
[
445,
446
],
[
444,
447
],
[
447,
448
],
[
204,
449
],
[
449,
450
],
[
449,
451
],
[
451,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
453,
456
],
[
456,
457
],
[
204,
458
],
[
458,
459
],
[
458,
460
],
[
460,
461
],
[
461,
462
],
[
462,
463
],
[
463,
464
],
[
464,
465
],
[
462,
466
],
[
204,
467
],
[
467,
468
],
[
467,
469
],
[
469,
470
],
[
470,
471
],
[
471,
472
],
[
472,
473
],
[
471,
474
],
[
474,
475
],
[
204,
476
],
[
476,
477
],
[
476,
478
],
[
478,
479
],
[
479,
480
],
[
480,
481
],
[
481,
482
],
[
204,
483
],
[
483,
484
],
[
483,
485
],
[
485,
486
],
[
486,
487
],
[
487,
488
],
[
486,
489
],
[
0,
490
],
[
490,
491
],
[
490,
492
]
] |
[
"import java.io.*;\nimport java.util.*;\n\npublic class Main{\n \tstatic void main() throws Exception{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}\n\tpublic static void main(String[] args) throws Exception{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}\n\tstatic PrintWriter pw;\n\tstatic MScanner sc;\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void shuffle(int[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n\tstatic void shuffle(long[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n \tstatic void main() throws Exception{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}\n\tpublic static void main(String[] args) throws Exception{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}\n\tstatic PrintWriter pw;\n\tstatic MScanner sc;\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void shuffle(int[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n\tstatic void shuffle(long[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n}",
"Main",
"static PrintWriter pw;",
"pw",
"static MScanner sc;",
"sc",
"static void main() throws Exception{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}",
"main",
"{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[]in=new long[n];",
"in",
"new long[n]",
"n",
"for(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}",
"{\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}",
"in[i]=sc.nextLong()",
"in[i]",
"in",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}",
"in[i]==0",
"in[i]",
"in",
"i",
"0",
"{\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}",
"pw.println(0)",
"pw.println",
"pw",
"0",
"return;",
"long inf=(long)1e18;",
"inf",
"(long)1e18",
"long ans=1;",
"ans",
"1",
"for(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}",
"long i",
"in",
"{\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}",
"{\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}",
"if(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}",
"inf/i<ans",
"inf/i",
"inf",
"i",
"ans",
"{\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}",
"pw.println(-1)",
"pw.println",
"pw",
"-1",
"1",
"return;",
"ans*=i",
"ans",
"i",
"pw.println(ans)",
"pw.println",
"pw",
"ans",
"public static void main(String[] args) throws Exception{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}",
"main",
"{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}",
"pw=new PrintWriter(System.out)",
"pw",
"new PrintWriter(System.out)",
"sc = new MScanner(System.in)",
"sc",
"new MScanner(System.in)",
"int tc=1;",
"tc",
"1",
"while(tc-->0)main();",
"tc-->0",
"tc--",
"tc",
"0",
"main()",
"main",
"pw.flush()",
"pw.flush",
"pw",
"String[] args",
"args",
"static void shuffle(int[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}",
"shuffle",
"{\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}",
"for(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"{\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"{\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"int idx=(int)(Math.random()*in.length);",
"idx",
"(int)(Math.random()*in.length)",
"Math.random()",
"Math.random",
"Math",
"in.length",
"in",
"in.length",
"int tmp=in[i];",
"tmp",
"in[i]",
"in",
"i",
"in[i]=in[idx]",
"in[i]",
"in",
"i",
"in[idx]",
"in",
"idx",
"in[idx]=tmp",
"in[idx]",
"in",
"idx",
"tmp",
"int[]in",
"in",
"static void shuffle(long[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}",
"shuffle",
"{\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}",
"for(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"{\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"{\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}",
"int idx=(int)(Math.random()*in.length);",
"idx",
"(int)(Math.random()*in.length)",
"Math.random()",
"Math.random",
"Math",
"in.length",
"in",
"in.length",
"long tmp=in[i];",
"tmp",
"in[i]",
"in",
"i",
"in[i]=in[idx]",
"in[i]",
"in",
"i",
"in[idx]",
"in",
"idx",
"in[idx]=tmp",
"in[idx]",
"in",
"idx",
"tmp",
"long[]in",
"in",
"static class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}",
"MScanner",
"StringTokenizer st;",
"st",
"BufferedReader br;",
"br",
"public MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}",
"MScanner",
"{\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}",
"br = new BufferedReader(new InputStreamReader(system))",
"br",
"new BufferedReader(new InputStreamReader(system))",
"InputStream system",
"system",
"public MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}",
"MScanner",
"{\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}",
"br = new BufferedReader(new FileReader(file))",
"br",
"new BufferedReader(new FileReader(file))",
"String file",
"file",
"public String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}",
"next",
"{\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}",
"while (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"intArr",
"{\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"int[]in=new int[n];",
"in",
"new int[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"return in;",
"in",
"int n",
"n",
"public long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"longArr",
"{\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"long[]in=new long[n];",
"in",
"new long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"return in;",
"in",
"int n",
"n",
"public int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"intSortedArr",
"{\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"int[]in=new int[n];",
"in",
"new int[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"shuffle(in)",
"shuffle",
"in",
"Arrays.sort(in)",
"Arrays.sort",
"Arrays",
"in",
"return in;",
"in",
"int n",
"n",
"public long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"longSortedArr",
"{\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"long[]in=new long[n];",
"in",
"new long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"shuffle(in)",
"shuffle",
"in",
"Arrays.sort(in)",
"Arrays.sort",
"Arrays",
"in",
"return in;",
"in",
"int n",
"n",
"public Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"IntegerArr",
"{\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"Integer[]in=new Integer[n];",
"in",
"new Integer[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"return in;",
"in",
"int n",
"n",
"public Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"LongArr",
"{\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"Long[]in=new Long[n];",
"in",
"new Long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"return in;",
"in",
"int n",
"n",
"public String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}",
"nextLine",
"{\n\t\t\treturn br.readLine();\n\t\t}",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"public int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"nextDouble",
"{\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}",
"nextChar",
"{\n\t\t\treturn next().charAt(0);\n\t\t}",
"return next().charAt(0);",
"next().charAt(0)",
"next().charAt",
"next()",
"next",
"0",
"public long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"nextLong",
"{\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}",
"ready",
"{\n\t\t\treturn br.ready();\n\t\t}",
"return br.ready();",
"br.ready()",
"br.ready",
"br",
"public void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}",
"waitForInput",
"{\n\t\t\tThread.sleep(3000);\n\t\t}",
"Thread.sleep(3000)",
"Thread.sleep",
"Thread",
"3000",
"public class Main{\n \tstatic void main() throws Exception{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}\n\tpublic static void main(String[] args) throws Exception{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}\n\tstatic PrintWriter pw;\n\tstatic MScanner sc;\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void shuffle(int[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n\tstatic void shuffle(long[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n}",
"public class Main{\n \tstatic void main() throws Exception{\n \t\tint n=sc.nextInt();\n \t\tlong[]in=new long[n];\n \t\tfor(int i=0;i<n;i++) {\n \t\t\tin[i]=sc.nextLong();\n \t\t\tif(in[i]==0) {\n \t\t\t\tpw.println(0);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tlong inf=(long)1e18;\n \t\tlong ans=1;\n \t\t\n \t\tfor(long i:in) {\n \t\t\tif(inf/i<ans) {\n \t\t\t\tpw.println(-1);\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tans*=i;\n \t\t}\n \t\t\n \t\tpw.println(ans);\n\t}\n\tpublic static void main(String[] args) throws Exception{\n\t\tpw=new PrintWriter(System.out);\n\t\tsc = new MScanner(System.in);\n\t\tint tc=1;\n\t\twhile(tc-->0)main();\n\t\tpw.flush();\n\t}\n\tstatic PrintWriter pw;\n\tstatic MScanner sc;\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void shuffle(int[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tint tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n\tstatic void shuffle(long[]in) {\n\t\tfor(int i=0;i<in.length;i++) {\n\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\tlong tmp=in[i];\n\t\t\tin[i]=in[idx];\n\t\t\tin[idx]=tmp;\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main{
static void main() throws Exception{
int n=sc.nextInt();
long[]in=new long[n];
for(int i=0;i<n;i++) {
in[i]=sc.nextLong();
if(in[i]==0) {
pw.println(0);
return;
}
}
long inf=(long)1e18;
long ans=1;
for(long i:in) {
if(inf/i<ans) {
pw.println(-1);
return;
}
ans*=i;
}
pw.println(ans);
}
public static void main(String[] args) throws Exception{
pw=new PrintWriter(System.out);
sc = new MScanner(System.in);
int tc=1;
while(tc-->0)main();
pw.flush();
}
static PrintWriter pw;
static MScanner sc;
static class MScanner {
StringTokenizer st;
BufferedReader br;
public MScanner(InputStream system) {
br = new BufferedReader(new InputStreamReader(system));
}
public MScanner(String file) throws Exception {
br = new BufferedReader(new FileReader(file));
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine());
return st.nextToken();
}
public int[] intArr(int n) throws IOException {
int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
return in;
}
public long[] longArr(int n) throws IOException {
long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
return in;
}
public int[] intSortedArr(int n) throws IOException {
int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
shuffle(in);
Arrays.sort(in);
return in;
}
public long[] longSortedArr(int n) throws IOException {
long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
shuffle(in);
Arrays.sort(in);
return in;
}
public Integer[] IntegerArr(int n) throws IOException {
Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
return in;
}
public Long[] LongArr(int n) throws IOException {
Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
return in;
}
public String nextLine() throws IOException {
return br.readLine();
}
public int nextInt() throws IOException {
return Integer.parseInt(next());
}
public double nextDouble() throws IOException {
return Double.parseDouble(next());
}
public char nextChar() throws IOException {
return next().charAt(0);
}
public long nextLong() throws IOException {
return Long.parseLong(next());
}
public boolean ready() throws IOException {
return br.ready();
}
public void waitForInput() throws InterruptedException {
Thread.sleep(3000);
}
}
static void shuffle(int[]in) {
for(int i=0;i<in.length;i++) {
int idx=(int)(Math.random()*in.length);
int tmp=in[i];
in[i]=in[idx];
in[idx]=tmp;
}
}
static void shuffle(long[]in) {
for(int i=0;i<in.length;i++) {
int idx=(int)(Math.random()*in.length);
long tmp=in[i];
in[i]=in[idx];
in[idx]=tmp;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
14,
2,
13,
17,
30,
9,
30,
14,
2,
13,
2,
13,
13,
0,
13,
40,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
20,
41,
13,
12,
13,
30,
38,
5,
13,
30,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
141,
14
],
[
141,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
54,
61
],
[
44,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
69,
79
],
[
79,
80
],
[
79,
81
],
[
17,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
15,
88
],
[
88,
89
],
[
141,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
90,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
99,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
90,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
90,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
0,
140
],
[
140,
141
],
[
140,
142
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }",
"main",
"{\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }",
"MyScanner sc = new MyScanner();",
"sc",
"new MyScanner()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"final long MAX = 1000000000000000000L;",
"MAX",
"1000000000000000000L",
"long ans = 1L;",
"ans",
"1L",
"for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }",
"{\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a == 0) {\n System.out.println(0);\n return;\n }",
"a == 0",
"a",
"0",
"{\n System.out.println(0);\n return;\n }",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }",
"ans < 0",
"ans",
"0",
"{\n continue;\n }",
"continue;",
"{\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }",
"if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;",
"a > MAX/ans",
"a",
"MAX/ans",
"MAX",
"ans",
"ans = -1",
"ans",
"-1",
"1",
"ans *= a",
"ans",
"a",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }",
"MyScanner",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);",
"reader",
"new BufferedReader(new InputStreamReader(System.in), 1 << 15)",
"StringTokenizer tokenizer;",
"tokenizer",
"String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }",
"try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }",
"catch (IOException ignored) {\n }",
"IOException ignored",
"{\n }",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int n = sc.nextInt();\n final long MAX = 1000000000000000000L;\n\n long ans = 1L;\n for (int i = 0; i < n; i++) {\n long a = sc.nextLong();\n\n if (a == 0) {\n System.out.println(0);\n return;\n }\n\n if (ans < 0) {\n continue;\n } else {\n if (a > MAX/ans)\n ans = -1;\n else\n ans *= a;\n }\n }\n\n System.out.println(ans);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
int n = sc.nextInt();
final long MAX = 1000000000000000000L;
long ans = 1L;
for (int i = 0; i < n; i++) {
long a = sc.nextLong();
if (a == 0) {
System.out.println(0);
return;
}
if (ans < 0) {
continue;
} else {
if (a > MAX/ans)
ans = -1;
else
ans *= a;
}
}
System.out.println(ans);
}
static class MyScanner {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
StringTokenizer tokenizer;
String next() {
try {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
tokenizer = new StringTokenizer(reader.readLine());
}
} catch (IOException ignored) {
}
return tokenizer.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
41,
13,
41,
13,
0,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
4,
18,
13,
4,
18,
13,
17,
17,
30,
0,
13,
4,
18,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
4,
18,
13,
20,
17,
0,
13,
17,
14,
2,
4,
18,
13,
20,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
113,
8
],
[
113,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
51,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
60,
67
],
[
67,
68
],
[
67,
69
],
[
44,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
44,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
81,
86
],
[
80,
87
],
[
87,
88
],
[
87,
89
],
[
11,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
91,
96
],
[
90,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
90,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
9,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] |
[
"//package acm.biginter;\n\nimport java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String args[])\n {\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String args[])\n {\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }\n}",
"Main",
"public static void main(String args[])\n {\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }",
"main",
"{\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }",
"Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int n;",
"n",
"n = cin.nextInt()",
"n",
"cin.nextInt()",
"cin.nextInt",
"cin",
"BigInteger x",
"x",
"ans;",
"ans",
"ans = new BigInteger(\"1\")",
"ans",
"new BigInteger(\"1\")",
"int flag = 0;",
"flag",
"0",
"for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i ++",
"i ++",
"i",
"{\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }",
"{\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }",
"x = cin.nextBigInteger()",
"x",
"cin.nextBigInteger()",
"cin.nextBigInteger",
"cin",
"if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }",
"x.compareTo(BigInteger.valueOf(0)) == 0",
"x.compareTo(BigInteger.valueOf(0))",
"x.compareTo",
"x",
"BigInteger.valueOf(0)",
"BigInteger.valueOf",
"BigInteger",
"0",
"0",
"{\n ans = BigInteger.valueOf(0);\n flag = 1;\n }",
"ans = BigInteger.valueOf(0)",
"ans",
"BigInteger.valueOf(0)",
"BigInteger.valueOf",
"BigInteger",
"0",
"flag = 1",
"flag",
"1",
"if(flag == 0) ans = ans.multiply(x);",
"flag == 0",
"flag",
"0",
"ans = ans.multiply(x)",
"ans",
"ans.multiply(x)",
"ans.multiply",
"ans",
"x",
"if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;",
"ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0",
"ans.compareTo(new BigInteger(\"1000000000000000000\"))",
"ans.compareTo",
"ans",
"new BigInteger(\"1000000000000000000\")",
"0",
"flag = 1",
"flag",
"1",
"if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);",
"ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0",
"ans.compareTo(new BigInteger(\"1000000000000000000\"))",
"ans.compareTo",
"ans",
"new BigInteger(\"1000000000000000000\")",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args",
"public class Main {\n public static void main(String args[])\n {\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }\n}",
"public class Main {\n public static void main(String args[])\n {\n Scanner cin = new Scanner(System.in);\n int n;\n n = cin.nextInt();\n BigInteger x,ans;\n ans = new BigInteger(\"1\");\n int flag = 0;\n for(int i = 1;i <= n;i ++)\n {\n x = cin.nextBigInteger();\n if(x.compareTo(BigInteger.valueOf(0)) == 0)\n {\n ans = BigInteger.valueOf(0);\n flag = 1;\n }\n if(flag == 0) ans = ans.multiply(x);\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0) flag = 1;\n }\n if(ans.compareTo(new BigInteger(\"1000000000000000000\")) > 0)\n {\n System.out.println(\"-1\");\n }\n else System.out.println(ans);\n }\n}",
"Main"
] |
//package acm.biginter;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
Scanner cin = new Scanner(System.in);
int n;
n = cin.nextInt();
BigInteger x,ans;
ans = new BigInteger("1");
int flag = 0;
for(int i = 1;i <= n;i ++)
{
x = cin.nextBigInteger();
if(x.compareTo(BigInteger.valueOf(0)) == 0)
{
ans = BigInteger.valueOf(0);
flag = 1;
}
if(flag == 0) ans = ans.multiply(x);
if(ans.compareTo(new BigInteger("1000000000000000000")) > 0) flag = 1;
}
if(ans.compareTo(new BigInteger("1000000000000000000")) > 0)
{
System.out.println("-1");
}
else System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
20,
41,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
127,
8
],
[
127,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
13,
22
],
[
22,
23
],
[
22,
24
],
[
13,
26
],
[
26,
27
],
[
26,
28
],
[
13,
29
],
[
29,
30
],
[
29,
31
],
[
13,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
52,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
58,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
13,
69
],
[
69,
70
],
[
69,
71
],
[
13,
72
],
[
72,
73
],
[
72,
74
],
[
13,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
87,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
87,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
104,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
13,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
122,
123
],
[
9,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] |
[
"import java.math.BigDecimal;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[]args) {\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}\n\t\t\n\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[]args) {\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}\n\t\t\n\n}",
"Main",
"public static void main(String[]args) {\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"main",
"{\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"try(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"Scanner scan = new Scanner(System.in)",
"Scanner scan = new Scanner(System.in)",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long[]a= new long[N];",
"a",
"new long[N]",
"N",
"long goukei = 1;",
"goukei",
"1",
"long S = (long)1e18;",
"S",
"(long)1e18",
"for(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}",
"a[i] = scan.nextLong()",
"a[i]",
"a",
"i",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}",
"a[i]==0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"System.exit(0)",
"System.exit",
"System",
"0",
"BigDecimal ans = new BigDecimal(1);",
"ans",
"new BigDecimal(1)",
"BigDecimal jou = new BigDecimal(S);",
"jou",
"new BigDecimal(S)",
"for(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"ans = ans.multiply(new BigDecimal(a[i]))",
"ans",
"ans.multiply(new BigDecimal(a[i]))",
"ans.multiply",
"ans",
"new BigDecimal(a[i])",
"int p = ans.compareTo(jou);",
"p",
"ans.compareTo(jou)",
"ans.compareTo",
"ans",
"jou",
"if(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}",
"p>0",
"p",
"0",
"{\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.exit(0)",
"System.exit",
"System",
"0",
"System.out.println(ans.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.longValue()",
"ans.longValue",
"ans",
"String[]args",
"args",
"public class Main {\n\tpublic static void main(String[]args) {\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}\n\t\t\n\n}",
"public class Main {\n\tpublic static void main(String[]args) {\n\t\ttry(Scanner scan = new Scanner(System.in)){\n\t\t\t\n\t\t\t\n\t\t\tint N = scan.nextInt();\n\t\t\tlong[]a= new long[N];\n\t\t\tlong goukei = 1;\n\t\t\tlong S = (long)1e18;\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\ta[i] = scan.nextLong();\n\t\t\t\t\n\t\t\t\tif(a[i]==0) {\n\t\t\t\t\tSystem.out.println(0);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tBigDecimal ans = new BigDecimal(1);\n\t\t\tBigDecimal jou = new BigDecimal(S);\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0;i<N;i++) {\n\t\t\t\tans = ans.multiply(new BigDecimal(a[i]));\n\t\t\t\tint p = ans.compareTo(jou);\n\t\t\t\t\n\t\t\t\tif(p>0) {\n\t\t\t\t\tSystem.out.println(-1);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(ans.longValue());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}\n\t\t\n\n}",
"Main"
] |
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[]args) {
try(Scanner scan = new Scanner(System.in)){
int N = scan.nextInt();
long[]a= new long[N];
long goukei = 1;
long S = (long)1e18;
for(int i = 0;i<N;i++) {
a[i] = scan.nextLong();
if(a[i]==0) {
System.out.println(0);
System.exit(0);
}
}
BigDecimal ans = new BigDecimal(1);
BigDecimal jou = new BigDecimal(S);
for(int i = 0;i<N;i++) {
ans = ans.multiply(new BigDecimal(a[i]));
int p = ans.compareTo(jou);
if(p>0) {
System.out.println(-1);
System.exit(0);
}
}
System.out.println(ans.longValue());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
2,
2,
4,
18,
13,
13,
4,
18,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
40,
17,
14,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
40,
17,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
0,
11
],
[
94,
12
],
[
94,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
24,
26
],
[
15,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
48,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
47,
57
],
[
46,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
45,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
45,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
76,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
15,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
13,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
] |
[
"\nimport java.util.*;\n interface aisatu{\n\tfinal String str=\"こんにちは\";\n\tvoid mesod();\n}\n\npublic class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}\n",
"import java.util.*;",
"util.*",
"java",
"interface aisatu{\n\tfinal String str=\"こんにちは\";\n\tvoid mesod();\n}",
"aisatu",
"final String str=\"こんにちは\";",
"str",
"\"こんにちは\"",
"void mesod();",
"mesod",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main",
"static public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long aa=1L;",
"aa",
"1L",
"for(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L",
"Math.log10(a)+Math.log10(aa)>18",
"Math.log10(a)+Math.log10(aa)",
"Math.log10(a)",
"Math.log10",
"Math",
"a",
"Math.log10(aa)",
"Math.log10",
"Math",
"aa",
"18",
"aa*a>1000000000000000000L",
"aa*a",
"aa",
"a",
"1000000000000000000L",
"{\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}",
"aa=-1",
"aa",
"-1",
"1",
"if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"a==0",
"a",
"0",
"{\n\t\t\t\taa*=0;\n\t\t\t}",
"aa*=0",
"aa",
"0",
"if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}",
"aa!=-1",
"aa",
"-1",
"1",
"{\n\t\t\t\taa*=a;\n\t\t\t}",
"aa*=a",
"aa",
"a",
"System.out.println(aa)",
"System.out.println",
"System.out",
"System",
"System.out",
"aa",
"String args[]",
"args",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"public class Main {\n\tstatic public void main(String args[]){\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint n=sc.nextInt();\n\t\tlong aa=1L;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tlong a=sc.nextLong();\n\t\t\tif(Math.log10(a)+Math.log10(aa)>18||\n\t\t\taa*a>1000000000000000000L){\n\t\t\t //1000000000000000000L\n\t\t\t\taa=-1;\n\t\t\t}\n\t\t\telse if(a==0){\n\t\t\t\taa*=0;\n\t\t\t}\n\t\t\telse if(aa!=-1){\n\t\t\t\taa*=a;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(aa);\n\t}\n}",
"Main"
] |
import java.util.*;
interface aisatu{
final String str="こんにちは";
void mesod();
}
public class Main {
static public void main(String args[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
long aa=1L;
for(int i=0;i<n;i++){
long a=sc.nextLong();
if(Math.log10(a)+Math.log10(aa)>18||
aa*a>1000000000000000000L){
//1000000000000000000L
aa=-1;
}
else if(a==0){
aa*=0;
}
else if(aa!=-1){
aa*=a;
}
}
System.out.println(aa);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
18,
13,
13,
30,
0,
13,
40,
17,
3,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
110,
5
],
[
110,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
47,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
53,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
87,
92
],
[
79,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
8,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
6,
107
],
[
107,
108
],
[
0,
109
],
[
109,
110
],
[
109,
111
]
] |
[
"import java.util.Scanner;\n\n\npublic class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long a[] = new long[n];",
"a",
"new long[n]",
"n",
"Long max = Long.parseLong(\"1000000000000000000\");",
"max",
"Long.parseLong(\"1000000000000000000\")",
"Long.parseLong",
"Long",
"\"1000000000000000000\"",
"for(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"a[i] = scan.nextLong()",
"a[i]",
"a",
"i",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"return;",
"long ans = a[0];",
"ans",
"a[0]",
"a",
"0",
"for(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}",
"if(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}",
"ans > max / a[i]",
"ans",
"max / a[i]",
"max",
"a[i]",
"a",
"i",
"{\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t}",
"ans = -1",
"ans",
"-1",
"1",
"break;",
"{\n\t\t\t\tans = ans * a[i];\n\t\t\t}",
"ans = ans * a[i]",
"ans",
"ans * a[i]",
"ans",
"a[i]",
"a",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tlong a[] = new long[n];\n\t\tLong max = Long.parseLong(\"1000000000000000000\");\n\t\t// 0が含まれる場合\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(ans > max / a[i]) {\n\t\t\t\tans = -1;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tans = ans * a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main (String args[]) throws Exception{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
long a[] = new long[n];
Long max = Long.parseLong("1000000000000000000");
// 0が含まれる場合
for(int i = 0; i < n; i++) {
a[i] = scan.nextLong();
if(a[i] == 0) {
System.out.println(0);
return;
}
}
long ans = a[0];
for(int i = 1; i < n; i++) {
if(ans > max / a[i]) {
ans = -1;
break;
} else {
ans = ans * a[i];
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
28,
13,
13,
30,
30,
14,
2,
13,
17,
30,
4,
18,
13,
17,
29,
14,
2,
13,
40,
17,
30,
9,
14,
2,
13,
2,
17,
13,
30,
0,
13,
40,
17,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
30,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
4,
18,
13,
13,
29,
4,
13,
13,
23,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
6,
13,
12,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
18,
36,
13,
20,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
30,
4,
18,
13,
17,
4,
18,
13,
18,
13,
13,
23,
13,
12,
13,
30,
4,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
516,
35
],
[
516,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
38,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
38,
49
],
[
49,
50
],
[
49,
51
],
[
38,
52
],
[
52,
53
],
[
52,
54
],
[
38,
55
],
[
55,
56
],
[
55,
57
],
[
38,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
58,
62
],
[
58,
63
],
[
38,
64
],
[
64,
65
],
[
65,
66
],
[
36,
67
],
[
67,
68
],
[
516,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
73,
85
],
[
85,
86
],
[
85,
87
],
[
73,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
97,
102
],
[
92,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
103,
108
],
[
108,
109
],
[
92,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
110,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
73,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
71,
140
],
[
140,
141
],
[
71,
142
],
[
142,
143
],
[
71,
144
],
[
144,
145
],
[
516,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
146,
154
],
[
154,
155
],
[
146,
156
],
[
156,
157
],
[
146,
158
],
[
158,
159
],
[
146,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
160,
168
],
[
168,
169
],
[
146,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
177,
185
],
[
185,
186
],
[
186,
187
],
[
177,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
172,
196
],
[
196,
197
],
[
170,
198
],
[
198,
199
],
[
146,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
203,
208
],
[
208,
209
],
[
209,
210
],
[
202,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
219,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
228,
231
],
[
215,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
232,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
202,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
146,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
247,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
252,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
247,
261
],
[
261,
262
],
[
261,
263
],
[
247,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
264,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
271,
272
],
[
268,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
247,
277
],
[
277,
278
],
[
277,
279
],
[
247,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
280,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
287,
291
],
[
291,
292
],
[
291,
293
],
[
286,
294
],
[
294,
295
],
[
295,
296
],
[
285,
297
],
[
297,
298
],
[
297,
299
],
[
285,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
302,
304
],
[
285,
305
],
[
305,
306
],
[
305,
307
],
[
307,
308
],
[
247,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
146,
313
],
[
313,
314
],
[
313,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
315,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
320,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
327,
328
],
[
315,
329
],
[
329,
330
],
[
329,
331
],
[
315,
332
],
[
332,
333
],
[
333,
334
],
[
333,
335
],
[
332,
336
],
[
336,
337
],
[
337,
338
],
[
337,
339
],
[
339,
340
],
[
336,
341
],
[
341,
342
],
[
341,
343
],
[
343,
344
],
[
315,
345
],
[
345,
346
],
[
345,
347
],
[
315,
348
],
[
348,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
348,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
356,
357
],
[
356,
358
],
[
355,
359
],
[
359,
360
],
[
359,
361
],
[
354,
362
],
[
362,
363
],
[
363,
364
],
[
353,
365
],
[
365,
366
],
[
365,
367
],
[
353,
368
],
[
368,
369
],
[
368,
370
],
[
370,
371
],
[
370,
372
],
[
353,
373
],
[
373,
374
],
[
373,
375
],
[
375,
376
],
[
315,
377
],
[
377,
378
],
[
378,
379
],
[
378,
380
],
[
146,
381
],
[
381,
382
],
[
381,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
384,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
391,
392
],
[
390,
393
],
[
383,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
381,
398
],
[
398,
399
],
[
146,
400
],
[
400,
401
],
[
400,
402
],
[
402,
403
],
[
403,
404
],
[
407,
405
],
[
417,
406
],
[
414,
407
],
[
407,
408
],
[
408,
409
],
[
408,
410
],
[
407,
411
],
[
411,
412
],
[
411,
413
],
[
414,
414
],
[
414,
415
],
[
414,
416
],
[
417,
417
],
[
417,
418
],
[
417,
419
],
[
407,
420
],
[
420,
421
],
[
420,
422
],
[
422,
423
],
[
400,
424
],
[
424,
425
],
[
146,
426
],
[
426,
427
],
[
426,
428
],
[
428,
429
],
[
428,
430
],
[
430,
431
],
[
516,
432
],
[
432,
433
],
[
432,
434
],
[
434,
435
],
[
432,
436
],
[
436,
437
],
[
436,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
436,
442
],
[
442,
443
],
[
432,
444
],
[
444,
445
],
[
444,
446
],
[
446,
447
],
[
447,
448
],
[
448,
449
],
[
448,
450
],
[
447,
451
],
[
444,
452
],
[
452,
453
],
[
432,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
457,
458
],
[
458,
459
],
[
459,
460
],
[
459,
461
],
[
457,
462
],
[
462,
463
],
[
462,
464
],
[
464,
465
],
[
464,
466
],
[
457,
467
],
[
467,
468
],
[
468,
469
],
[
457,
470
],
[
471,
471
],
[
471,
472
],
[
472,
473
],
[
473,
474
],
[
473,
475
],
[
472,
476
],
[
476,
477
],
[
477,
478
],
[
478,
479
],
[
477,
480
],
[
471,
481
],
[
481,
482
],
[
482,
483
],
[
481,
484
],
[
484,
485
],
[
484,
486
],
[
454,
487
],
[
487,
488
],
[
432,
489
],
[
489,
490
],
[
489,
491
],
[
491,
492
],
[
492,
493
],
[
492,
494
],
[
491,
495
],
[
495,
496
],
[
496,
497
],
[
489,
498
],
[
498,
499
],
[
432,
500
],
[
500,
501
],
[
500,
502
],
[
502,
503
],
[
503,
504
],
[
504,
505
],
[
432,
506
],
[
506,
507
],
[
506,
508
],
[
508,
509
],
[
509,
510
],
[
510,
511
],
[
509,
512
],
[
506,
513
],
[
513,
514
],
[
0,
515
],
[
515,
516
],
[
515,
517
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.io.BufferedWriter;\nimport java.io.Writer;\nimport java.io.OutputStreamWriter;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author New User\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void printLine(long i) {\n writer.println(i);\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.Writer;",
"Writer",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void printLine(long i) {\n writer.println(i);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"OutputWriter out = new OutputWriter(outputStream);",
"out",
"new OutputWriter(outputStream)",
"BMultiplication2 solver = new BMultiplication2();",
"solver",
"new BMultiplication2()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class BMultiplication2 {\n public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }\n\n }",
"BMultiplication2",
"public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }",
"solve",
"{\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }",
"int n = c.readInt();",
"n",
"c.readInt()",
"c.readInt",
"c",
"long[] a = c.readLongArray(n);",
"a",
"c.readLongArray(n)",
"c.readLongArray",
"c",
"n",
"long res = 1;",
"res",
"1",
"for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }",
"long kk",
"a",
"{\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }",
"{\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }",
"if (kk == 0) {\n w.printLine(\"0\");\n return;\n }",
"kk == 0",
"kk",
"0",
"{\n w.printLine(\"0\");\n return;\n }",
"w.printLine(\"0\")",
"w.printLine",
"w",
"\"0\"",
"return;",
"if (res == -1) {\n continue;\n }",
"res == -1",
"res",
"-1",
"1",
"{\n continue;\n }",
"continue;",
"if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }",
"res > 2e18 / kk",
"res",
"2e18 / kk",
"2e18",
"kk",
"{\n res = -1;\n }",
"res = -1",
"res",
"-1",
"1",
"{\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }",
"res = res * kk",
"res",
"res * kk",
"res",
"kk",
"if (res > (long) 1e18) {\n res = -1;\n }",
"res > (long) 1e18",
"res",
"(long) 1e18",
"{\n res = -1;\n }",
"res = -1",
"res",
"-1",
"1",
"w.printLine(res)",
"w.printLine",
"w",
"res",
"int testNumber",
"testNumber",
"InputReader c",
"c",
"OutputWriter w",
"w",
"static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }",
"InputReader",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"private InputReader.SpaceCharFilter filter;",
"filter",
"public InputReader(InputStream stream) {\n this.stream = stream;\n }",
"InputReader",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }",
"readLongArray",
"{\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }",
"long[] array = new long[size];",
"array",
"new long[size]",
"size",
"for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n array[i] = readLong();\n }",
"{\n array[i] = readLong();\n }",
"array[i] = readLong()",
"array[i]",
"array",
"i",
"readLong()",
"readLong",
"return array;",
"array",
"int size",
"size",
"public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }",
"read",
"{\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }",
"if (numChars == -1) {\n throw new InputMismatchException();\n }",
"numChars == -1",
"numChars",
"-1",
"1",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0) {\n return -1;\n }",
"numChars <= 0",
"numChars",
"0",
"{\n return -1;\n }",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"readInt",
"{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c)) {\n c = read();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"int res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"readLong",
"{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c)) {\n c = read();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"long res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }",
"isSpaceChar",
"{\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }",
"if (filter != null) {\n return filter.isSpaceChar(c);\n }",
"filter != null",
"filter",
"null",
"{\n return filter.isSpaceChar(c);\n }",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return isWhitespace(c);",
"isWhitespace(c)",
"isWhitespace",
"c",
"int c",
"c",
"public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isWhitespace",
"{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void printLine(long i) {\n writer.println(i);\n }\n\n }",
"OutputWriter",
"private final PrintWriter writer;",
"writer",
"public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }",
"OutputWriter",
"{\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }",
"writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"writer",
"new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"OutputStream outputStream",
"outputStream",
"public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }",
"OutputWriter",
"{\n this.writer = new PrintWriter(writer);\n }",
"this.writer = new PrintWriter(writer)",
"this.writer",
"this",
"this.writer",
"new PrintWriter(writer)",
"Writer writer",
"writer",
"public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }",
"print",
"{\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }",
"for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < objects.length",
"i",
"objects.length",
"objects",
"objects.length",
"i++",
"i++",
"i",
"{\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }",
"{\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }",
"if (i != 0) {\n writer.print(' ');\n }",
"i != 0",
"i",
"0",
"{\n writer.print(' ');\n }",
"writer.print(' ')",
"writer.print",
"writer",
"' '",
"writer.print(objects[i])",
"writer.print",
"writer",
"objects[i]",
"objects",
"i",
"Object... objects",
"objects",
"public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }",
"printLine",
"{\n print(objects);\n writer.println();\n }",
"print(objects)",
"print",
"objects",
"writer.println()",
"writer.println",
"writer",
"Object... objects",
"objects",
"public void close() {\n writer.close();\n }",
"close",
"{\n writer.close();\n }",
"writer.close()",
"writer.close",
"writer",
"public void printLine(long i) {\n writer.println(i);\n }",
"printLine",
"{\n writer.println(i);\n }",
"writer.println(i)",
"writer.println",
"writer",
"i",
"long i",
"i",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void printLine(long i) {\n writer.println(i);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n OutputWriter out = new OutputWriter(outputStream);\n BMultiplication2 solver = new BMultiplication2();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMultiplication2 {\n public void solve(int testNumber, InputReader c, OutputWriter w) {\n int n = c.readInt();\n long[] a = c.readLongArray(n);\n\n long res = 1;\n for (long kk : a) {\n if (kk == 0) {\n w.printLine(\"0\");\n return;\n }\n if (res == -1) {\n continue;\n }\n// \t\ttr((long)2e18/kk, res);\n if (res > 2e18 / kk) {\n res = -1;\n } else {\n res = res * kk;\n if (res > (long) 1e18) {\n res = -1;\n }\n }\n\n }\n\n w.printLine(res);\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public long[] readLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = readLong();\n }\n return array;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if (i != 0) {\n writer.print(' ');\n }\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void printLine(long i) {\n writer.println(i);\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author New User
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
OutputWriter out = new OutputWriter(outputStream);
BMultiplication2 solver = new BMultiplication2();
solver.solve(1, in, out);
out.close();
}
static class BMultiplication2 {
public void solve(int testNumber, InputReader c, OutputWriter w) {
int n = c.readInt();
long[] a = c.readLongArray(n);
long res = 1;
for (long kk : a) {
if (kk == 0) {
w.printLine("0");
return;
}
if (res == -1) {
continue;
}
// tr((long)2e18/kk, res);
if (res > 2e18 / kk) {
res = -1;
} else {
res = res * kk;
if (res > (long) 1e18) {
res = -1;
}
}
}
w.printLine(res);
}
}
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private InputReader.SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public long[] readLongArray(int size) {
long[] array = new long[size];
for (int i = 0; i < size; i++) {
array[i] = readLong();
}
return array;
}
public int read() {
if (numChars == -1) {
throw new InputMismatchException();
}
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0) {
return -1;
}
}
return buf[curChar++];
}
public int readInt() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public long readLong() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
long res = 0;
do {
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public boolean isSpaceChar(int c) {
if (filter != null) {
return filter.isSpaceChar(c);
}
return isWhitespace(c);
}
public static boolean isWhitespace(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
static class OutputWriter {
private final PrintWriter writer;
public OutputWriter(OutputStream outputStream) {
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
}
public OutputWriter(Writer writer) {
this.writer = new PrintWriter(writer);
}
public void print(Object... objects) {
for (int i = 0; i < objects.length; i++) {
if (i != 0) {
writer.print(' ');
}
writer.print(objects[i]);
}
}
public void printLine(Object... objects) {
print(objects);
writer.println();
}
public void close() {
writer.close();
}
public void printLine(long i) {
writer.println(i);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
3,
14,
2,
13,
17,
30,
0,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
4,
18,
13,
13,
4,
18,
13,
18,
13,
13,
17,
2,
2,
13,
18,
13,
13,
17,
30,
0,
13,
40,
17,
3,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
129,
11
],
[
129,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
14,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
53,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
14,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
88,
100
],
[
87,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
101,
107
],
[
86,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
108,
113
],
[
86,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
14,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
12,
126
],
[
126,
127
],
[
0,
128
],
[
128,
129
],
[
128,
130
]
] |
[
"import java.util.*;\nimport javax.lang.model.util.ElementScanner6;\nimport java.lang.Math;\n\npublic class Main {\n\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n } \n}",
"import java.util.*;",
"util.*",
"java",
"import javax.lang.model.util.ElementScanner6;",
"ElementScanner6",
"javax.lang.model.util",
"import java.lang.Math;",
"Math",
"java.lang",
"public class Main {\n\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n } \n}",
"Main",
"public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n }",
"main",
"{\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n }",
"final Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long out = 1;",
"out",
"1",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"boolean zeroflg = false;",
"zeroflg",
"false",
"for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }",
"{\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a[i] == 0){\n zeroflg = true;\n break;\n }",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n zeroflg = true;\n break;\n }",
"zeroflg = true",
"zeroflg",
"true",
"break;",
"if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }",
"zeroflg == true",
"zeroflg",
"true",
"{\n out = 0;\n }",
"out = 0",
"out",
"0",
"{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }",
"for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }",
"{\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }",
"if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }",
"Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L",
"Math.log10(out) + Math.log10(a[i]) > 18",
"Math.log10(out) + Math.log10(a[i])",
"Math.log10(out)",
"Math.log10",
"Math",
"out",
"Math.log10(a[i])",
"Math.log10",
"Math",
"a[i]",
"a",
"i",
"18",
"out * a[i] > 1000000000000000000L",
"out * a[i]",
"out",
"a[i]",
"a",
"i",
"1000000000000000000L",
"{\n out = -1;\n break;\n }",
"out = -1",
"out",
"-1",
"1",
"break;",
"{; \n out *= a[i];\n }",
"out *= a[i]",
"out",
"a[i]",
"a",
"i",
"System.out.println(out)",
"System.out.println",
"System.out",
"System",
"System.out",
"out",
"final String[] args",
"args",
"public class Main {\n\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n } \n}",
"public class Main {\n\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n\n // 入力\n //String t = sc.next();\n int n = sc.nextInt();\n\n // \n long out = 1;\n long[] a = new long[n];\n boolean zeroflg = false;\n for(int i = 0; i < n; i++){\n a[i] = sc.nextLong();\n if (a[i] == 0){\n zeroflg = true;\n break;\n }\n }\n if(zeroflg == true){\n out = 0;\n } else{\n for(int i = 0; i < n; i++){\n if(Math.log10(out) + Math.log10(a[i]) > 18 ||\n out * a[i] > 1000000000000000000L ){\n out = -1;\n break;\n } else {; \n out *= a[i];\n }\n }\n }\n\n // 出力\n System.out.println(out);\n } \n}",
"Main"
] |
import java.util.*;
import javax.lang.model.util.ElementScanner6;
import java.lang.Math;
public class Main {
public static void main(final String[] args) {
final Scanner sc = new Scanner(System.in);
// 入力
//String t = sc.next();
int n = sc.nextInt();
//
long out = 1;
long[] a = new long[n];
boolean zeroflg = false;
for(int i = 0; i < n; i++){
a[i] = sc.nextLong();
if (a[i] == 0){
zeroflg = true;
break;
}
}
if(zeroflg == true){
out = 0;
} else{
for(int i = 0; i < n; i++){
if(Math.log10(out) + Math.log10(a[i]) > 18 ||
out * a[i] > 1000000000000000000L ){
out = -1;
break;
} else {;
out *= a[i];
}
}
}
// 出力
System.out.println(out);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
17,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
0,
13,
17,
3,
14,
2,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
4,
18,
13,
13,
17,
30,
0,
13,
17,
3,
14,
13,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
160,
11
],
[
160,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
14,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
35,
39
],
[
14,
40
],
[
40,
41
],
[
40,
42
],
[
14,
43
],
[
43,
44
],
[
43,
45
],
[
14,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
14,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
14,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
95,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
107,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
120,
128
],
[
119,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
94,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
134,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
90,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
12,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] |
[
"import java.io.FileNotFoundException;\nimport java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) throws FileNotFoundException {\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }\n}",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) throws FileNotFoundException {\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }\n}",
"Main",
"public static void main(String[] args) throws FileNotFoundException {\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }",
"main",
"{\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[N];",
"A",
"new long[N]",
"N",
"BigInteger times = BigInteger.valueOf(1);",
"times",
"BigInteger.valueOf(1)",
"BigInteger.valueOf",
"BigInteger",
"1",
"long K = (long) Math.pow(10,18);",
"K",
"(long) Math.pow(10,18)",
"Math.pow",
"Math",
"10",
"18",
"boolean flg = true;",
"flg",
"true",
"boolean haszero = false;",
"haszero",
"false",
"for(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n \t\tA[i]=sc.nextLong();\n \t}",
"{\n \t\tA[i]=sc.nextLong();\n \t}",
"A[i]=sc.nextLong()",
"A[i]",
"A",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"for(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}",
"{\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}",
"if(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}",
"A[i]==0",
"A[i]",
"A",
"i",
"0",
"{\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}",
"haszero = true",
"haszero",
"true",
"break;",
"if(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}",
"haszero==false",
"haszero",
"false",
"{\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t}",
"for(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}",
"{\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}",
"times = times.multiply(BigInteger.valueOf(A[i]))",
"times",
"times.multiply(BigInteger.valueOf(A[i]))",
"times.multiply",
"times",
"BigInteger.valueOf(A[i])",
"BigInteger.valueOf",
"BigInteger",
"A[i]",
"A",
"i",
"if(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}",
"times.compareTo(BigInteger.valueOf(K))==1",
"times.compareTo(BigInteger.valueOf(K))",
"times.compareTo",
"times",
"BigInteger.valueOf(K)",
"BigInteger.valueOf",
"BigInteger",
"K",
"1",
"{\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}",
"flg = false",
"flg",
"false",
"break;",
"if(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}",
"flg",
"{\n \t\tSystem.out.println(times);\n \t}",
"System.out.println(times)",
"System.out.println",
"System.out",
"System",
"System.out",
"times",
"{\n \t\tSystem.out.println(\"-1\");\n \t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n \t\tSystem.out.println(\"0\");\n \t}",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws FileNotFoundException {\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }\n}",
"public class Main {\n public static void main(String[] args) throws FileNotFoundException {\n\n// \tFile file = new File(\"src/in.txt\");\n\n //コード\n// \tScanner sc = new Scanner(file);\n \tScanner sc = new Scanner(System.in);\n\n \tint N = sc.nextInt();\n\n \tlong[] A = new long[N];\n\n \tBigInteger times = BigInteger.valueOf(1);\n \tlong K = (long) Math.pow(10,18);\n\n \tboolean flg = true;\n \tboolean haszero = false;\n\n \tfor(int i=0;i<N;i++) {\n \t\tA[i]=sc.nextLong();\n \t}\n\n \tfor(int i=0;i<N;i++) {\n \t\tif(A[i]==0) {\n \t\t\thaszero = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(haszero==false) {\n\n \tfor(int i=0;i<N;i++) {\n \t\ttimes = times.multiply(BigInteger.valueOf(A[i]));\n\n \t\tif(times.compareTo(BigInteger.valueOf(K))==1) {\n \t\t\tflg = false;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \tif(flg) {\n \t\tSystem.out.println(times);\n \t} else {\n \t\tSystem.out.println(\"-1\");\n \t}\n\n \t} else {\n \t\tSystem.out.println(\"0\");\n \t}\n }\n}",
"Main"
] |
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
// File file = new File("src/in.txt");
//コード
// Scanner sc = new Scanner(file);
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[] A = new long[N];
BigInteger times = BigInteger.valueOf(1);
long K = (long) Math.pow(10,18);
boolean flg = true;
boolean haszero = false;
for(int i=0;i<N;i++) {
A[i]=sc.nextLong();
}
for(int i=0;i<N;i++) {
if(A[i]==0) {
haszero = true;
break;
}
}
if(haszero==false) {
for(int i=0;i<N;i++) {
times = times.multiply(BigInteger.valueOf(A[i]));
if(times.compareTo(BigInteger.valueOf(K))==1) {
flg = false;
break;
}
}
if(flg) {
System.out.println(times);
} else {
System.out.println("-1");
}
} else {
System.out.println("0");
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
18,
13,
13,
30,
4,
18,
13,
40,
17,
29,
0,
13,
18,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
124,
11
],
[
124,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
17,
19
],
[
15,
20
],
[
20,
21
],
[
20,
22
],
[
12,
23
],
[
23,
24
],
[
124,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
27,
36
],
[
36,
37
],
[
36,
38
],
[
27,
39
],
[
39,
40
],
[
39,
41
],
[
27,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
45,
49
],
[
27,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
76,
81
],
[
27,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
103,
109
],
[
94,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
27,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
25,
119
],
[
119,
120
],
[
25,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] |
[
"import java.io.InputStream;\nimport java.io.PrintStream;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }\n}",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintStream;",
"PrintStream",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }",
"main",
"{\n solve(System.in, System.out);\n }",
"solve(System.in, System.out)",
"solve",
"System.in",
"System",
"System.in",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }",
"solve",
"{\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }",
"Scanner scan = new Scanner(is);",
"scan",
"new Scanner(is)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long ans = 1;",
"ans",
"1",
"long A[] = new long[N];",
"A",
"new long[N]",
"N",
"long max = (long)Math.pow(10, 18);",
"max",
"(long)Math.pow(10, 18)",
"Math.pow",
"Math",
"10",
"18",
"for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }",
"{\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }",
"A[i] = scan.nextLong()",
"A[i]",
"A",
"i",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(A[i] == 0) {\n os.println(0);\n return;\n }",
"A[i] == 0",
"A[i]",
"A",
"i",
"0",
"{\n os.println(0);\n return;\n }",
"os.println(0)",
"os.println",
"os",
"0",
"return;",
"for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }",
"{\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }",
"if(ans > max/A[i]) {\n os.println(-1);\n return;\n }",
"ans > max/A[i]",
"ans",
"max/A[i]",
"max",
"A[i]",
"A",
"i",
"{\n os.println(-1);\n return;\n }",
"os.println(-1)",
"os.println",
"os",
"-1",
"1",
"return;",
"ans *= A[i]",
"ans",
"A[i]",
"A",
"i",
"os.println(ans)",
"os.println",
"os",
"ans",
"InputStream is",
"is",
"PrintStream os",
"os",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n long ans = 1;\n long A[] = new long[N];\n long max = (long)Math.pow(10, 18);\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextLong();\n if(A[i] == 0) {\n os.println(0);\n return;\n }\n }\n\n for(int i = 0; i < N; i++) {\n if(ans > max/A[i]) {\n os.println(-1);\n return;\n }\n ans *= A[i];\n }\n os.println(ans);\n\n }\n}",
"Main"
] |
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
solve(System.in, System.out);
}
static void solve(InputStream is, PrintStream os) {
// Your code here!
Scanner scan = new Scanner(is);
int N = scan.nextInt();
long ans = 1;
long A[] = new long[N];
long max = (long)Math.pow(10, 18);
for(int i = 0; i < N; i++) {
A[i] = scan.nextLong();
if(A[i] == 0) {
os.println(0);
return;
}
}
for(int i = 0; i < N; i++) {
if(ans > max/A[i]) {
os.println(-1);
return;
}
ans *= A[i];
}
os.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
2,
17,
13,
30,
0,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
47,
54
],
[
8,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
73,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
87,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}",
"a[i] = scan.nextLong()",
"a[i]",
"a",
"i",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}",
"System.out.print(0)",
"System.out.print",
"System.out",
"System",
"System.out",
"0",
"return;\t\t\t\t\t//プログラム終了",
"long ans = a[0];",
"ans",
"a[0]",
"a",
"0",
"for(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"if(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}",
"a[i] <= (1000000000000000000L / ans)",
"a[i]",
"a",
"i",
"(1000000000000000000L / ans)",
"1000000000000000000L",
"ans",
"{\n\t\t\t\tans *= a[i];\n\t\t\t}",
"ans *= a[i]",
"ans",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.print(ans)",
"System.out.print",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n = scan.nextInt();\n\t\tlong[] a = new long[n];\n\n\t\tfor (int i = 0; i < n ; i++) {\n\t\t\ta[i] = scan.nextLong();\n\t\t\tif(a[i] == 0) {\t\t\t\t//入力された数値が0なら\"0\"を出力\n\t\t\t\tSystem.out.print(0);\n\t\t\t\treturn;\t\t\t\t\t//プログラム終了\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong ans = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i] <= (1000000000000000000L / ans)) {\n\t\t\t\tans *= a[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(ans);\n\t\t\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
long[] a = new long[n];
for (int i = 0; i < n ; i++) {
a[i] = scan.nextLong();
if(a[i] == 0) { //入力された数値が0なら"0"を出力
System.out.print(0);
return; //プログラム終了
}
}
long ans = a[0];
for(int i = 1; i < n; i++) {
if(a[i] <= (1000000000000000000L / ans)) {
ans *= a[i];
}
else {
System.out.print(-1);
return;
}
}
System.out.print(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
29,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
18,
13,
13,
30,
4,
18,
18,
13,
13,
17,
29,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
56,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
85,
92
],
[
76,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
76,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
6,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long a[] = new long[n];",
"a",
"new long[n]",
"n",
"long sum = 1;",
"sum",
"1",
"boolean ch = false;",
"ch",
"false",
"long max = 1000000000000000000l;",
"max",
"1000000000000000000l",
"for(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"a[i] = sc.nextLong()",
"a[i]",
"a",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}",
"a[i] == 0",
"a[i]",
"a",
"i",
"0",
"{\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(\"0\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"0\"",
"return;",
"for(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}",
"{\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}",
"if(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}",
"max/sum < a[i]",
"max/sum",
"max",
"sum",
"a[i]",
"a",
"i",
"{\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"return;",
"sum *= a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}",
"sum > max",
"sum",
"max",
"{\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong a[] = new long[n];\n\t\tlong sum = 1;\n\t\tboolean ch = false;\n\t\tlong max = 1000000000000000000l;\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t\tif(a[i] == 0) {\n\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tif(max/sum < a[i]) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsum *= a[i];\n\t\t\tif(sum > max) {\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long a[] = new long[n];
long sum = 1;
boolean ch = false;
long max = 1000000000000000000l;
for(int i = 0; i < n; i++) {
a[i] = sc.nextLong();
if(a[i] == 0) {
System.out.println("0");
return;
}
}
for(int i = 0; i < n; i++) {
if(max/sum < a[i]) {
System.out.println("-1");
return;
}
sum *= a[i];
if(sum > max) {
System.out.println("-1");
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
2,
13,
17,
17,
4,
18,
18,
13,
13,
2,
2,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
42,
5
],
[
42,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
6,
39
],
[
39,
40
],
[
0,
41
],
[
41,
42
],
[
41,
43
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"double b = scan.nextDouble();",
"b",
"scan.nextDouble()",
"scan.nextDouble",
"scan",
"long ib = (long)(b*100+0.5);",
"ib",
"(long)(b*100+0.5)",
"b*100",
"b",
"100",
"0.5",
"System.out.print((a*ib)/100)",
"System.out.print",
"System.out",
"System",
"System.out",
"(a*ib)/100",
"(a*ib)",
"a",
"ib",
"100",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tdouble b = scan.nextDouble();\n\t\tlong ib = (long)(b*100+0.5);\n\t\tSystem.out.print((a*ib)/100);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
long a = scan.nextLong();
double b = scan.nextDouble();
long ib = (long)(b*100+0.5);
System.out.print((a*ib)/100);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
2,
13,
2,
2,
2,
2,
4,
18,
13,
17,
17,
17,
2,
2,
4,
18,
13,
17,
17,
17,
2,
4,
18,
13,
17,
17,
17,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
131,
17
],
[
131,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
42,
47
],
[
41,
48
],
[
40,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
49,
56
],
[
39,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
57,
62
],
[
36,
63
],
[
20,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
18,
70
],
[
70,
71
],
[
131,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
72,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
72,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
87,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
97,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
86,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
72,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
72,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
0,
130
],
[
130,
131
],
[
130,
132
]
] |
[
"import java.io.BufferedReader; \nimport java.io.InputStreamReader; \nimport java.io.IOException; \nimport java.util.StringTokenizer; \nimport java.util.Arrays;\npublic class Main {\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt()\n {\n return Integer.parseInt(next());\n }\n long nextLong()\n {\n return Long.parseLong(next());\n }\n }\n public static void main(String args[]) throws IOException\n {\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt()\n {\n return Integer.parseInt(next());\n }\n long nextLong()\n {\n return Long.parseLong(next());\n }\n }\n public static void main(String args[]) throws IOException\n {\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }\n\n}",
"Main",
"public static void main(String args[]) throws IOException\n {\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }",
"main",
"{\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }",
"FastReader fs= new FastReader();",
"fs",
"new FastReader()",
"long A= fs.nextLong();",
"A",
"fs.nextLong()",
"fs.nextLong",
"fs",
"String B=fs.next();",
"B",
"fs.next()",
"fs.next",
"fs",
"long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;",
"res",
"(A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100",
"(A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))",
"A",
"(((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0'))",
"((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')",
"((B.charAt(0)-'0')*100)",
"(B.charAt(0)-'0')",
"B.charAt(0)",
"B.charAt",
"B",
"0",
"'0'",
"100",
"((B.charAt(2)-'0')*10)",
"(B.charAt(2)-'0')",
"B.charAt(2)",
"B.charAt",
"B",
"2",
"'0'",
"10",
"(B.charAt(3)-'0')",
"B.charAt(3)",
"B.charAt",
"B",
"3",
"'0'",
"100",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String args[]",
"args",
"static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt()\n {\n return Integer.parseInt(next());\n }\n long nextLong()\n {\n return Long.parseLong(next());\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br=new BufferedReader(new InputStreamReader(System.in));\n }",
"br=new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }",
"st==null ||!st.hasMoreElements()",
"st==null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }",
"try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }",
"catch(IOException e)\n {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st= new StringTokenizer(br.readLine());\n }",
"st= new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt()\n {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong()\n {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt()\n {\n return Integer.parseInt(next());\n }\n long nextLong()\n {\n return Long.parseLong(next());\n }\n }\n public static void main(String args[]) throws IOException\n {\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }\n\n}",
"public class Main {\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader()\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n String next()\n {\n while(st==null ||!st.hasMoreElements())\n {\n try\n {\n st= new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt()\n {\n return Integer.parseInt(next());\n }\n long nextLong()\n {\n return Long.parseLong(next());\n }\n }\n public static void main(String args[]) throws IOException\n {\n FastReader fs= new FastReader();\n long A= fs.nextLong();\n String B=fs.next();\n long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;\n System.out.println(res);\n }\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.Arrays;
public class Main {
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br=new BufferedReader(new InputStreamReader(System.in));
}
String next()
{
while(st==null ||!st.hasMoreElements())
{
try
{
st= new StringTokenizer(br.readLine());
}
catch(IOException e)
{
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt()
{
return Integer.parseInt(next());
}
long nextLong()
{
return Long.parseLong(next());
}
}
public static void main(String args[]) throws IOException
{
FastReader fs= new FastReader();
long A= fs.nextLong();
String B=fs.next();
long res= (A* (((B.charAt(0)-'0')*100) +((B.charAt(2)-'0')*10) + (B.charAt(3)-'0')))/100;
System.out.println(res);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
17,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
49,
8
],
[
49,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
36,
42
],
[
36,
43
],
[
43,
44
],
[
43,
45
],
[
9,
46
],
[
46,
47
],
[
0,
48
],
[
48,
49
],
[
48,
50
]
] |
[
"import java.util.*;\nimport java.math.*;\npublic class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String sa = sc.next();",
"sa",
"sc.next()",
"sc.next",
"sc",
"String sb = sc.next();",
"sb",
"sc.next()",
"sc.next",
"sc",
"BigDecimal A = new BigDecimal(sa);",
"A",
"new BigDecimal(sa)",
"BigDecimal B = new BigDecimal(sb);",
"B",
"new BigDecimal(sb)",
"System.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN))",
"System.out.println",
"System.out",
"System",
"System.out",
"A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN)",
"A.multiply(B).setScale",
"A.multiply(B)",
"A.multiply",
"A",
"B",
"0",
"BigDecimal.ROUND_DOWN",
"BigDecimal",
"BigDecimal.ROUND_DOWN",
"String args[]",
"args",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}\n}",
"public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString sa = sc.next();\n\t\tString sb = sc.next();\n\t\tBigDecimal A = new BigDecimal(sa);\n\t\tBigDecimal B = new BigDecimal(sb);\n\t\tSystem.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));\n\t}\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String sa = sc.next();
String sb = sc.next();
BigDecimal A = new BigDecimal(sa);
BigDecimal B = new BigDecimal(sb);
System.out.println(A.multiply(B).setScale(0, BigDecimal.ROUND_DOWN));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
48,
14
],
[
48,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
17,
31
],
[
31,
32
],
[
32,
33
],
[
17,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
15,
45
],
[
45,
46
],
[
0,
47
],
[
47,
48
],
[
47,
49
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.math.BigDecimal;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }",
"main",
"{\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }",
"Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));",
"sc",
"new Scanner(new BufferedReader(new InputStreamReader(System.in)))",
"BigDecimal A = sc.nextBigDecimal();",
"A",
"sc.nextBigDecimal()",
"sc.nextBigDecimal",
"sc",
"BigDecimal B = sc.nextBigDecimal();",
"B",
"sc.nextBigDecimal()",
"sc.nextBigDecimal",
"sc",
"sc.close()",
"sc.close",
"sc",
"System.out.println(A.multiply(B).toBigInteger())",
"System.out.println",
"System.out",
"System",
"System.out",
"A.multiply(B).toBigInteger()",
"A.multiply(B).toBigInteger",
"A.multiply(B)",
"A.multiply",
"A",
"B",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n sc.close();\n System.out.println(A.multiply(B).toBigInteger());\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
BigDecimal A = sc.nextBigDecimal();
BigDecimal B = sc.nextBigDecimal();
sc.close();
System.out.println(A.multiply(B).toBigInteger());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
47,
11
],
[
47,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
31,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
14,
41
],
[
41,
42
],
[
42,
43
],
[
12,
44
],
[
44,
45
],
[
0,
46
],
[
46,
47
],
[
46,
48
]
] |
[
"import java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}\n\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"BigDecimal a = new BigDecimal(sc.next());",
"a",
"new BigDecimal(sc.next())",
"BigDecimal b = new BigDecimal(sc.next());",
"b",
"new BigDecimal(sc.next())",
"System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"a.multiply(b).setScale(0, RoundingMode.DOWN).toString()",
"a.multiply(b).setScale(0, RoundingMode.DOWN).toString",
"a.multiply(b).setScale(0, RoundingMode.DOWN)",
"a.multiply(b).setScale",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"0",
"RoundingMode.DOWN",
"RoundingMode",
"RoundingMode.DOWN",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tBigDecimal a = new BigDecimal(sc.next());\n\t\tBigDecimal b = new BigDecimal(sc.next());\n\n\t\tSystem.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());\n\n\t\tsc.close();\n\n\t}\n\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigDecimal a = new BigDecimal(sc.next());
BigDecimal b = new BigDecimal(sc.next());
System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toString());
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
2,
13,
17,
41,
13,
2,
2,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
46,
5
],
[
46,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
6,
43
],
[
43,
44
],
[
0,
45
],
[
45,
46
],
[
45,
47
]
] |
[
"import java.util.Scanner;\n\n/*\n\n*/\n\npublic class Main {\n public static void main(String[] args){\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }\n}",
"Main",
"public static void main(String[] args){\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double b = sc.nextDouble();",
"b",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"long bb = Math.round(b * 100);",
"bb",
"Math.round(b * 100)",
"Math.round",
"Math",
"b * 100",
"b",
"100",
"long ans = a * bb / 100;",
"ans",
"a * bb / 100",
"a * bb",
"a",
"bb",
"100",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }\n}",
"public class Main {\n public static void main(String[] args){\n\n Scanner sc = new Scanner(System.in);\n long a = sc.nextLong();\n double b = sc.nextDouble();\n long bb = Math.round(b * 100);\n// System.out.println(b * 100);\n// System.out.println(Math.floor(b * 100));\n long ans = a * bb / 100;\n\n System.out.println(ans);\n\n }\n}",
"Main"
] |
import java.util.Scanner;
/*
*/
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
double b = sc.nextDouble();
long bb = Math.round(b * 100);
// System.out.println(b * 100);
// System.out.println(Math.floor(b * 100));
long ans = a * bb / 100;
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
17,
41,
13,
20,
41,
13,
4,
18,
20,
4,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
13,
4,
18,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
17,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
66,
11
],
[
66,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
20,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
14,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
14,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
12,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] line = sc.nextLine().split(\" \", 0);",
"line",
"sc.nextLine().split(\" \", 0)",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"0",
"BigDecimal a = new BigDecimal(line[0]);",
"a",
"new BigDecimal(line[0])",
"BigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));",
"b",
"new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100))",
"new BigDecimal(line[1]).multiply",
"new BigDecimal(line[1])",
"BigDecimal.valueOf(100)",
"BigDecimal.valueOf",
"BigDecimal",
"100",
"BigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));",
"ans",
"a.multiply(b).divide(BigDecimal.valueOf(100))",
"a.multiply(b).divide",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"BigDecimal.valueOf(100)",
"BigDecimal.valueOf",
"BigDecimal",
"100",
"System.out.println(ans.setScale(0, RoundingMode.DOWN))",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.setScale(0, RoundingMode.DOWN)",
"ans.setScale",
"ans",
"0",
"RoundingMode.DOWN",
"RoundingMode",
"RoundingMode.DOWN",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] line = sc.nextLine().split(\" \", 0);\n\n\t\tBigDecimal a = new BigDecimal(line[0]);\n\t\tBigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));\n\t\tBigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));\n\n\t\tSystem.out.println(ans.setScale(0, RoundingMode.DOWN));\n\t}\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] line = sc.nextLine().split(" ", 0);
BigDecimal a = new BigDecimal(line[0]);
BigDecimal b = new BigDecimal(line[1]).multiply(BigDecimal.valueOf(100));
BigDecimal ans = a.multiply(b).divide(BigDecimal.valueOf(100));
System.out.println(ans.setScale(0, RoundingMode.DOWN));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
20,
41,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
29,
13,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
34,
35
],
[
34,
36
],
[
0,
37
],
[
37,
38
],
[
37,
39
],
[
0,
40
],
[
373,
41
],
[
373,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
44,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
44,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
44,
64
],
[
64,
65
],
[
64,
66
],
[
44,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
44,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
79,
80
],
[
42,
81
],
[
81,
82
],
[
373,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
91,
101
],
[
101,
102
],
[
102,
103
],
[
91,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
85,
118
],
[
118,
119
],
[
83,
120
],
[
120,
121
],
[
0,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
122,
129
],
[
129,
130
],
[
129,
131
],
[
122,
133
],
[
133,
134
],
[
133,
135
],
[
122,
136
],
[
136,
137
],
[
136,
138
],
[
122,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
142,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
153,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
149,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
141,
174
],
[
174,
175
],
[
122,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
179,
187
],
[
187,
188
],
[
188,
189
],
[
122,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
198,
200
],
[
190,
201
],
[
201,
202
],
[
122,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
207,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
213,
215
],
[
206,
216
],
[
216,
217
],
[
205,
218
],
[
218,
219
],
[
219,
220
],
[
122,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
224,
228
],
[
228,
229
],
[
223,
230
],
[
230,
231
],
[
230,
232
],
[
223,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
223,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
237,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
242,
245
],
[
241,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
223,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
122,
254
],
[
254,
255
],
[
254,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
257,
261
],
[
261,
262
],
[
256,
263
],
[
263,
264
],
[
263,
265
],
[
256,
266
],
[
266,
267
],
[
266,
268
],
[
256,
269
],
[
269,
270
],
[
269,
271
],
[
271,
272
],
[
256,
273
],
[
273,
274
],
[
274,
275
],
[
274,
276
],
[
273,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
256,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
286,
290
],
[
290,
291
],
[
290,
292
],
[
285,
293
],
[
293,
294
],
[
294,
295
],
[
256,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
300,
304
],
[
304,
305
],
[
304,
306
],
[
299,
307
],
[
307,
308
],
[
308,
309
],
[
308,
310
],
[
307,
311
],
[
311,
312
],
[
311,
313
],
[
313,
314
],
[
313,
315
],
[
299,
316
],
[
316,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
320,
321
],
[
317,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
316,
326
],
[
326,
327
],
[
327,
328
],
[
328,
329
],
[
328,
330
],
[
330,
331
],
[
328,
332
],
[
316,
333
],
[
333,
334
],
[
334,
335
],
[
298,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
122,
340
],
[
340,
341
],
[
340,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
345,
346
],
[
342,
347
],
[
347,
348
],
[
348,
349
],
[
349,
350
],
[
349,
351
],
[
351,
352
],
[
351,
353
],
[
348,
354
],
[
354,
355
],
[
354,
356
],
[
356,
357
],
[
356,
358
],
[
347,
359
],
[
359,
360
],
[
342,
361
],
[
361,
362
],
[
122,
363
],
[
363,
364
],
[
363,
365
],
[
365,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
367,
370
],
[
370,
371
],
[
0,
372
],
[
372,
373
],
[
372,
374
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.NoSuchElementException;\nimport java.util.PriorityQueue;\nimport java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.HashSet;\nimport java.math.BigDecimal;\n\npublic class Main {\n public static void main(String[] args) {\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }\n public static int calcMin(int[] array) {\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}\n}\nclass FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte(){\n if(ptr < buflen){\n return true;\n }else{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }\n return true;\n }\n\n private int readByte(){\n if(hasNextByte())return buffer[ptr++];\n else return -1;\n }\n\n private static boolean isPrintableChar(int c){\n return 33<=c && c<=126;\n }\n public boolean hasNext(){\n while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;\n return hasNextByte();\n }\n\n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)){\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public long nextLong(){\n if(!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if(b == '-'){\n minus = true;\n b = readByte();\n }\n if(b < '0' || '9' < b){\n throw new NumberFormatException();\n }\n while(true){\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt(){\n long nl = nextLong();\n if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDoutble(){return Double.parseDouble(next());}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Comparator;",
"Comparator",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Queue;",
"Queue",
"java.util",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main {\n public static void main(String[] args) {\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }\n public static int calcMin(int[] array) {\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}\n}",
"Main",
"public static void main(String[] args) {\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }",
"main",
"{\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }",
"FastScanner fs = new FastScanner();",
"fs",
"new FastScanner()",
"long a = fs.nextLong();",
"a",
"fs.nextLong()",
"fs.nextLong",
"fs",
"double b = fs.nextDoutble();",
"b",
"fs.nextDoutble()",
"fs.nextDoutble",
"fs",
"BigDecimal b1 = BigDecimal.valueOf(a);",
"b1",
"BigDecimal.valueOf(a)",
"BigDecimal.valueOf",
"BigDecimal",
"a",
"BigDecimal b2 = new BigDecimal(String.valueOf(b));",
"b2",
"new BigDecimal(String.valueOf(b))",
"BigDecimal t3 = (b1.multiply(b2));",
"t3",
"(b1.multiply(b2))",
"b1.multiply",
"b1",
"b2",
"System.out.println(t3.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"t3.longValue()",
"t3.longValue",
"t3",
"String[] args",
"args",
"public static int calcMin(int[] array) {\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}",
"calcMin",
"{\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}",
"int intMin = array[0];",
"intMin",
"array[0]",
"array",
"0",
"for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }",
"{\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }",
"if(intMin > array[i]) {\n intMin = array[i];\n }",
"intMin > array[i]",
"intMin",
"array[i]",
"array",
"i",
"{\n intMin = array[i];\n }",
"intMin = array[i]",
"intMin",
"array[i]",
"array",
"i",
"return intMin;",
"intMin",
"int[] array",
"array",
"class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte(){\n if(ptr < buflen){\n return true;\n }else{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }\n return true;\n }\n\n private int readByte(){\n if(hasNextByte())return buffer[ptr++];\n else return -1;\n }\n\n private static boolean isPrintableChar(int c){\n return 33<=c && c<=126;\n }\n public boolean hasNext(){\n while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;\n return hasNextByte();\n }\n\n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)){\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public long nextLong(){\n if(!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if(b == '-'){\n minus = true;\n b = readByte();\n }\n if(b < '0' || '9' < b){\n throw new NumberFormatException();\n }\n while(true){\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt(){\n long nl = nextLong();\n if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDoutble(){return Double.parseDouble(next());}\n}",
"FastScanner",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int ptr = 0;",
"ptr",
"0",
"private int buflen = 0;",
"buflen",
"0",
"private boolean hasNextByte(){\n if(ptr < buflen){\n return true;\n }else{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }\n return true;\n }",
"hasNextByte",
"{\n if(ptr < buflen){\n return true;\n }else{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }\n return true;\n }",
"if(ptr < buflen){\n return true;\n }else{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }",
"ptr < buflen",
"ptr",
"buflen",
"{\n return true;\n }",
"return true;",
"true",
"{\n ptr = 0;\n try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }\n if(buflen <=0){\n return false;\n }\n }",
"ptr = 0",
"ptr",
"0",
"try{\n buflen = in.read(buffer);\n }catch(IOException e){\n e.printStackTrace();\n }",
"catch(IOException e){\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n buflen = in.read(buffer);\n }",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if(buflen <=0){\n return false;\n }",
"buflen <=0",
"buflen",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"private int readByte(){\n if(hasNextByte())return buffer[ptr++];\n else return -1;\n }",
"readByte",
"{\n if(hasNextByte())return buffer[ptr++];\n else return -1;\n }",
"if(hasNextByte())return buffer[ptr++];\n else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"return -1;",
"-1",
"1",
"private static boolean isPrintableChar(int c){\n return 33<=c && c<=126;\n }",
"isPrintableChar",
"{\n return 33<=c && c<=126;\n }",
"return 33<=c && c<=126;",
"33<=c && c<=126",
"33<=c",
"33",
"c",
"c<=126",
"c",
"126",
"int c",
"c",
"public boolean hasNext(){\n while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;\n return hasNextByte();\n }",
"hasNext",
"{\n while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;\n return hasNextByte();\n }",
"while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"ptr++",
"ptr",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)){\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"next",
"{\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)){\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while(isPrintableChar(b)){\n sb.appendCodePoint(b);\n b = readByte();\n }",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n sb.appendCodePoint(b);\n b = readByte();\n }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public long nextLong(){\n if(!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if(b == '-'){\n minus = true;\n b = readByte();\n }\n if(b < '0' || '9' < b){\n throw new NumberFormatException();\n }\n while(true){\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"nextLong",
"{\n if(!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if(b == '-'){\n minus = true;\n b = readByte();\n }\n if(b < '0' || '9' < b){\n throw new NumberFormatException();\n }\n while(true){\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if(b == '-'){\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if(b < '0' || '9' < b){\n throw new NumberFormatException();\n }",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while(true){\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"true",
"{\n if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"if('0' <= b && b<='9'){\n n*=10;\n n+=b-'0';\n }else if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"'0' <= b && b<='9'",
"'0' <= b",
"'0'",
"b",
"b<='9'",
"b",
"'9'",
"{\n n*=10;\n n+=b-'0';\n }",
"n*=10",
"n",
"10",
"n+=b-'0'",
"n",
"b-'0'",
"b",
"'0'",
"if(b==-1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"b==-1 || !isPrintableChar(b)",
"b==-1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n return minus ? -n : n;\n }",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public int nextInt(){\n long nl = nextLong();\n if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();\n return (int) nl;\n }",
"nextInt",
"{\n long nl = nextLong();\n if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();\n return (int) nl;\n }",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"public double nextDoutble(){return Double.parseDouble(next());}",
"nextDoutble",
"{return Double.parseDouble(next());}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n public static void main(String[] args) {\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }\n public static int calcMin(int[] array) {\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}\n}",
"public class Main {\n public static void main(String[] args) {\n FastScanner fs = new FastScanner();\n long a = fs.nextLong();\n double b = fs.nextDoutble();\n \tBigDecimal b1 = BigDecimal.valueOf(a);\n\t BigDecimal b2 = new BigDecimal(String.valueOf(b));\n\t BigDecimal t3 = (b1.multiply(b2));\n System.out.println(t3.longValue()); \n\n \n }\n public static int calcMin(int[] array) {\n\n int intMin = array[0];\n\n for (int i = 1; i < array.length; i++ ) {\n if(intMin > array[i]) {\n intMin = array[i];\n }\n }\n return intMin;\n}\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.HashSet;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
FastScanner fs = new FastScanner();
long a = fs.nextLong();
double b = fs.nextDoutble();
BigDecimal b1 = BigDecimal.valueOf(a);
BigDecimal b2 = new BigDecimal(String.valueOf(b));
BigDecimal t3 = (b1.multiply(b2));
System.out.println(t3.longValue());
}
public static int calcMin(int[] array) {
int intMin = array[0];
for (int i = 1; i < array.length; i++ ) {
if(intMin > array[i]) {
intMin = array[i];
}
}
return intMin;
}
}
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte(){
if(ptr < buflen){
return true;
}else{
ptr = 0;
try{
buflen = in.read(buffer);
}catch(IOException e){
e.printStackTrace();
}
if(buflen <=0){
return false;
}
}
return true;
}
private int readByte(){
if(hasNextByte())return buffer[ptr++];
else return -1;
}
private static boolean isPrintableChar(int c){
return 33<=c && c<=126;
}
public boolean hasNext(){
while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;
return hasNextByte();
}
public String next(){
if(!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)){
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong(){
if(!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if(b == '-'){
minus = true;
b = readByte();
}
if(b < '0' || '9' < b){
throw new NumberFormatException();
}
while(true){
if('0' <= b && b<='9'){
n*=10;
n+=b-'0';
}else if(b==-1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt(){
long nl = nextLong();
if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();
return (int) nl;
}
public double nextDoutble(){return Double.parseDouble(next());}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
17,
41,
13,
2,
2,
4,
18,
13,
4,
18,
13,
17,
17,
13,
17,
41,
13,
2,
2,
4,
18,
13,
4,
18,
13,
17,
17,
13,
17,
41,
13,
2,
4,
18,
13,
4,
18,
13,
17,
17,
13,
41,
13,
2,
2,
13,
13,
13,
41,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
90,
5
],
[
90,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
24,
27
],
[
24,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
36,
40
],
[
32,
41
],
[
32,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
50,
54
],
[
46,
55
],
[
46,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
59,
68
],
[
8,
69
],
[
69,
70
],
[
69,
71
],
[
72,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
8,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
8,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
6,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
]
] |
[
"import java.util.Scanner;\n\n\npublic class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"String b = scan.next();",
"b",
"scan.next()",
"scan.next",
"scan",
"b = b.replace(\".\", \"\")",
"b",
"b.replace(\".\", \"\")",
"b.replace",
"b",
"\".\"",
"\"\"",
"long f = Long.parseLong(b.substring(0, 1)) * a * 100;",
"f",
"Long.parseLong(b.substring(0, 1)) * a * 100",
"Long.parseLong(b.substring(0, 1)) * a * 100",
"Long.parseLong(b.substring(0, 1))",
"Long.parseLong",
"Long",
"b.substring(0, 1)",
"b.substring",
"b",
"0",
"1",
"a",
"100",
"long s = Long.parseLong(b.substring(1, 2)) * a * 10;",
"s",
"Long.parseLong(b.substring(1, 2)) * a * 10",
"Long.parseLong(b.substring(1, 2)) * a * 10",
"Long.parseLong(b.substring(1, 2))",
"Long.parseLong",
"Long",
"b.substring(1, 2)",
"b.substring",
"b",
"1",
"2",
"a",
"10",
"long t = Long.parseLong(b.substring(2, 3)) * a;",
"t",
"Long.parseLong(b.substring(2, 3)) * a",
"Long.parseLong(b.substring(2, 3))",
"Long.parseLong",
"Long",
"b.substring(2, 3)",
"b.substring",
"b",
"2",
"3",
"a",
"long temp = f + s + t;",
"temp",
"f + s + t",
"f + s + t",
"f",
"s",
"t",
"long ans = (temp) /100;",
"ans",
"(temp) /100",
"(temp)",
"100",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\t\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong a = scan.nextLong();\n\t\tString b = scan.next();\n\t\tb = b.replace(\".\", \"\");\n\t\tlong f = Long.parseLong(b.substring(0, 1)) * a * 100;\n\t\tlong s = Long.parseLong(b.substring(1, 2)) * a * 10;\n\t\tlong t = Long.parseLong(b.substring(2, 3)) * a;\n\t\tlong temp = f + s + t; \n\t\t// seisuu\n\t\tlong ans = (temp) /100;\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main (String args[]) throws Exception{
Scanner scan = new Scanner(System.in);
long a = scan.nextLong();
String b = scan.next();
b = b.replace(".", "");
long f = Long.parseLong(b.substring(0, 1)) * a * 100;
long s = Long.parseLong(b.substring(1, 2)) * a * 10;
long t = Long.parseLong(b.substring(2, 3)) * a;
long temp = f + s + t;
// seisuu
long ans = (temp) /100;
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
17,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
57,
11
],
[
57,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
14,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
12,
54
],
[
54,
55
],
[
0,
56
],
[
56,
57
],
[
56,
58
]
] |
[
"import java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.*;\n\npublic class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }",
"main",
"{\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }",
"Scanner sn = new Scanner(System.in);",
"sn",
"new Scanner(System.in)",
"double A = sn.nextLong();",
"A",
"sn.nextLong()",
"sn.nextLong",
"sn",
"double B = sn.nextDouble();",
"B",
"sn.nextDouble()",
"sn.nextDouble",
"sn",
"BigDecimal bd1 = new BigDecimal(String.valueOf(A));",
"bd1",
"new BigDecimal(String.valueOf(A))",
"BigDecimal bd2 = new BigDecimal(String.valueOf(B));",
"bd2",
"new BigDecimal(String.valueOf(B))",
"BigDecimal result = bd1.multiply(bd2);",
"result",
"bd1.multiply(bd2)",
"bd1.multiply",
"bd1",
"bd2",
"System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString())",
"System.out.println",
"System.out",
"System",
"System.out",
"result.setScale(0, RoundingMode.DOWN).toPlainString()",
"result.setScale(0, RoundingMode.DOWN).toPlainString",
"result.setScale(0, RoundingMode.DOWN)",
"result.setScale",
"result",
"0",
"RoundingMode.DOWN",
"RoundingMode",
"RoundingMode.DOWN",
"String args[]",
"args",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }\n}",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n double A = sn.nextLong();\n double B = sn.nextDouble();\n\n BigDecimal bd1 = new BigDecimal(String.valueOf(A));\n BigDecimal bd2 = new BigDecimal(String.valueOf(B));\n\n BigDecimal result = bd1.multiply(bd2);\n \n System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sn = new Scanner(System.in);
double A = sn.nextLong();
double B = sn.nextDouble();
BigDecimal bd1 = new BigDecimal(String.valueOf(A));
BigDecimal bd2 = new BigDecimal(String.valueOf(B));
BigDecimal result = bd1.multiply(bd2);
System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
2,
17,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
17,
18,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
75,
26
],
[
75,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
27,
32
],
[
32,
33
],
[
75,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
37,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
49,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
64,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"import java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.math.RoundingMode;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }\n\n public static void abc169_c() {\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }\n\n public static void abc169_c() {\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }",
"main",
"{\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }",
"abc169_c()",
"abc169_c",
"String[] args",
"args",
"public static void abc169_c() {\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }",
"abc169_c",
"{\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }",
"try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }",
"catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }",
"Exception e",
"{\n System.out.println(\"エラー\" + e);\n }",
"System.out.println(\"エラー\" + e)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"エラー\" + e",
"\"エラー\"",
"e",
"{\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"BigDecimal a = new BigDecimal(sc.next());",
"a",
"new BigDecimal(sc.next())",
"BigDecimal b = new BigDecimal(sc.next());",
"b",
"new BigDecimal(sc.next())",
"System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN))",
"System.out.println",
"System.out",
"System",
"System.out",
"a.multiply(b).setScale(0, RoundingMode.DOWN)",
"a.multiply(b).setScale",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"0",
"RoundingMode.DOWN",
"RoundingMode",
"RoundingMode.DOWN",
"public class Main {\n\n public static void main(String[] args) {\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }\n\n public static void abc169_c() {\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n // printTestValue();\n // abc170_d();\n // abc169_b();\n abc169_c();\n }\n\n public static void abc169_c() {\n try (Scanner sc = new Scanner(System.in)) {\n BigDecimal a = new BigDecimal(sc.next());\n BigDecimal b = new BigDecimal(sc.next());\n\n System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));\n\n } catch (Exception e) {\n System.out.println(\"エラー\" + e);\n }\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// printTestValue();
// abc170_d();
// abc169_b();
abc169_c();
}
public static void abc169_c() {
try (Scanner sc = new Scanner(System.in)) {
BigDecimal a = new BigDecimal(sc.next());
BigDecimal b = new BigDecimal(sc.next());
System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));
} catch (Exception e) {
System.out.println("エラー" + e);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
51,
8
],
[
51,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
11,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
9,
48
],
[
48,
49
],
[
0,
50
],
[
50,
51
],
[
50,
52
]
] |
[
"import java.util.*;\nimport java.math.*;\n \npublic class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }",
"main",
"{\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long A = sc.nextLong();",
"A",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double B = sc.nextDouble();",
"B",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"BigDecimal bd_A = new BigDecimal(A);",
"bd_A",
"new BigDecimal(A)",
"BigDecimal bd_B = new BigDecimal(String.valueOf(B));",
"bd_B",
"new BigDecimal(String.valueOf(B))",
"BigDecimal bd_C = bd_A.multiply(bd_B);",
"bd_C",
"bd_A.multiply(bd_B)",
"bd_A.multiply",
"bd_A",
"bd_B",
"long l = bd_C.longValue();",
"l",
"bd_C.longValue()",
"bd_C.longValue",
"bd_C",
"System.out.println(l)",
"System.out.println",
"System.out",
"System",
"System.out",
"l",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner sc = new Scanner(System.in);\n \n long A = sc.nextLong();\n \n \tdouble B = sc.nextDouble();\n \t\t\n \tBigDecimal bd_A = new BigDecimal(A);\n \tBigDecimal bd_B = new BigDecimal(String.valueOf(B));\n\t\n \tBigDecimal bd_C = bd_A.multiply(bd_B);\n \n \tlong l = bd_C.longValue();\n\n \tSystem.out.println(l);\n \n\n }\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long A = sc.nextLong();
double B = sc.nextDouble();
BigDecimal bd_A = new BigDecimal(A);
BigDecimal bd_B = new BigDecimal(String.valueOf(B));
BigDecimal bd_C = bd_A.multiply(bd_B);
long l = bd_C.longValue();
System.out.println(l);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
17,
41,
13,
2,
13,
13,
4,
18,
13,
2,
2,
13,
2,
2,
2,
13,
17,
2,
13,
17,
17,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
72,
8
],
[
72,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
11,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
11,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
11,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
53,
65
],
[
11,
66
],
[
66,
67
],
[
67,
68
],
[
9,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\nimport java.io.*;\npublic class Main {\n \n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}\n \n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n \n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}\n \n}",
"Main",
"public static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}",
"main",
"{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}",
"int num = 998244353;",
"num",
"998244353",
"BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"StringTokenizer st = new StringTokenizer(bf.readLine());",
"st",
"new StringTokenizer(bf.readLine())",
"long a = Long.parseLong(st.nextToken());",
"a",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"double b = Double.parseDouble(st.nextToken());",
"b",
"Double.parseDouble(st.nextToken())",
"Double.parseDouble",
"Double",
"st.nextToken()",
"st.nextToken",
"st",
"int c = (int)(b*100.0001);",
"c",
"(int)(b*100.0001)",
"b",
"100.0001",
"long d = a*(long)(c);",
"d",
"a*(long)(c)",
"a",
"(long)(c)",
"out.println((d-((a%100)*(c%100))%100)/((long)(100)))",
"out.println",
"out",
"(d-((a%100)*(c%100))%100)/((long)(100))",
"(d-((a%100)*(c%100))%100)",
"d",
"((a%100)*(c%100))%100",
"((a%100)*(c%100))",
"(a%100)",
"a",
"100",
"(c%100)",
"c",
"100",
"100",
"((long)(100))",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n \n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}\n \n}",
"public class Main {\n \n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n \n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n \t\tlong a = Long.parseLong(st.nextToken());\n \t\tdouble b = Double.parseDouble(st.nextToken());\n \t\tint c = (int)(b*100.0001);\n \t\tlong d = a*(long)(c);\n \t\tout.println((d-((a%100)*(c%100))%100)/((long)(100)));\n \t\tout.close();\n \t\t\n \t}\n \n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception{
int num = 998244353;
// TODO Auto-generated method stub
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
StringTokenizer st = new StringTokenizer(bf.readLine());
long a = Long.parseLong(st.nextToken());
double b = Double.parseDouble(st.nextToken());
int c = (int)(b*100.0001);
long d = a*(long)(c);
out.println((d-((a%100)*(c%100))%100)/((long)(100)));
out.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
17,
18,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
29,
35
],
[
29,
36
],
[
36,
37
],
[
36,
38
],
[
12,
39
],
[
39,
40
]
] |
[
"import java.util.*;\nimport java.util.stream.*;\nimport java.math.*;\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n BigDecimal A = new BigDecimal(sc.next());\n BigDecimal B = new BigDecimal(sc.next());\n System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN));\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.*;",
"stream.*",
"java.util",
"import java.math.*;",
"math.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n BigDecimal A = new BigDecimal(sc.next());\n BigDecimal B = new BigDecimal(sc.next());\n System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN));\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n BigDecimal A = new BigDecimal(sc.next());\n BigDecimal B = new BigDecimal(sc.next());\n System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n BigDecimal A = new BigDecimal(sc.next());\n BigDecimal B = new BigDecimal(sc.next());\n System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"BigDecimal A = new BigDecimal(sc.next());",
"A",
"new BigDecimal(sc.next())",
"BigDecimal B = new BigDecimal(sc.next());",
"B",
"new BigDecimal(sc.next())",
"System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN))",
"System.out.println",
"System.out",
"System",
"System.out",
"A.multiply(B).setScale(0, RoundingMode.DOWN)",
"A.multiply(B).setScale",
"A.multiply(B)",
"A.multiply",
"A",
"B",
"0",
"RoundingMode.DOWN",
"RoundingMode",
"RoundingMode.DOWN",
"String[] args",
"args"
] |
import java.util.*;
import java.util.stream.*;
import java.math.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigDecimal A = new BigDecimal(sc.next());
BigDecimal B = new BigDecimal(sc.next());
System.out.println(A.multiply(B).setScale(0, RoundingMode.DOWN));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
51,
11
],
[
51,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
14,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
12,
48
],
[
48,
49
],
[
0,
50
],
[
50,
51
],
[
50,
52
]
] |
[
"import java.util.*;\nimport java.math.RoundingMode;\nimport java.math.BigDecimal;\n \n \n \npublic class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double b = sc.nextDouble();",
"b",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"BigDecimal a1 = new BigDecimal(a);",
"a1",
"new BigDecimal(a)",
"BigDecimal ans = a1.multiply(BigDecimal.valueOf(b));",
"ans",
"a1.multiply(BigDecimal.valueOf(b))",
"a1.multiply",
"a1",
"BigDecimal.valueOf(b)",
"BigDecimal.valueOf",
"BigDecimal",
"b",
"System.out.println(ans.longValue())",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.longValue()",
"ans.longValue",
"ans",
"String[] args",
"args",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }\n}",
"public class Main{\n\t public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\tBigDecimal a1 = new BigDecimal(a);\n\t\tBigDecimal ans = a1.multiply(BigDecimal.valueOf(b));\n\t\tSystem.out.println(ans.longValue());\n\t }\n}",
"Main"
] |
import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
double b = sc.nextDouble();
BigDecimal a1 = new BigDecimal(a);
BigDecimal ans = a1.multiply(BigDecimal.valueOf(b));
System.out.println(ans.longValue());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
17,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
58,
11
],
[
58,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
14,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
45,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
12,
55
],
[
55,
56
],
[
0,
57
],
[
57,
58
],
[
57,
59
]
] |
[
"import java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String... args) {\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String... args) {\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }\n}",
"Main",
"public static void main(String... args) {\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long A = scan.nextLong();",
"A",
"scan.nextLong()",
"scan.nextLong",
"scan",
"double B = scan.nextDouble();",
"B",
"scan.nextDouble()",
"scan.nextDouble",
"scan",
"BigDecimal a = BigDecimal.valueOf(A);",
"a",
"BigDecimal.valueOf(A)",
"BigDecimal.valueOf",
"BigDecimal",
"A",
"BigDecimal b = BigDecimal.valueOf(B);",
"b",
"BigDecimal.valueOf(B)",
"BigDecimal.valueOf",
"BigDecimal",
"B",
"System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR))",
"System.out.println",
"System.out",
"System",
"System.out",
"a.multiply(b).setScale(0, RoundingMode.FLOOR)",
"a.multiply(b).setScale",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"0",
"RoundingMode.FLOOR",
"RoundingMode",
"RoundingMode.FLOOR",
"String... args",
"args",
"public class Main {\n public static void main(String... args) {\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }\n}",
"public class Main {\n public static void main(String... args) {\n Scanner scan = new Scanner(System.in);\n long A = scan.nextLong();\n double B = scan.nextDouble();\n BigDecimal a = BigDecimal.valueOf(A);\n BigDecimal b = BigDecimal.valueOf(B);\n System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;
public class Main {
public static void main(String... args) {
Scanner scan = new Scanner(System.in);
long A = scan.nextLong();
double B = scan.nextDouble();
BigDecimal a = BigDecimal.valueOf(A);
BigDecimal b = BigDecimal.valueOf(B);
System.out.println(a.multiply(b).setScale(0, RoundingMode.FLOOR));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
0,
13,
17,
41,
13,
4,
18,
4,
18,
13,
2,
13,
17,
0,
13,
2,
2,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
60,
11
],
[
60,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
41,
43
],
[
14,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
14,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
12,
57
],
[
57,
58
],
[
0,
59
],
[
59,
60
],
[
59,
61
]
] |
[
"import java.util.*;\nimport java.io.*;\nimport static java.lang.Math.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import static java.lang.Math.*;",
"import static java.lang.Math.*;",
"import static java.lang.Math.*;",
"public class Main {\n public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double b = sc.nextDouble();",
"b",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"long result = 0;",
"result",
"0",
"b += 0.001",
"b",
"0.001",
"long B = Double.valueOf(b*100).longValue();",
"B",
"Double.valueOf(b*100).longValue()",
"Double.valueOf(b*100).longValue",
"Double.valueOf(b*100)",
"Double.valueOf",
"Double",
"b*100",
"b",
"100",
"result = (a*B)/100",
"result",
"(a*B)/100",
"(a*B)",
"a",
"B",
"100",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}\n\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// 入力\n\t\tlong a = sc.nextLong();\n\t\tdouble b = sc.nextDouble();\n\t\t\n\t\t// 計算\n\t\tlong result = 0;\n\t\tb += 0.001;\n\t\tlong B = Double.valueOf(b*100).longValue();\n\t\tresult = (a*B)/100;\n\t\t\n\t\t// 出力\n\t\tSystem.out.println(result);\n\t}\n\n}",
"Main"
] |
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
// 入力
long a = sc.nextLong();
double b = sc.nextDouble();
// 計算
long result = 0;
b += 0.001;
long B = Double.valueOf(b*100).longValue();
result = (a*B)/100;
// 出力
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
48,
11
],
[
48,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
14,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
12,
45
],
[
45,
46
],
[
0,
47
],
[
47,
48
],
[
47,
49
]
] |
[
"import java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.Scanner;\npublic class Main {\n\n public static void main(String[] args) {\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }\n}",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }\n}",
"Main",
"public static void main(String[] args) {\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }",
"main",
"{\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"BigDecimal A = sc.nextBigDecimal();",
"A",
"sc.nextBigDecimal()",
"sc.nextBigDecimal",
"sc",
"BigDecimal B = sc.nextBigDecimal();",
"B",
"sc.nextBigDecimal()",
"sc.nextBigDecimal",
"sc",
"BigDecimal C = A.multiply(B);",
"C",
"A.multiply(B)",
"A.multiply",
"A",
"B",
"BigInteger D = C.toBigInteger();",
"D",
"C.toBigInteger()",
"C.toBigInteger",
"C",
"System.out.print(D)",
"System.out.print",
"System.out",
"System",
"System.out",
"D",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n\n Scanner sc = new Scanner(System.in);\n BigDecimal A = sc.nextBigDecimal();\n BigDecimal B = sc.nextBigDecimal();\n BigDecimal C = A.multiply(B);\n\n \n BigInteger D = C.toBigInteger();\n\n System.out.print(D);\n }\n}",
"Main"
] |
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigDecimal A = sc.nextBigDecimal();
BigDecimal B = sc.nextBigDecimal();
BigDecimal C = A.multiply(B);
BigInteger D = C.toBigInteger();
System.out.print(D);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
17,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
61,
8
],
[
61,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
11,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
11,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
9,
58
],
[
58,
59
],
[
0,
60
],
[
60,
61
],
[
60,
62
]
] |
[
"import java.util.*;\nimport java.math.BigDecimal;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long A=sc.nextLong();",
"A",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double B=sc.nextDouble();",
"B",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"BigDecimal a=BigDecimal.valueOf(A);",
"a",
"BigDecimal.valueOf(A)",
"BigDecimal.valueOf",
"BigDecimal",
"A",
"BigDecimal b=BigDecimal.valueOf(B);",
"b",
"BigDecimal.valueOf(B)",
"BigDecimal.valueOf",
"BigDecimal",
"B",
"BigDecimal c=a.multiply(b);",
"c",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);",
"x",
"c.setScale(0,BigDecimal.ROUND_DOWN)",
"c.setScale",
"c",
"0",
"BigDecimal.ROUND_DOWN",
"BigDecimal",
"BigDecimal.ROUND_DOWN",
"System.out.println(x)",
"System.out.println",
"System.out",
"System",
"System.out",
"x",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n long A=sc.nextLong();\n double B=sc.nextDouble();\n BigDecimal a=BigDecimal.valueOf(A);\n BigDecimal b=BigDecimal.valueOf(B);\n BigDecimal c=a.multiply(b);\n BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);\n System.out.println(x);\n\t}\n}",
"Main"
] |
import java.util.*;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
long A=sc.nextLong();
double B=sc.nextDouble();
BigDecimal a=BigDecimal.valueOf(A);
BigDecimal b=BigDecimal.valueOf(B);
BigDecimal c=a.multiply(b);
BigDecimal x=c.setScale(0,BigDecimal.ROUND_DOWN);
System.out.println(x);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
13,
13,
17,
3,
4,
18,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
81,
8
],
[
81,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
19,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
38,
48
],
[
48,
49
],
[
49,
50
],
[
38,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
53,
60
],
[
52,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
19,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
11,
75
],
[
75,
76
],
[
76,
77
],
[
9,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] |
[
"import java.util.*;\nimport java.math.*;\npublic class Main {\n\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}\n\t\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}\n\t\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}",
"main",
"{\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}",
"Scanner in=new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"while(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}",
"BigDecimal a=in.nextBigDecimal();",
"a",
"in.nextBigDecimal()",
"in.nextBigDecimal",
"in",
"BigDecimal b=in.nextBigDecimal();",
"b",
"in.nextBigDecimal()",
"in.nextBigDecimal",
"in",
"String ans=a.multiply(b).toString();",
"ans",
"a.multiply(b).toString()",
"a.multiply(b).toString",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"for(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ans.length()",
"i",
"ans.length()",
"ans.length",
"ans",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}",
"{\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}",
"if(ans.charAt(i)=='.')break;",
"ans.charAt(i)=='.'",
"ans.charAt(i)",
"ans.charAt",
"ans",
"i",
"'.'",
"break;",
"System.out.print(ans.charAt(i))",
"System.out.print",
"System.out",
"System",
"System.out",
"ans.charAt(i)",
"ans.charAt",
"ans",
"i",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"in.close()",
"in.close",
"in",
"String[] args",
"args",
"public class Main {\n\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}\n\t\n\t\n}",
"public class Main {\n\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()) {\n\t\t\tBigDecimal a=in.nextBigDecimal();\n\t\t\tBigDecimal b=in.nextBigDecimal();\n\t\t\tString ans=a.multiply(b).toString();\n\t\t\tfor(int i=0;i<ans.length();i++) {\n\t\t\t\tif(ans.charAt(i)=='.')break;\n\t\t\t\tSystem.out.print(ans.charAt(i));\n\t\t\t}System.out.println();\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tin.close();//the end of main\n\t}\n\t\n\t\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
while(in.hasNext()) {
BigDecimal a=in.nextBigDecimal();
BigDecimal b=in.nextBigDecimal();
String ans=a.multiply(b).toString();
for(int i=0;i<ans.length();i++) {
if(ans.charAt(i)=='.')break;
System.out.print(ans.charAt(i));
}System.out.println();
}
in.close();//the end of main
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
29,
41,
13,
4,
18,
13,
2,
13,
17,
41,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
66,
5
],
[
66,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
26,
33
],
[
33,
34
],
[
34,
35
],
[
26,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
6,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long A = sc.nextLong();",
"A",
"sc.nextLong()",
"sc.nextLong",
"sc",
"double B = sc.nextDouble();",
"B",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"if (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}",
"B == 0",
"B",
"0",
"{\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}",
"System.out.println(0)",
"System.out.println",
"System.out",
"System",
"System.out",
"0",
"sc.close()",
"sc.close",
"sc",
"return;",
"long C = Math.round(B * 100);",
"C",
"Math.round(B * 100)",
"Math.round",
"Math",
"B * 100",
"B",
"100",
"long D = A * C;",
"D",
"A * C",
"A",
"C",
"System.out.println(Math.floorDiv(D, 100))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.floorDiv(D, 100)",
"Math.floorDiv",
"Math",
"D",
"100",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tlong A = sc.nextLong();\n\t\tdouble B = sc.nextDouble();\n\t\t\n\t\tif (B == 0) {\n\t\t\tSystem.out.println(0);\n\t\t\tsc.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong C = Math.round(B * 100);\n\t\tlong D = A * C;\n\n\t\t// 結果の出力\n\t\tSystem.out.println(Math.floorDiv(D, 100));\n\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 入力値の取得
long A = sc.nextLong();
double B = sc.nextDouble();
if (B == 0) {
System.out.println(0);
sc.close();
return;
}
long C = Math.round(B * 100);
long D = A * C;
// 結果の出力
System.out.println(Math.floorDiv(D, 100));
sc.close();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.