Codeforces Round 905 (Div. 3)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1883 Codeforces Round 905 (Div. 3) FINISHED False 7200 33850499 Oct. 22, 2023, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 28363 ) C Raspberries PROGRAMMING math

B'You are given an array of integers a_1, a_2, ldots, a_n and a number k ( 2 <= q k <= q 5 ). In one operation, you can do the following: Find the minimum number of operations needed to make the product of all the numbers in the array a_1 cdot a_2 cdot ldots cdot a_n divisible by k . Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains two integers n and k ( 2 <= q n <= q 10^5 , 2 <= q k <= q 5 ) -- the size of the array a and the number k . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output the minimum number of operations needed to make the product of all the numbers in the array divisible by k . In the first test case, we need to choose the index i = 2 twice. After that, the array will be a = [7, 5] . The product of all the numbers in the array is 35 . In the fourth test case, the product of the numbers in the array is 120 , which is already divisible by 5 , so no operations are needed. In the eighth test case, we can perform two operations by choosing i = 2 and i = 3 in any order. After that, the array will be a = [1, 6, 10] . The product of the numbers in the array is 60 . '...

Tutorials

Codeforces Round #905 (Div. 1, Div. 2, Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
229294927 chrisTris C Oct. 22, 2023, 1:56 p.m. OK C# 10 TESTS 5 62 9728000
229359049 sh_arman C Oct. 23, 2023, 1:49 a.m. OK C# 10 TESTS 5 124 9932800
229356271 bluemegane C Oct. 23, 2023, 12:38 a.m. OK C# 8 TESTS 5 140 9523200
229353332 k_wang C Oct. 22, 2023, 11 p.m. OK Clang++17 Diagnostics TESTS 5 592 1024000
229293744 iffatul_anon C Oct. 22, 2023, 1:51 p.m. OK GNU C11 TESTS 5 46 0
229333008 Nuhash1 C Oct. 22, 2023, 6:58 p.m. OK GNU C11 TESTS 5 46 819200
229288944 prateek1110 C Oct. 22, 2023, 1:04 p.m. OK GNU C11 TESTS 5 46 819200
229358524 meaou C Oct. 23, 2023, 1:37 a.m. OK GNU C11 TESTS 5 61 409600
229358410 RIPTIDEZ C Oct. 23, 2023, 1:34 a.m. OK GNU C11 TESTS 5 61 409600
229293503 pash18i5 C Oct. 22, 2023, 1:51 p.m. OK GNU C11 TESTS 5 78 819200
229326362 ABR_2005 C Oct. 22, 2023, 5:56 p.m. OK GNU C11 TESTS 5 93 819200
229362013 peter112358 C Oct. 23, 2023, 2:50 a.m. OK GNU C++14 TESTS 5 31 0
229329754 Olzlzlz C Oct. 22, 2023, 6:25 p.m. OK GNU C++14 TESTS 5 31 409600
229333720 Badhon_1 C Oct. 22, 2023, 7:05 p.m. OK GNU C++14 TESTS 5 31 409600
229344143 goyalvansh C Oct. 22, 2023, 9:10 p.m. OK GNU C++14 TESTS 5 31 409600
229359108 wyfryj210414 C Oct. 23, 2023, 1:50 a.m. OK GNU C++14 TESTS 5 31 409600
229331877 dici_sugi C Oct. 22, 2023, 6:46 p.m. OK GNU C++14 TESTS 5 31 409600
229310549 GAG47 C Oct. 22, 2023, 3:40 p.m. OK GNU C++14 TESTS 5 31 819200
229371169 vaibhavvgarg C Oct. 23, 2023, 5:23 a.m. OK GNU C++14 TESTS 5 31 819200
229299220 lonelyness C Oct. 22, 2023, 2:18 p.m. OK GNU C++14 TESTS 5 31 819200
229371685 emptyboxs C Oct. 23, 2023, 5:30 a.m. OK GNU C++14 TESTS 5 31 1638400
229304155 sgfc C Oct. 22, 2023, 2:50 p.m. OK GNU C++17 TESTS 5 31 0
229301558 Mo.Zaghloul74 C Oct. 22, 2023, 2:33 p.m. OK GNU C++17 TESTS 5 31 0
229301325 KAKASHI25 C Oct. 22, 2023, 2:31 p.m. OK GNU C++17 TESTS 5 31 0
229293262 LeowN C Oct. 22, 2023, 1:50 p.m. OK GNU C++17 TESTS 5 31 0
229374062 HatureyCoder C Oct. 23, 2023, 5:57 a.m. OK GNU C++17 TESTS 5 31 0
229335723 dionysios C Oct. 22, 2023, 7:25 p.m. OK GNU C++17 TESTS 5 31 0
229330110 Darshansinghbisht C Oct. 22, 2023, 6:28 p.m. OK GNU C++17 TESTS 5 31 0
229374466 Black_Pencil C Oct. 23, 2023, 6:01 a.m. OK GNU C++17 TESTS 5 31 409600
229360783 weichiwei C Oct. 23, 2023, 2:24 a.m. OK GNU C++17 TESTS 5 31 409600
229369191 edenzz C Oct. 23, 2023, 4:56 a.m. OK GNU C++17 TESTS 5 31 409600
229327126 Liudas C Oct. 22, 2023, 6:03 p.m. OK GNU C++17 (64) TESTS 5 15 0
229322509 fojlerabbi2829 C Oct. 22, 2023, 5:22 p.m. OK GNU C++17 (64) TESTS 5 15 0
229325329 Abid_52 C Oct. 22, 2023, 5:47 p.m. OK GNU C++17 (64) TESTS 5 15 409600
229359874 Once_I_Liked_AGirl C Oct. 23, 2023, 2:06 a.m. OK GNU C++17 (64) TESTS 5 15 409600
229325213 not_raunit C Oct. 22, 2023, 5:46 p.m. OK GNU C++17 (64) TESTS 5 15 819200
229314268 LimboBoom C Oct. 22, 2023, 4:11 p.m. OK GNU C++17 (64) TESTS 5 15 819200
229314256 AbduLL0 C Oct. 22, 2023, 4:11 p.m. OK GNU C++17 (64) TESTS 5 15 819200
229309573 CookedMutton C Oct. 22, 2023, 3:32 p.m. OK GNU C++17 (64) TESTS 5 15 819200
229365037 Anchar_Champu C Oct. 23, 2023, 3:44 a.m. OK GNU C++17 (64) TESTS 5 15 1126400
229303952 mdtuhinhasnat C Oct. 22, 2023, 2:49 p.m. OK GNU C++17 (64) TESTS 5 30 819200
229338105 mahatabsheikh5 C Oct. 22, 2023, 7:51 p.m. OK GNU C++20 (64) TESTS 5 15 0
229320517 Better.Call.Vee C Oct. 22, 2023, 5:04 p.m. OK GNU C++20 (64) TESTS 5 15 0
229320469 pink_27 C Oct. 22, 2023, 5:04 p.m. OK GNU C++20 (64) TESTS 5 15 0
229313572 arcticfox3 C Oct. 22, 2023, 4:05 p.m. OK GNU C++20 (64) TESTS 5 15 0
229365162 munna516 C Oct. 23, 2023, 3:46 a.m. OK GNU C++20 (64) TESTS 5 15 0
229368568 001-Imanzhusip-A-2027 C Oct. 23, 2023, 4:47 a.m. OK GNU C++20 (64) TESTS 5 15 0
229371979 dark_soul9 C Oct. 23, 2023, 5:34 a.m. OK GNU C++20 (64) TESTS 5 15 0
229374236 saikumarailwar9 C Oct. 23, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 5 15 0
229355521 abdulla.bin.ah C Oct. 23, 2023, 12:16 a.m. OK GNU C++20 (64) TESTS 5 15 0
229351007 ecnerwala C Oct. 22, 2023, 9:59 p.m. OK GNU C++20 (64) TESTS 5 15 0
229300645 polsage C Oct. 22, 2023, 2:27 p.m. OK Java 11 TESTS 5 186 0
229366131 emperor_r C Oct. 23, 2023, 4:04 a.m. OK Java 11 TESTS 5 265 0
229306511 Siddharth_78 C Oct. 22, 2023, 3:08 p.m. OK Java 11 TESTS 5 327 0
229307640 chemvuong C Oct. 22, 2023, 3:17 p.m. OK Java 11 TESTS 5 327 0
229367020 Saurabh124 C Oct. 23, 2023, 4:20 a.m. OK Java 11 TESTS 5 327 0
229295434 OPyrohov C Oct. 22, 2023, 1:58 p.m. OK Java 11 TESTS 5 342 0
229308178 GnDlf99 C Oct. 22, 2023, 3:21 p.m. OK Java 11 TESTS 5 358 0
229293510 daksh_02 C Oct. 22, 2023, 1:51 p.m. OK Java 17 TESTS 5 187 204800
229333867 maxdu025 C Oct. 22, 2023, 7:06 p.m. OK Java 17 TESTS 5 218 614400
229286880 anand_mishra_ C Oct. 22, 2023, 1:02 p.m. OK Java 17 TESTS 5 233 0
229324863 mangos194 C Oct. 22, 2023, 5:43 p.m. OK Java 17 TESTS 5 233 716800
229335977 dzhi C Oct. 22, 2023, 7:28 p.m. OK Java 17 TESTS 5 265 0
229341442 NTE200705 C Oct. 22, 2023, 8:32 p.m. OK Java 17 TESTS 5 358 1024000
229287381 Techpirate_SRV C Oct. 22, 2023, 1:02 p.m. OK Java 17 TESTS 5 420 204800
229288441 mohammed.rabii C Oct. 22, 2023, 1:03 p.m. OK Java 17 TESTS 5 436 512000
229286920 Akilan_V_B C Oct. 22, 2023, 1:02 p.m. OK Java 17 TESTS 5 451 716800
229330837 vikasseervi357 C Oct. 22, 2023, 6:35 p.m. OK Java 21 TESTS 5 202 0
229369606 mehalpandkar C Oct. 23, 2023, 5:02 a.m. OK Java 21 TESTS 5 233 0
229292973 Mohamed-Hassan-Esmael C Oct. 22, 2023, 1:49 p.m. OK Java 21 TESTS 5 405 0
229301638 Satish_Rathod_ C Oct. 22, 2023, 2:33 p.m. OK Java 21 TESTS 5 436 0
229371204 prakhar_30 C Oct. 23, 2023, 5:24 a.m. OK Java 8 TESTS 5 108 0
229371299 prakhar_30 C Oct. 23, 2023, 5:25 a.m. OK Java 8 TESTS 5 109 0
229314899 arpita010 C Oct. 22, 2023, 4:16 p.m. OK Java 8 TESTS 5 124 0
229328187 formidablechief_27 C Oct. 22, 2023, 6:12 p.m. OK Java 8 TESTS 5 155 1228800
229332769 Sumitsingh7 C Oct. 22, 2023, 6:55 p.m. OK Java 8 TESTS 5 171 5836800
229306617 __Aviral__ C Oct. 22, 2023, 3:09 p.m. OK Java 8 TESTS 5 249 0
229320175 coderman2004 C Oct. 22, 2023, 5:01 p.m. OK Java 8 TESTS 5 264 0
229316289 kdprasad0036 C Oct. 22, 2023, 4:27 p.m. OK Java 8 TESTS 5 264 0
229297736 FueledByBesh C Oct. 22, 2023, 2:10 p.m. OK Java 8 TESTS 5 264 0
229358342 chengzijun_de_xiatian C Oct. 23, 2023, 1:32 a.m. OK Java 8 TESTS 5 265 0
229365349 PolarisJing C Oct. 23, 2023, 3:50 a.m. OK MS C++ 2017 TESTS 5 46 819200
229293707 RoflexKun C Oct. 22, 2023, 1:51 p.m. OK MS C++ 2017 TESTS 5 109 0
229301499 juustpush1 C Oct. 22, 2023, 2:32 p.m. OK MS C++ 2017 TESTS 5 109 819200
229350515 DonSilvio C Oct. 22, 2023, 9:48 p.m. OK MS C++ 2017 TESTS 5 124 0
229320900 richardotcom C Oct. 22, 2023, 5:08 p.m. OK MS C++ 2017 TESTS 5 124 204800
229320716 richardotcom C Oct. 22, 2023, 5:06 p.m. OK MS C++ 2017 TESTS 5 124 204800
229359120 ACmx C Oct. 23, 2023, 1:50 a.m. OK MS C++ 2017 TESTS 5 124 819200
229288050 eQuillibrium C Oct. 22, 2023, 1:03 p.m. OK MS C++ 2017 TESTS 5 140 0
229309857 iedfa C Oct. 22, 2023, 3:34 p.m. OK PyPy 3 TESTS 5 171 10035200
229293603 jvatsal0709 C Oct. 22, 2023, 1:51 p.m. OK PyPy 3 TESTS 5 233 11366400
229344271 ebesso C Oct. 22, 2023, 9:12 p.m. OK PyPy 3 TESTS 5 264 76902400
229286800 cardinaler C Oct. 22, 2023, 1:02 p.m. OK PyPy 3 TESTS 5 374 11980800
229331487 momenelmesady4803 C Oct. 22, 2023, 6:42 p.m. OK PyPy 3 TESTS 5 405 11468800
229323938 emrakul C Oct. 22, 2023, 5:35 p.m. OK PyPy 3 TESTS 5 421 11878400
229289610 Pritesh_A0 C Oct. 22, 2023, 1:04 p.m. OK PyPy 3 TESTS 5 436 13312000
229287134 darshana_s C Oct. 22, 2023, 1:02 p.m. OK PyPy 3 TESTS 5 514 12083200
229306548 okay4869 C Oct. 22, 2023, 3:08 p.m. OK PyPy 3 TESTS 5 795 15564800
229287852 Yergali C Oct. 22, 2023, 1:03 p.m. OK PyPy 3 TESTS 5 1434 10752000
229324124 rmr C Oct. 22, 2023, 5:36 p.m. OK PyPy 3-64 TESTS 5 124 16998400
229288614 ilkhom C Oct. 22, 2023, 1:04 p.m. OK PyPy 3-64 TESTS 5 155 17203200
229317110 AndreiZherder C Oct. 22, 2023, 4:35 p.m. OK PyPy 3-64 TESTS 5 155 17715200
229357834 Solaca C Oct. 23, 2023, 1:19 a.m. OK PyPy 3-64 TESTS 5 155 18944000
229314353 Too_gezer C Oct. 22, 2023, 4:11 p.m. OK PyPy 3-64 TESTS 5 155 20070400
229361216 mikeac C Oct. 23, 2023, 2:33 a.m. OK PyPy 3-64 TESTS 5 170 18022400
229338598 Azamatsh C Oct. 22, 2023, 7:56 p.m. OK PyPy 3-64 TESTS 5 187 18124800
229317588 hii_guyz C Oct. 22, 2023, 4:39 p.m. OK PyPy 3-64 TESTS 5 202 20070400
229330010 ankitesh C Oct. 22, 2023, 6:27 p.m. OK PyPy 3-64 TESTS 5 217 19046400
229368126 toshiconner C Oct. 23, 2023, 4:40 a.m. OK PyPy 3-64 TESTS 5 296 13414400
229372171 AhtheUncertainty C Oct. 23, 2023, 5:36 a.m. OK Python 3 TESTS 5 77 4096000
229356407 Akarachudra C Oct. 23, 2023, 12:42 a.m. OK Python 3 TESTS 5 77 4198400
229289390 ayushsrivastava1611 C Oct. 22, 2023, 1:04 p.m. OK Python 3 TESTS 5 109 3686400
229287881 Aidaricus C Oct. 22, 2023, 1:03 p.m. OK Python 3 TESTS 5 124 4198400
229320456 RohithKumar17998 C Oct. 22, 2023, 5:04 p.m. OK Python 3 TESTS 5 124 4300800
229320659 RohithKumar17998 C Oct. 22, 2023, 5:06 p.m. OK Python 3 TESTS 5 124 4403200
229366344 DeepJ C Oct. 23, 2023, 4:08 a.m. OK Python 3 TESTS 5 124 4505600
229346568 nikhilreddy3 C Oct. 22, 2023, 9:27 p.m. OK Python 3 TESTS 5 124 4505600
229311817 ycicada C Oct. 22, 2023, 3:50 p.m. OK Python 3 TESTS 5 124 4505600
229356903 Darclark C Oct. 23, 2023, 12:54 a.m. OK Python 3 TESTS 5 124 4915200

remove filters

Back to search problems