Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B'SaMer has written the greatest test case of all time for one of his problems. For a given array of integers, the problem asks to find the minimum number of groups the array can be divided into, such that the product of any pair of integers in the same group is a perfect square. Each integer must be in exactly one group. However, integers in a group do not necessarily have to be contiguous in the array. SaMer wishes to create more cases from the test case he already has. His test case has an array A of n integers, and he needs to find the number of contiguous subarrays of A that have an answer to the problem equal to k for each integer k between 1 and n (inclusive). The first line of input contains a single integer n ( 1 <= q n <= q 5000 ), the size of the array. The second line contains n integers a_1 , a_2 , ... , a_n ( -10^8 <= q a_i <= q 10^8 ), the values of the array. Output n space-separated integers, the k -th integer should be the number of contiguous subarrays of A that have an answer to the problem equal to k . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
39005967 |
admire.japan |
D |
June 7, 2018, 12:03 a.m. |
OK |
D |
TESTS |
95 |
218 |
4198400 |
|
2100 |
43434222 |
cpy |
D |
Sept. 26, 2018, 4:02 a.m. |
OK |
D |
TESTS |
95 |
483 |
52736000 |
|
2100 |
42154118 |
Ocelot_666 |
D |
Aug. 27, 2018, 1:44 p.m. |
OK |
FPC |
TESTS |
95 |
218 |
204800 |
|
2100 |
40159297 |
vjudge2 |
D |
July 10, 2018, 6:05 a.m. |
OK |
FPC |
TESTS |
95 |
218 |
204800 |
|
2100 |
40159262 |
Ocelot_666 |
D |
July 10, 2018, 6:03 a.m. |
OK |
FPC |
TESTS |
95 |
234 |
204800 |
|
2100 |
38105635 |
sdcgvhgj |
D |
May 11, 2018, 5:04 a.m. |
OK |
GNU C++ |
TESTS |
95 |
46 |
4096000 |
|
2100 |
39822286 |
Sooke |
D |
July 1, 2018, 1:20 p.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
204800 |
|
2100 |
40932183 |
ReaLNero1 |
D |
July 30, 2018, 1:38 a.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
307200 |
|
2100 |
38561983 |
vjudge1 |
D |
May 23, 2018, 12:38 p.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
307200 |
|
2100 |
38561953 |
vjudge2 |
D |
May 23, 2018, 12:37 p.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
307200 |
|
2100 |
39970317 |
vjudge3 |
D |
July 5, 2018, 1:45 a.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
409600 |
|
2100 |
39970314 |
slzxchy |
D |
July 5, 2018, 1:45 a.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
409600 |
|
2100 |
38092071 |
Chunchao |
D |
May 10, 2018, 1:22 p.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
3891200 |
|
2100 |
38126301 |
3901130101 |
D |
May 12, 2018, 3:02 a.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
3993600 |
|
2100 |
38171659 |
fxt |
D |
May 13, 2018, 9:57 a.m. |
OK |
GNU C++ |
TESTS |
95 |
62 |
4198400 |
|
2100 |
42826063 |
gggggxz |
D |
Sept. 13, 2018, 10:12 a.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
102400 |
|
2100 |
49733587 |
EggyFour |
D |
Feb. 10, 2019, 4:41 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
204800 |
|
2100 |
55659090 |
vjudge5 |
D |
June 16, 2019, 7:23 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
307200 |
|
2100 |
54958575 |
hello_world2005 |
D |
June 2, 2019, 2:09 a.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
307200 |
|
2100 |
39881484 |
PinkEx |
D |
July 3, 2018, 1:48 a.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
307200 |
|
2100 |
53692019 |
gzcsudo |
D |
May 3, 2019, 5:33 a.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
409600 |
|
2100 |
51901779 |
w_t |
D |
March 27, 2019, 1:45 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
409600 |
|
2100 |
51880353 |
w_t |
D |
March 26, 2019, 11:25 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
409600 |
|
2100 |
38484501 |
ParadiseM |
D |
May 21, 2018, 1:27 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
409600 |
|
2100 |
38073629 |
v9fly |
D |
May 9, 2018, 1:57 p.m. |
OK |
GNU C++11 |
TESTS |
95 |
62 |
3686400 |
|
2100 |
38050662 |
CS_LYJ1997 |
D |
May 8, 2018, 6:17 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
61 |
3993600 |
|
2100 |
43588128 |
Nobel_ruettt |
D |
Sept. 29, 2018, 9:44 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
409600 |
|
2100 |
54958613 |
vjudge5 |
D |
June 2, 2019, 2:11 a.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
512000 |
|
2100 |
38063502 |
Mostima |
D |
May 9, 2018, 7:07 a.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3481600 |
|
2100 |
38054272 |
omidazadi |
D |
May 8, 2018, 8:08 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3584000 |
|
2100 |
38185559 |
enochjung |
D |
May 13, 2018, 11:21 a.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3686400 |
|
2100 |
38054832 |
HackerTina |
D |
May 8, 2018, 8:36 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3788800 |
|
2100 |
38053013 |
godusheep |
D |
May 8, 2018, 7:14 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3788800 |
|
2100 |
38052605 |
Arg_007 |
D |
May 8, 2018, 7 p.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
3891200 |
|
2100 |
38157140 |
lok666 |
D |
May 13, 2018, 8:58 a.m. |
OK |
GNU C++14 |
TESTS |
95 |
62 |
4096000 |
|
2100 |
40914549 |
A_Wanderer |
D |
July 29, 2018, 10:55 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
204800 |
|
2100 |
38602163 |
MoliH97 |
D |
May 25, 2018, 6:47 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
204800 |
|
2100 |
44774122 |
vjudge4 |
D |
Oct. 24, 2018, 1:35 p.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
512000 |
|
2100 |
38477514 |
160930010 |
D |
May 21, 2018, 8:20 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
716800 |
|
2100 |
38977650 |
duckladydinh |
D |
June 5, 2018, 7:22 p.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
3788800 |
|
2100 |
38081692 |
YouKn0wWho |
D |
May 9, 2018, 10:09 p.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
3788800 |
|
2100 |
38041625 |
HIT_TOM |
D |
May 8, 2018, 4:20 p.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
3788800 |
|
2100 |
38311229 |
exs |
D |
May 16, 2018, 6:38 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
3993600 |
|
2100 |
38064705 |
Jon |
D |
May 9, 2018, 8:05 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
62 |
7065600 |
|
2100 |
41669975 |
cjnwq |
D |
Aug. 17, 2018, 4:05 a.m. |
OK |
GNU C++17 |
TESTS |
95 |
77 |
102400 |
|
2100 |
46584149 |
wadissimo |
D |
Dec. 4, 2018, 12:29 p.m. |
OK |
Java 8 |
TESTS |
95 |
202 |
0 |
|
2100 |
39229006 |
totallynotan |
D |
June 14, 2018, 1:07 a.m. |
OK |
Java 8 |
TESTS |
95 |
233 |
0 |
|
2100 |
38070950 |
ankurdua15 |
D |
May 9, 2018, 12:25 p.m. |
OK |
Java 8 |
TESTS |
95 |
233 |
20787200 |
|
2100 |
38046354 |
uwi |
D |
May 8, 2018, 4:48 p.m. |
OK |
Java 8 |
TESTS |
95 |
265 |
20992000 |
|
2100 |
61183838 |
LAKOUAM_IMAD |
D |
Sept. 23, 2019, 9:04 p.m. |
OK |
Java 8 |
TESTS |
95 |
280 |
0 |
|
2100 |
38057531 |
dalt |
D |
May 9, 2018, 1 a.m. |
OK |
Java 8 |
TESTS |
95 |
280 |
20787200 |
|
2100 |
38063556 |
Aemon |
D |
May 9, 2018, 7:10 a.m. |
OK |
Java 8 |
TESTS |
95 |
280 |
20889600 |
|
2100 |
38109195 |
aman28rwt |
D |
May 11, 2018, 8:46 a.m. |
OK |
Java 8 |
TESTS |
95 |
296 |
20889600 |
|
2100 |
38109002 |
aman28rwt |
D |
May 11, 2018, 8:34 a.m. |
OK |
Java 8 |
TESTS |
95 |
296 |
20889600 |
|
2100 |
38052073 |
Hohol |
D |
May 8, 2018, 6:45 p.m. |
OK |
Java 8 |
TESTS |
95 |
327 |
20889600 |
|
2100 |
38593536 |
0442A403 |
D |
May 24, 2018, 5:42 p.m. |
OK |
Kotlin |
TESTS |
95 |
451 |
0 |
|
2100 |
38056512 |
wleung_bvg |
D |
May 8, 2018, 11:08 p.m. |
OK |
Mono C# |
TESTS |
95 |
826 |
218419200 |
|
2100 |
38400901 |
wj2dy |
D |
May 18, 2018, 12:19 p.m. |
OK |
MS C++ |
TESTS |
95 |
109 |
614400 |
|
2100 |
45968047 |
EatingMelonPublic |
D |
Nov. 19, 2018, 2:34 p.m. |
OK |
MS C++ |
TESTS |
95 |
171 |
204800 |
|
2100 |
54968002 |
vjudge5 |
D |
June 2, 2019, 7:19 a.m. |
OK |
MS C++ |
TESTS |
95 |
171 |
204800 |
|
2100 |
38628018 |
deathgun |
D |
May 26, 2018, 8:06 a.m. |
OK |
PyPy 2 |
TESTS |
95 |
405 |
3072000 |
|
2100 |
38627986 |
deathgun |
D |
May 26, 2018, 8:04 a.m. |
OK |
PyPy 2 |
TESTS |
95 |
420 |
3174400 |
|
2100 |
60299423 |
pajenegod |
D |
Sept. 9, 2019, 11:36 a.m. |
OK |
PyPy 2 |
TESTS |
95 |
436 |
3788800 |
|
2100 |
38383190 |
eightants |
D |
May 17, 2018, 9:31 p.m. |
OK |
PyPy 2 |
TESTS |
95 |
592 |
3276800 |
|
2100 |
38097880 |
pyrus |
D |
May 10, 2018, 5:10 p.m. |
OK |
PyPy 3 |
TESTS |
95 |
311 |
25395200 |
|
2100 |
38329273 |
Hillmouse |
D |
May 16, 2018, 5:48 p.m. |
OK |
Rust |
TESTS |
95 |
139 |
3174400 |
|
2100 |
remove filters
Back to search problems