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"Mihai and Slavic were looking at a group of n frogs, numbered from 1 to n , all initially located at point 0 . Frog i has a hop length of a_i . Each second, frog i hops a_i units forward. Before any frogs start hopping, Slavic and Mihai can place exactly one trap in a coordinate in order to catch all frogs that will ever pass through the corresponding coordinate. However, the children can't go far away from their home so they can only place a trap in the first n points (that is, in a point with a coordinate between 1 and n ) and the children can't place a trap in point 0 since they are scared of frogs. Can you help Slavic and Mihai find out what is the maximum number of frogs they can catch using a trap? The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of frogs, which equals the distance Slavic and Mihai can travel to place a trap. The second line of each test case contains n integers a_1, ldots, a_n ( 1 <= q a_i <= q 10^9 ) -- the lengths of the hops of the corresponding frogs. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case output a single integer -- the maximum number of frogs Slavic and Mihai can catch using a trap. In the first test case, the frogs will hop as follows: In the second test case, Slavic and Mihai can put a trap at coordinate 2 and catch all three frogs instantly. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
215019755 |
Chio |
F |
July 22, 2023, 8:55 a.m. |
OK |
C# 10 |
TESTS |
66 |
171 |
58982400 |
|
|
215087598 |
treasuryonly |
F |
July 22, 2023, 6:17 p.m. |
OK |
C# 10 |
TESTS |
66 |
202 |
43110400 |
|
|
215117363 |
bluemegane |
F |
July 23, 2023, 2:27 a.m. |
OK |
C# 8 |
TESTS |
66 |
140 |
30208000 |
|
|
215087676 |
treasuryonly |
F |
July 22, 2023, 6:18 p.m. |
OK |
C# 8 |
TESTS |
66 |
249 |
35737600 |
|
|
215092405 |
Aditya9430 |
F |
July 22, 2023, 7:03 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
66 |
1965 |
26009600 |
|
|
215092678 |
Aditya9430 |
F |
July 22, 2023, 7:06 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
66 |
2011 |
26009600 |
|
|
215092468 |
Aditya9430 |
F |
July 22, 2023, 7:04 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
66 |
2043 |
26009600 |
|
|
215068552 |
SkyWave2022 |
F |
July 22, 2023, 3:54 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
66 |
140 |
1843200 |
|
|
215098371 |
NenadDapic |
F |
July 22, 2023, 8:12 p.m. |
OK |
FPC |
TESTS |
66 |
62 |
921600 |
|
|
215078918 |
just_noone_really |
F |
July 22, 2023, 5:05 p.m. |
OK |
GNU C11 |
TESTS |
66 |
62 |
1638400 |
|
|
215066025 |
DgutGWK |
F |
July 22, 2023, 3:37 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
819200 |
|
|
215093700 |
aluber |
F |
July 22, 2023, 7:17 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
819200 |
|
|
215062868 |
Keith.6 |
F |
July 22, 2023, 3:16 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
1638400 |
|
|
215049584 |
yanruo |
F |
July 22, 2023, 1:42 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
1638400 |
|
|
215073261 |
AAbhijithA |
F |
July 22, 2023, 4:25 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
1638400 |
|
|
215109689 |
zltzlt |
F |
July 22, 2023, 11:37 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
2457600 |
|
|
215070843 |
dat |
F |
July 22, 2023, 4:09 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
2457600 |
|
|
215058919 |
lksible |
F |
July 22, 2023, 2:50 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
2457600 |
|
|
215028596 |
napgod_pk |
F |
July 22, 2023, 10:12 a.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
2457600 |
|
|
215109847 |
superharshverma25 |
F |
July 22, 2023, 11:40 p.m. |
OK |
GNU C++14 |
TESTS |
66 |
62 |
2457600 |
|
|
215058650 |
Trashy-Weak-Kid |
F |
July 22, 2023, 2:48 p.m. |
OK |
GNU C++17 |
TESTS |
66 |
46 |
1536000 |
|
|
215051019 |
Kirigakure_Saizo |
F |
July 22, 2023, 1:52 p.m. |
OK |
GNU C++17 |
TESTS |
66 |
61 |
1638400 |
|
|
215114552 |
Snow_S |
F |
July 23, 2023, 1:34 a.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
819200 |
|
|
215123288 |
mattrjohnson |
F |
July 23, 2023, 4:12 a.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
819200 |
|
|
215115355 |
innomenate |
F |
July 23, 2023, 1:50 a.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215112417 |
tbzard |
F |
July 23, 2023, 12:48 a.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215110459 |
Plums |
F |
July 22, 2023, 11:55 p.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215109829 |
A7med_Nage7 |
F |
July 22, 2023, 11:40 p.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215107872 |
Nada_A7med |
F |
July 22, 2023, 10:52 p.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215125878 |
lavijiang |
F |
July 23, 2023, 5 a.m. |
OK |
GNU C++17 |
TESTS |
66 |
62 |
1638400 |
|
|
215117134 |
OTTFF |
F |
July 23, 2023, 2:22 a.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215124944 |
Leeeee |
F |
July 23, 2023, 4:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215078660 |
hhcpp |
F |
July 22, 2023, 5:03 p.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215021296 |
Alexeyxgod |
F |
July 22, 2023, 9:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215079786 |
Anish_Singh_Dhami_07 |
F |
July 22, 2023, 5:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1024000 |
|
|
215082727 |
Nika. |
F |
July 22, 2023, 5:37 p.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1638400 |
|
|
215076666 |
The5threich |
F |
July 22, 2023, 4:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1638400 |
|
|
215019843 |
alif_cse_ju |
F |
July 22, 2023, 8:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1638400 |
|
|
215127860 |
nitvjudge1 |
F |
July 23, 2023, 5:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1638400 |
|
|
215086850 |
Vax |
F |
July 22, 2023, 6:11 p.m. |
OK |
GNU C++17 (64) |
TESTS |
66 |
46 |
1638400 |
|
|
215018981 |
lauhemahfus |
F |
July 22, 2023, 8:48 a.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
1638400 |
|
|
215054611 |
jvdss12 |
F |
July 22, 2023, 2:19 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
1638400 |
|
|
215053306 |
shreyyshahh |
F |
July 22, 2023, 2:09 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
1638400 |
|
|
215057478 |
lekkoo |
F |
July 22, 2023, 2:40 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
1638400 |
|
|
215106704 |
Amro_Sous |
F |
July 22, 2023, 10:21 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
1638400 |
|
|
215099364 |
waleedalaa511 |
F |
July 22, 2023, 8:25 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
2457600 |
|
|
215072765 |
ok_lets_go |
F |
July 22, 2023, 4:22 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
31 |
3276800 |
|
|
215108983 |
flowing |
F |
July 22, 2023, 11:18 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215123878 |
SinhaSatwik |
F |
July 23, 2023, 4:24 a.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215080272 |
mennakhalid288 |
F |
July 22, 2023, 5:17 p.m. |
OK |
GNU C++20 (64) |
TESTS |
66 |
46 |
819200 |
|
|
215111883 |
cuicuisha |
F |
July 23, 2023, 12:33 a.m. |
OK |
Go |
TESTS |
66 |
46 |
5427200 |
|
|
215092608 |
Hsharma |
F |
July 22, 2023, 7:05 p.m. |
OK |
Java 11 |
TESTS |
66 |
234 |
0 |
|
|
215016751 |
prinatarakha |
F |
July 22, 2023, 8:31 a.m. |
OK |
Java 11 |
TESTS |
66 |
249 |
0 |
|
|
215054740 |
Siyaram_13 |
F |
July 22, 2023, 2:20 p.m. |
OK |
Java 11 |
TESTS |
66 |
312 |
16076800 |
|
|
215016518 |
prakharshri12345 |
F |
July 22, 2023, 8:29 a.m. |
OK |
Java 11 |
TESTS |
66 |
358 |
18534400 |
|
|
215106737 |
sambhav19329 |
F |
July 22, 2023, 10:22 p.m. |
OK |
Java 11 |
TESTS |
66 |
686 |
13107200 |
|
|
215025704 |
ananya_s_s |
F |
July 22, 2023, 9:42 a.m. |
OK |
Java 11 |
TESTS |
66 |
1122 |
15769600 |
|
|
215077708 |
ujjwal_a0001 |
F |
July 22, 2023, 4:55 p.m. |
OK |
Java 11 |
TESTS |
66 |
1575 |
0 |
|
|
215065070 |
try1111111 |
F |
July 22, 2023, 3:31 p.m. |
OK |
Java 17 |
TESTS |
66 |
248 |
716800 |
|
|
215095910 |
Suraj1607 |
F |
July 22, 2023, 7:42 p.m. |
OK |
Java 17 |
TESTS |
66 |
249 |
512000 |
|
|
215065370 |
try1111111 |
F |
July 22, 2023, 3:33 p.m. |
OK |
Java 17 |
TESTS |
66 |
249 |
716800 |
|
|
215060498 |
ADust |
F |
July 22, 2023, 3:01 p.m. |
OK |
Java 17 |
TESTS |
66 |
280 |
716800 |
|
|
215111463 |
woodyiiiiiii |
F |
July 23, 2023, 12:22 a.m. |
OK |
Java 17 |
TESTS |
66 |
295 |
18534400 |
|
|
215048426 |
duyipeng |
F |
July 22, 2023, 1:34 p.m. |
OK |
Java 17 |
TESTS |
66 |
342 |
19148800 |
|
|
215082768 |
tbs-jyy |
F |
July 22, 2023, 5:37 p.m. |
OK |
Java 17 |
TESTS |
66 |
342 |
20582400 |
|
|
215017438 |
Hawater |
F |
July 22, 2023, 8:37 a.m. |
OK |
Java 17 |
TESTS |
66 |
358 |
18534400 |
|
|
215103293 |
Black-Heart |
F |
July 22, 2023, 9:23 p.m. |
OK |
Java 17 |
TESTS |
66 |
405 |
48128000 |
|
|
215118332 |
JavaGodPeter |
F |
July 23, 2023, 2:44 a.m. |
OK |
Java 17 |
TESTS |
66 |
529 |
921600 |
|
|
215089103 |
Harshit_3905 |
F |
July 22, 2023, 6:30 p.m. |
OK |
Java 8 |
TESTS |
66 |
155 |
2150400 |
|
|
215059712 |
Sylvester_ |
F |
July 22, 2023, 2:55 p.m. |
OK |
Java 8 |
TESTS |
66 |
155 |
2764800 |
|
|
215014583 |
YanWenJie |
F |
July 22, 2023, 8:14 a.m. |
OK |
Java 8 |
TESTS |
66 |
155 |
3276800 |
|
|
215059261 |
Sylvester_ |
F |
July 22, 2023, 2:53 p.m. |
OK |
Java 8 |
TESTS |
66 |
170 |
2764800 |
|
|
215054401 |
harry1995 |
F |
July 22, 2023, 2:17 p.m. |
OK |
Java 8 |
TESTS |
66 |
186 |
15974400 |
|
|
215085092 |
harsh_1806 |
F |
July 22, 2023, 5:56 p.m. |
OK |
Java 8 |
TESTS |
66 |
187 |
3072000 |
|
|
215054659 |
harry1995 |
F |
July 22, 2023, 2:19 p.m. |
OK |
Java 8 |
TESTS |
66 |
202 |
15974400 |
|
|
215127288 |
Lukecatt |
F |
July 23, 2023, 5:22 a.m. |
OK |
Java 8 |
TESTS |
66 |
218 |
2457600 |
|
|
215061846 |
IceWolf898 |
F |
July 22, 2023, 3:10 p.m. |
OK |
Java 8 |
TESTS |
66 |
218 |
3686400 |
|
|
215020583 |
lioeva_niuma |
F |
July 22, 2023, 9:01 a.m. |
OK |
Java 8 |
TESTS |
66 |
249 |
14745600 |
|
|
215087728 |
treasuryonly |
F |
July 22, 2023, 6:18 p.m. |
OK |
Mono C# |
TESTS |
66 |
264 |
40448000 |
|
|
215118002 |
yg233 |
F |
July 23, 2023, 2:38 a.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
93 |
1638400 |
|
|
215071161 |
Tubisek |
F |
July 22, 2023, 4:11 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
171 |
1638400 |
|
|
215110124 |
Abdullah_Mahmoud |
F |
July 22, 2023, 11:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
187 |
1638400 |
|
|
215080434 |
Tor_250 |
F |
July 22, 2023, 5:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
187 |
1638400 |
|
|
215053034 |
suprend |
F |
July 22, 2023, 2:07 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
187 |
2457600 |
|
|
215104516 |
Dylag |
F |
July 22, 2023, 9:40 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
202 |
1638400 |
|
|
215051594 |
suprend |
F |
July 22, 2023, 1:56 p.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
202 |
2457600 |
|
|
215116995 |
lirejie |
F |
July 23, 2023, 2:19 a.m. |
OK |
MS C++ 2017 |
TESTS |
66 |
326 |
16076800 |
|
|
215101715 |
pushkina.a.v.400 |
F |
July 22, 2023, 8:57 p.m. |
OK |
PyPy 3 |
TESTS |
66 |
280 |
16281600 |
|
|
215100657 |
noobmaster2002 |
F |
July 22, 2023, 8:43 p.m. |
OK |
PyPy 3 |
TESTS |
66 |
280 |
16281600 |
|
|
215079072 |
_u_n_k_n_o_w_n_ |
F |
July 22, 2023, 5:07 p.m. |
OK |
PyPy 3 |
TESTS |
66 |
280 |
16588800 |
|
|
215119591 |
VioletVal |
F |
July 23, 2023, 3:06 a.m. |
OK |
PyPy 3 |
TESTS |
66 |
280 |
16793600 |
|
|
215076677 |
linhhlp |
F |
July 22, 2023, 4:48 p.m. |
OK |
PyPy 3 |
TESTS |
66 |
342 |
20275200 |
|
|
215078066 |
linhhlp |
F |
July 22, 2023, 4:58 p.m. |
OK |
PyPy 3 |
TESTS |
66 |
405 |
22732800 |
|
|
215123208 |
andy1liang |
F |
July 23, 2023, 4:11 a.m. |
OK |
PyPy 3 |
TESTS |
66 |
842 |
28876800 |
|
|
215123095 |
ikhare |
F |
July 23, 2023, 4:08 a.m. |
OK |
PyPy 3 |
TESTS |
66 |
1029 |
28979200 |
|
|
215051295 |
rmr |
F |
July 22, 2023, 1:54 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
109 |
19353600 |
|
|
215105181 |
xiaowuc1 |
F |
July 22, 2023, 9:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
109 |
19456000 |
|
|
215093043 |
taraskin.2304 |
F |
July 22, 2023, 7:10 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
109 |
20787200 |
|
|
215098023 |
jauch |
F |
July 22, 2023, 8:08 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
22016000 |
|
|
215098092 |
jauch |
F |
July 22, 2023, 8:09 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
22835200 |
|
|
215021307 |
crapcode |
F |
July 22, 2023, 9:07 a.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
23449600 |
|
|
215090416 |
noob_at_programming |
F |
July 22, 2023, 6:42 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
23961600 |
|
|
215110117 |
aspiringquant |
F |
July 22, 2023, 11:46 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
24780800 |
|
|
215077081 |
John_27_Max |
F |
July 22, 2023, 4:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
24780800 |
|
|
215081989 |
Ali_Mohamed77 |
F |
July 22, 2023, 5:31 p.m. |
OK |
PyPy 3-64 |
TESTS |
66 |
124 |
26009600 |
|
|
215095850 |
alexpods |
F |
July 22, 2023, 7:41 p.m. |
OK |
Python 3 |
TESTS |
66 |
311 |
27033600 |
|
|
215053995 |
maciejgusta |
F |
July 22, 2023, 2:14 p.m. |
OK |
Python 3 |
TESTS |
66 |
311 |
27033600 |
|
|
215087862 |
zhengdongrong |
F |
July 22, 2023, 6:19 p.m. |
OK |
Python 3 |
TESTS |
66 |
327 |
27033600 |
|
|
215088538 |
zhengdongrong |
F |
July 22, 2023, 6:25 p.m. |
OK |
Python 3 |
TESTS |
66 |
342 |
27955200 |
|
|
215088073 |
zhengdongrong |
F |
July 22, 2023, 6:21 p.m. |
OK |
Python 3 |
TESTS |
66 |
343 |
27033600 |
|
|
215085533 |
zhengdongrong |
F |
July 22, 2023, 6 p.m. |
OK |
Python 3 |
TESTS |
66 |
343 |
27033600 |
|
|
215096293 |
alexpods |
F |
July 22, 2023, 7:46 p.m. |
OK |
Python 3 |
TESTS |
66 |
343 |
27852800 |
|
|
215088491 |
zhengdongrong |
F |
July 22, 2023, 6:25 p.m. |
OK |
Python 3 |
TESTS |
66 |
358 |
27033600 |
|
|
215088433 |
zhengdongrong |
F |
July 22, 2023, 6:24 p.m. |
OK |
Python 3 |
TESTS |
66 |
373 |
27033600 |
|
|
215088370 |
zhengdongrong |
F |
July 22, 2023, 6:23 p.m. |
OK |
Python 3 |
TESTS |
66 |
373 |
27852800 |
|
|
215125556 |
AktanTursunbaev |
F |
July 23, 2023, 4:54 a.m. |
OK |
Ruby 3 |
TESTS |
66 |
607 |
75673600 |
|
|
215052423 |
gr8den |
F |
July 22, 2023, 2:02 p.m. |
OK |
Rust 2021 |
TESTS |
66 |
31 |
6348800 |
|
|
215050064 |
gr8den |
F |
July 22, 2023, 1:45 p.m. |
OK |
Rust 2021 |
TESTS |
66 |
31 |
6348800 |
|
|
215024990 |
ayhon |
F |
July 22, 2023, 9:35 a.m. |
OK |
Rust 2021 |
TESTS |
66 |
46 |
15667200 |
|
|
215022625 |
uwu_69420 |
F |
July 22, 2023, 9:17 a.m. |
OK |
Rust 2021 |
TESTS |
66 |
140 |
15257600 |
|
|
remove filters
Back to search problems