Codeforces Round 901 (Div. 2)

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
1875 Codeforces Round 901 (Div. 2) FINISHED False 10800 41095463 Sept. 30, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12148 ) C Jellyfish and Green Apple PROGRAMMING bitmasks greedy math number theory

B'Jellyfish has n green apple pieces. Each green apple piece weighs 1~ text{kg} . Jellyfish wants to divide these green apple pieces equally among m people. Jellyfish has a magic knife. Each time Jellyfish can choose one piece of green apple and divide it into two smaller pieces, with each piece having half the weight of the original piece. Jellyfish wants to know the minimum number of operations needed such that she can divide the green apple pieces such that the total weight of apple pieces received by each person is the same. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 2 cdot 10^4 ). The description of the test cases follows. The first and only line of each test case contains two integers, n and m ( 1 <= q n, m <= q 10^9 ) -- the number of the green apple pieces initially and the number of the people. For each test case, output a single integer -- the minimum number of operations required to divide all the green apples equally among the m people. If this cannot be achieved using a finite number of operations, output -1 instead. In the first test case, we do not need to divide the apple pieces. Each person will receive 2 pieces of 1~ text{kg} and the total weight of apple pieces received by each person is 2~ text{kg} . In the second test case, it is impossible to divide the apple equally using a finite number of operations. In the third test case, we can divide two of the apple pieces of weight 1~ text{kg} , getting 4 apple pieces of weight 0.5~ text{kg} . Each person will receive 1 apple piece of weight 0.5~ text{kg} and 2 apple pieces of weight 1~ text{kg} . The total weight of apple pieces received by each person is 2.5~ text{kg} . In the fourth test case, we first divide all 3 of the apple pieces of weight 1~ text{kg} , getting 6 pieces of weight 0.5~ '...

Tutorials

Codeforces Round 901 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
226104231 lapalace_twice C Oct. 1, 2023, 4:04 a.m. OK Clang++17 Diagnostics TESTS 20 358 0
226059837 NenadDapic C Sept. 30, 2023, 5:28 p.m. OK FPC TESTS 20 93 102400
226075036 iffatul_anon C Sept. 30, 2023, 7:19 p.m. OK GNU C11 TESTS 20 109 0
226075063 iffatul_anon C Sept. 30, 2023, 7:20 p.m. OK GNU C11 TESTS 20 109 0
226075190 iffatul_anon C Sept. 30, 2023, 7:21 p.m. OK GNU C11 TESTS 20 109 0
226101486 hshhh_ C Oct. 1, 2023, 3:25 a.m. OK GNU C11 TESTS 20 109 204800
226074996 iffatul_anon C Sept. 30, 2023, 7:19 p.m. OK GNU C11 TESTS 20 124 0
226060094 razv C Sept. 30, 2023, 5:28 p.m. OK GNU C11 TESTS 20 124 0
226074975 iffatul_anon C Sept. 30, 2023, 7:19 p.m. OK GNU C11 TESTS 20 140 0
226074928 iffatul_anon C Sept. 30, 2023, 7:18 p.m. OK GNU C11 TESTS 20 156 0
226082287 notpiroAG C Sept. 30, 2023, 8:41 p.m. OK GNU C11 TESTS 20 187 0
226103438 ShenQing C Oct. 1, 2023, 3:52 a.m. OK GNU C++14 TESTS 20 31 0
226112982 Viraj_1812 C Oct. 1, 2023, 5:53 a.m. OK GNU C++14 TESTS 20 31 0
226108088 zyxawa C Oct. 1, 2023, 4:57 a.m. OK GNU C++14 TESTS 20 31 0
226107965 whale142857 C Oct. 1, 2023, 4:55 a.m. OK GNU C++14 TESTS 20 31 0
226104747 GreenWhale C Oct. 1, 2023, 4:11 a.m. OK GNU C++14 TESTS 20 31 0
226102084 ant2010 C Oct. 1, 2023, 3:33 a.m. OK GNU C++14 TESTS 20 31 0
226101935 vector_1 C Oct. 1, 2023, 3:31 a.m. OK GNU C++14 TESTS 20 31 0
226098943 zyxawa C Oct. 1, 2023, 2:44 a.m. OK GNU C++14 TESTS 20 31 0
226098896 zyxawa C Oct. 1, 2023, 2:44 a.m. OK GNU C++14 TESTS 20 31 0
226098457 dhyNightWind0311 C Oct. 1, 2023, 2:36 a.m. OK GNU C++14 TESTS 20 31 0
226104647 Sleekassassin C Oct. 1, 2023, 4:10 a.m. OK GNU C++17 TESTS 20 31 0
226104693 devangsvaghani C Oct. 1, 2023, 4:11 a.m. OK GNU C++17 TESTS 20 31 0
226105255 zozoto C Oct. 1, 2023, 4:18 a.m. OK GNU C++17 TESTS 20 31 0
226106486 ziqwx C Oct. 1, 2023, 4:35 a.m. OK GNU C++17 TESTS 20 31 0
226104612 Sleekassassin C Oct. 1, 2023, 4:09 a.m. OK GNU C++17 TESTS 20 31 0
226107550 yashverma03 C Oct. 1, 2023, 4:50 a.m. OK GNU C++17 TESTS 20 31 0
226110380 5-gon C Oct. 1, 2023, 5:24 a.m. OK GNU C++17 TESTS 20 31 0
226112136 _gxh C Oct. 1, 2023, 5:43 a.m. OK GNU C++17 TESTS 20 31 0
226112647 Jahid_Hasan10 C Oct. 1, 2023, 5:49 a.m. OK GNU C++17 TESTS 20 31 0
226113684 ssbhardwaj C Oct. 1, 2023, 5:59 a.m. OK GNU C++17 TESTS 20 31 0
226059166 daud04 C Sept. 30, 2023, 5:26 p.m. OK GNU C++17 (64) TESTS 20 30 0
226073139 yug_tyagi C Sept. 30, 2023, 7:03 p.m. OK GNU C++17 (64) TESTS 20 30 0
226055864 AhsanulHoqueAbir C Sept. 30, 2023, 5:17 p.m. OK GNU C++17 (64) TESTS 20 30 0
226102987 mostafasazid C Oct. 1, 2023, 3:46 a.m. OK GNU C++17 (64) TESTS 20 31 0
226093373 Aryan20022003 C Oct. 1, 2023, 12:58 a.m. OK GNU C++17 (64) TESTS 20 31 0
226113834 harshsonkar C Oct. 1, 2023, 6:01 a.m. OK GNU C++17 (64) TESTS 20 31 0
226111965 Ackhava C Oct. 1, 2023, 5:41 a.m. OK GNU C++17 (64) TESTS 20 31 0
226110749 Followall C Oct. 1, 2023, 5:28 a.m. OK GNU C++17 (64) TESTS 20 31 0
226106900 fairy_land C Oct. 1, 2023, 4:41 a.m. OK GNU C++17 (64) TESTS 20 31 0
226097064 wuzihan C Oct. 1, 2023, 2:14 a.m. OK GNU C++17 (64) TESTS 20 31 0
226082338 peltorator C Sept. 30, 2023, 8:41 p.m. OK GNU C++20 (64) TESTS 20 15 0
226108304 Mohamed_Tamer169 C Oct. 1, 2023, 5 a.m. OK GNU C++20 (64) TESTS 20 15 0
226103368 Fiatiustitia C Oct. 1, 2023, 3:51 a.m. OK GNU C++20 (64) TESTS 20 15 0
226101521 yl_neo C Oct. 1, 2023, 3:25 a.m. OK GNU C++20 (64) TESTS 20 15 0
226101378 lh_118 C Oct. 1, 2023, 3:23 a.m. OK GNU C++20 (64) TESTS 20 15 0
226091245 Hassan_Fouad C Sept. 30, 2023, 11:55 p.m. OK GNU C++20 (64) TESTS 20 15 0
226090210 Cristian_MCG C Sept. 30, 2023, 11:23 p.m. OK GNU C++20 (64) TESTS 20 15 0
226067832 anjkk01 C Sept. 30, 2023, 6:27 p.m. OK GNU C++20 (64) TESTS 20 15 0
226067385 1046654833 C Sept. 30, 2023, 6:25 p.m. OK GNU C++20 (64) TESTS 20 15 0
226066922 vicky_raj C Sept. 30, 2023, 6:23 p.m. OK GNU C++20 (64) TESTS 20 15 0
226071673 purrrrrr C Sept. 30, 2023, 6:51 p.m. OK Go TESTS 20 233 6656000
226113146 wdjuruo C Oct. 1, 2023, 5:54 a.m. OK Java 11 TESTS 20 187 0
226090771 polsage C Sept. 30, 2023, 11:40 p.m. OK Java 11 TESTS 20 187 0
226079936 polsage C Sept. 30, 2023, 8:12 p.m. OK Java 11 TESTS 20 218 0
226079779 polsage C Sept. 30, 2023, 8:10 p.m. OK Java 11 TESTS 20 233 0
226068967 _habibur_rahman C Sept. 30, 2023, 6:33 p.m. OK Java 11 TESTS 20 234 0
226079912 polsage C Sept. 30, 2023, 8:12 p.m. OK Java 11 TESTS 20 249 0
226056672 dark_rays C Sept. 30, 2023, 5:19 p.m. OK Java 11 TESTS 20 265 0
226068809 _habibur_rahman C Sept. 30, 2023, 6:32 p.m. OK Java 11 TESTS 20 280 0
226054457 Vikas_Ahlawat C Sept. 30, 2023, 5:13 p.m. OK Java 11 TESTS 20 358 0
226074923 PlayDate C Sept. 30, 2023, 7:18 p.m. OK Java 11 TESTS 20 405 0
226061478 KAZHYI C Sept. 30, 2023, 5:31 p.m. OK Java 17 TESTS 20 202 512000
226109914 anacharsis C Oct. 1, 2023, 5:19 a.m. OK Java 17 TESTS 20 202 716800
226102434 Harwinvanak C Oct. 1, 2023, 3:38 a.m. OK Java 17 TESTS 20 217 204800
226074174 himanshu19468 C Sept. 30, 2023, 7:12 p.m. OK Java 17 TESTS 20 218 512000
226088692 Harwinvanak C Sept. 30, 2023, 10:41 p.m. OK Java 17 TESTS 20 218 716800
226058271 SamyajitDas C Sept. 30, 2023, 5:23 p.m. OK Java 17 TESTS 20 233 307200
226075869 Pratham2908 C Sept. 30, 2023, 7:28 p.m. OK Java 17 TESTS 20 233 614400
226090968 Harwinvanak C Sept. 30, 2023, 11:46 p.m. OK Java 17 TESTS 20 233 716800
226075089 tushar19280 C Sept. 30, 2023, 7:20 p.m. OK Java 17 TESTS 20 296 40960000
226076049 Swilled7 C Sept. 30, 2023, 7:30 p.m. OK Java 17 TESTS 20 373 1126400
226067055 v3n1v1c11v1c1 C Sept. 30, 2023, 6:24 p.m. OK Java 21 TESTS 20 218 0
226098250 priyaroy3370 C Oct. 1, 2023, 2:33 a.m. OK Java 8 TESTS 20 140 0
226098203 priyaroy3370 C Oct. 1, 2023, 2:32 a.m. OK Java 8 TESTS 20 140 0
226056766 r3hab.rs C Sept. 30, 2023, 5:20 p.m. OK Java 8 TESTS 20 140 0
226092142 mohamedhassan_c C Oct. 1, 2023, 12:23 a.m. OK Java 8 TESTS 20 140 5836800
226098090 priyaroy3370 C Oct. 1, 2023, 2:31 a.m. OK Java 8 TESTS 20 156 0
226091967 mohamedhassan_c C Oct. 1, 2023, 12:18 a.m. OK Java 8 TESTS 20 156 5836800
226091912 mohamedhassan_c C Oct. 1, 2023, 12:17 a.m. OK Java 8 TESTS 20 186 5836800
226091901 mohamedhassan_c C Oct. 1, 2023, 12:17 a.m. OK Java 8 TESTS 20 187 5836800
226086415 PassedPawn C Sept. 30, 2023, 9:51 p.m. OK Java 8 TESTS 20 234 0
226057631 American_Eagle C Sept. 30, 2023, 5:22 p.m. OK Java 8 TESTS 20 280 0
226073898 mh__mh C Sept. 30, 2023, 7:09 p.m. OK PyPy 3 TESTS 20 218 9420800
226071342 mh__mh C Sept. 30, 2023, 6:49 p.m. OK PyPy 3 TESTS 20 233 9523200
226073987 mh__mh C Sept. 30, 2023, 7:10 p.m. OK PyPy 3 TESTS 20 249 9625600
226055930 vinayaksharma20715 C Sept. 30, 2023, 5:17 p.m. OK PyPy 3 TESTS 20 514 9523200
226056039 dylantheradboss C Sept. 30, 2023, 5:18 p.m. OK PyPy 3 TESTS 20 561 9830400
226060739 KINFISH C Sept. 30, 2023, 5:30 p.m. OK PyPy 3 TESTS 20 639 10035200
226095826 DRDIV C Oct. 1, 2023, 1:52 a.m. OK PyPy 3 TESTS 20 655 10035200
226088897 momenelmesady4803 C Sept. 30, 2023, 10:47 p.m. OK PyPy 3 TESTS 20 920 10342400
226088538 khalit7 C Sept. 30, 2023, 10:38 p.m. OK PyPy 3-64 TESTS 20 124 9830400
226067673 CinaDor C Sept. 30, 2023, 6:26 p.m. OK PyPy 3-64 TESTS 20 139 9728000
226088365 Kladrr C Sept. 30, 2023, 10:33 p.m. OK PyPy 3-64 TESTS 20 140 9523200
226088510 khalit7 C Sept. 30, 2023, 10:37 p.m. OK PyPy 3-64 TESTS 20 140 10342400
226074086 ossau_guildo C Sept. 30, 2023, 7:11 p.m. OK PyPy 3-64 TESTS 20 155 9318400
226074326 Mohamed_Hamed C Sept. 30, 2023, 7:13 p.m. OK PyPy 3-64 TESTS 20 155 9523200
226071382 Mohamed_Hamed C Sept. 30, 2023, 6:49 p.m. OK PyPy 3-64 TESTS 20 155 9523200
226059456 codeTester9487 C Sept. 30, 2023, 5:27 p.m. OK PyPy 3-64 TESTS 20 155 9523200
226111563 gardengnome C Oct. 1, 2023, 5:37 a.m. OK PyPy 3-64 TESTS 20 155 10137600
226059392 npl_27 C Sept. 30, 2023, 5:26 p.m. OK PyPy 3-64 TESTS 20 155 10240000
226058160 sagamantus C Sept. 30, 2023, 5:23 p.m. OK Python 3 TESTS 20 140 307200
226054499 KartikChhipa C Sept. 30, 2023, 5:13 p.m. OK Python 3 TESTS 20 217 0
226070066 Deecey01 C Sept. 30, 2023, 6:40 p.m. OK Python 3 TESTS 20 218 307200
226094034 VioletVal C Oct. 1, 2023, 1:15 a.m. OK Python 3 TESTS 20 249 0
226092965 VioletVal C Oct. 1, 2023, 12:48 a.m. OK Python 3 TESTS 20 249 0
226055070 Puspak-Sahu C Sept. 30, 2023, 5:15 p.m. OK Python 3 TESTS 20 249 0
226053903 kori_123 C Sept. 30, 2023, 5:12 p.m. OK Python 3 TESTS 20 249 0
226053829 tarun_7 C Sept. 30, 2023, 5:12 p.m. OK Python 3 TESTS 20 280 0
226057060 ssafty C Sept. 30, 2023, 5:20 p.m. OK Python 3 TESTS 20 296 0
226055101 ONLY_ANAS C Sept. 30, 2023, 5:15 p.m. OK Python 3 TESTS 20 311 0

remove filters

Back to search problems