Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round)

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
1877 Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round) FINISHED False 9000 35067299 Oct. 8, 2023, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11146 ) C Joyboard PROGRAMMING math number theory

B'Chaneka, a gamer kid, invented a new gaming controller called joyboard. Interestingly, the joyboard she invented can only be used to play one game. The joyboard has a screen containing n+1 slots numbered from 1 to n+1 from left to right. The n+1 slots are going to be filled with an array of non-negative integers [a_1,a_2,a_3, ldots,a_{n+1}] . Chaneka, as the player, must assign a_{n+1} with an integer between 0 and m inclusive. Then, for each i from n to 1 , the value of a_i will be equal to the remainder of dividing a_{i+1} (the adjacent value to the right) by i . In other words, a_i = a_{i + 1} bmod i . Chaneka wants it such that after every slot is assigned with an integer, there are exactly k distinct values in the entire screen (among all n+1 slots). How many valid ways are there for assigning a non-negative integer into slot n+1 ? Each test contains multiple test cases. The first line contains an integer t ( 1 <= q t <= q 2 cdot10^4 ) -- the number of test cases. The following lines contain the description of each test case. The only line of each test case contains three integers n , m , and k ( 1 <= q n <= q 10^9 ; 0 <= q m <= q 10^9 ; 1 <= q k <= q n+1 ) -- there are n+1 slots, the integer assigned in slot n+1 must not be bigger than m , and there should be exactly k distinct values. For each test case, output a line containing an integer representing the number of valid ways for assigning a non-negative integer into slot n+1 . In the first test case, one of the 2 possible ways for Chaneka is to choose a_{n+1}=6 . If she does that, then: In the second test case, the 1 possible way for Chaneka is to choose a_{n+1}=0 . If she does that, then a = [0, 0, 0] . There is only 1 distinct value. In the third test case, there is no possible way for assig'...

Tutorials

Codeforces Round #902 (Div. 1, Div. 2, based on COMPFEST 15 — Final Round) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
227193715 Derato C Oct. 8, 2023, 12:45 p.m. OK C# 10 TESTS 15 77 3174400
227193353 Derato C Oct. 8, 2023, 12:43 p.m. OK C# 10 TESTS 15 265 3276800
227248462 NenadDapic C Oct. 8, 2023, 7:57 p.m. OK FPC TESTS 15 78 102400
227176713 naniore_x_CLHS C Oct. 8, 2023, 11:07 a.m. OK FPC TESTS 15 93 102400
227186729 THK_is_dead C Oct. 8, 2023, 11:34 a.m. OK GNU C11 TESTS 15 109 0
227228655 fugah271202 C Oct. 8, 2023, 4:53 p.m. OK GNU C11 TESTS 15 109 0
227180786 gargi_shroff C Oct. 8, 2023, 11:19 a.m. OK GNU C11 TESTS 15 109 0
227269539 microperson C Oct. 9, 2023, 3:47 a.m. OK GNU C++14 TESTS 15 15 0
227266078 CyberDog C Oct. 9, 2023, 2:36 a.m. OK GNU C++14 TESTS 15 15 0
227184234 Communismfighter C Oct. 8, 2023, 11:28 a.m. OK GNU C++14 TESTS 15 15 2150400
227182128 p0811iyer C Oct. 8, 2023, 11:23 a.m. OK GNU C++14 TESTS 15 30 0
227175590 cjh2018 C Oct. 8, 2023, 11:04 a.m. OK GNU C++14 TESTS 15 30 0
227269071 aCssen C Oct. 9, 2023, 3:38 a.m. OK GNU C++14 TESTS 15 31 0
227267083 abcDDdddd C Oct. 9, 2023, 2:59 a.m. OK GNU C++14 TESTS 15 31 0
227272150 dorayxy C Oct. 9, 2023, 4:33 a.m. OK GNU C++14 TESTS 15 31 0
227276089 jiang_feng C Oct. 9, 2023, 5:32 a.m. OK GNU C++14 TESTS 15 31 0
227277964 WXYZ23242526 C Oct. 9, 2023, 5:57 a.m. OK GNU C++14 TESTS 15 31 0
227175744 Vivi_zhaojingqi C Oct. 8, 2023, 11:04 a.m. OK GNU C++17 TESTS 15 30 0
227272129 notCF_c0der C Oct. 9, 2023, 4:33 a.m. OK GNU C++17 TESTS 15 31 0
227270736 AKumar666 C Oct. 9, 2023, 4:10 a.m. OK GNU C++17 TESTS 15 31 0
227270064 _Roronoa_Zoro C Oct. 9, 2023, 3:58 a.m. OK GNU C++17 TESTS 15 31 0
227269659 Shermes C Oct. 9, 2023, 3:50 a.m. OK GNU C++17 TESTS 15 31 0
227268878 quangminh64 C Oct. 9, 2023, 3:34 a.m. OK GNU C++17 TESTS 15 31 0
227268667 gvd_112358 C Oct. 9, 2023, 3:30 a.m. OK GNU C++17 TESTS 15 31 0
227276261 abhinav4279 C Oct. 9, 2023, 5:35 a.m. OK GNU C++17 TESTS 15 31 0
227277344 yashk_1511 C Oct. 9, 2023, 5:50 a.m. OK GNU C++17 TESTS 15 31 0
227277309 dont93592 C Oct. 9, 2023, 5:50 a.m. OK GNU C++17 TESTS 15 31 0
227186542 icefake C Oct. 8, 2023, 11:34 a.m. OK GNU C++17 (64) TESTS 15 15 0
227184505 randomlelouch_ C Oct. 8, 2023, 11:29 a.m. OK GNU C++17 (64) TESTS 15 30 0
227271946 uxinglaohu C Oct. 9, 2023, 4:31 a.m. OK GNU C++17 (64) TESTS 15 30 0
227218396 Once_I_Liked_AGirl C Oct. 8, 2023, 3:32 p.m. OK GNU C++17 (64) TESTS 15 30 0
227179601 Bright_moonlight_6 C Oct. 8, 2023, 11:15 a.m. OK GNU C++17 (64) TESTS 15 30 1638400
227225218 AceKnight7 C Oct. 8, 2023, 4:25 p.m. OK GNU C++17 (64) TESTS 15 30 4812800
227179313 Destructor_1091 C Oct. 8, 2023, 11:15 a.m. OK GNU C++17 (64) TESTS 15 30 4812800
227183424 wlh666 C Oct. 8, 2023, 11:26 a.m. OK GNU C++17 (64) TESTS 15 30 7987200
227267036 FloatingOcean C Oct. 9, 2023, 2:58 a.m. OK GNU C++17 (64) TESTS 15 31 0
227276259 Maveriiik C Oct. 9, 2023, 5:35 a.m. OK GNU C++17 (64) TESTS 15 31 0
227270954 binary_bae C Oct. 9, 2023, 4:14 a.m. OK GNU C++20 (64) TESTS 15 15 0
227266878 minhvu08kt C Oct. 9, 2023, 2:54 a.m. OK GNU C++20 (64) TESTS 15 15 0
227264824 sxsygz C Oct. 9, 2023, 2:08 a.m. OK GNU C++20 (64) TESTS 15 15 0
227261871 solitude3freedom C Oct. 9, 2023, 12:57 a.m. OK GNU C++20 (64) TESTS 15 15 0
227260895 BuddhaBarFans C Oct. 9, 2023, 12:28 a.m. OK GNU C++20 (64) TESTS 15 15 0
227260817 Setsuna C Oct. 9, 2023, 12:27 a.m. OK GNU C++20 (64) TESTS 15 15 0
227258658 UNTITLED0 C Oct. 8, 2023, 11:16 p.m. OK GNU C++20 (64) TESTS 15 15 0
227277634 zafucowhorse C Oct. 9, 2023, 5:54 a.m. OK GNU C++20 (64) TESTS 15 15 0
227277532 tsk101 C Oct. 9, 2023, 5:53 a.m. OK GNU C++20 (64) TESTS 15 15 0
227274815 remiriya C Oct. 9, 2023, 5:14 a.m. OK GNU C++20 (64) TESTS 15 15 0
227184075 kiruxan C Oct. 8, 2023, 11:28 a.m. OK Go TESTS 15 93 4300800
227228617 glebsamsonov C Oct. 8, 2023, 4:52 p.m. OK Go TESTS 15 109 921600
227224440 katomasao C Oct. 8, 2023, 4:19 p.m. OK Haskell TESTS 15 46 1024000
227175619 WORTH C Oct. 8, 2023, 11:04 a.m. OK Java 11 TESTS 15 186 0
227205387 themadknight45 C Oct. 8, 2023, 2:01 p.m. OK Java 11 TESTS 15 187 0
227177722 _.aadi01 C Oct. 8, 2023, 11:10 a.m. OK Java 11 TESTS 15 202 0
227177790 sharnittest C Oct. 8, 2023, 11:10 a.m. OK Java 11 TESTS 15 217 0
227181495 Kishansingh47 C Oct. 8, 2023, 11:21 a.m. OK Java 11 TESTS 15 312 0
227232834 Dobrii_Gnoms_Father C Oct. 8, 2023, 5:28 p.m. OK Java 11 TESTS 15 436 0
227177536 Uncle_Eddie C Oct. 8, 2023, 11:10 a.m. OK Java 11 TESTS 15 452 0
227182082 one_line C Oct. 8, 2023, 11:22 a.m. OK Java 17 TESTS 15 202 307200
227181115 aishwarykesarwani C Oct. 8, 2023, 11:20 a.m. OK Java 17 TESTS 15 249 0
227209682 sid234890 C Oct. 8, 2023, 2:32 p.m. OK Java 17 TESTS 15 249 614400
227272992 ac686 C Oct. 9, 2023, 4:46 a.m. OK Java 17 TESTS 15 295 819200
227264055 dilshar23 C Oct. 9, 2023, 1:50 a.m. OK Java 17 TESTS 15 296 307200
227195620 AKhacks C Oct. 8, 2023, 12:56 p.m. OK Java 17 TESTS 15 343 307200
227183790 yaroslavspid2 C Oct. 8, 2023, 11:27 a.m. OK Java 17 TESTS 15 389 716800
227182741 rutul21 C Oct. 8, 2023, 11:24 a.m. OK Java 17 TESTS 15 389 921600
227269716 emme C Oct. 9, 2023, 3:51 a.m. OK Java 17 TESTS 15 404 614400
227185783 Kishan_143 C Oct. 8, 2023, 11:32 a.m. OK Java 17 TESTS 15 405 614400
227184431 d2s2 C Oct. 8, 2023, 11:29 a.m. OK Java 21 TESTS 15 217 0
227268884 Ligh0x74 C Oct. 9, 2023, 3:34 a.m. OK Java 21 TESTS 15 218 0
227262286 Ligh0x74 C Oct. 9, 2023, 1:07 a.m. OK Java 21 TESTS 15 218 0
227199570 Nagendravarma C Oct. 8, 2023, 1:21 p.m. OK Java 21 TESTS 15 295 0
227200046 Nagendravarma C Oct. 8, 2023, 1:24 p.m. OK Java 21 TESTS 15 327 0
227177128 r3hab.rs C Oct. 8, 2023, 11:08 a.m. OK Java 8 TESTS 15 124 0
227193335 safarisoul C Oct. 8, 2023, 12:43 p.m. OK Java 8 TESTS 15 140 0
227176280 clcwcxfwf C Oct. 8, 2023, 11:06 a.m. OK Java 8 TESTS 15 140 0
227193736 formidablechief_27 C Oct. 8, 2023, 12:45 p.m. OK Java 8 TESTS 15 155 0
227232115 zadafiya610 C Oct. 8, 2023, 5:22 p.m. OK Java 8 TESTS 15 343 0
227202186 NimiSora C Oct. 8, 2023, 1:38 p.m. OK Java 8 TESTS 15 343 0
227176864 NimiSora C Oct. 8, 2023, 11:07 a.m. OK Java 8 TESTS 15 358 0
227176386 b1t_exe C Oct. 8, 2023, 11:06 a.m. OK Java 8 TESTS 15 374 0
227220513 YMSeah C Oct. 8, 2023, 3:47 p.m. OK JavaScript TESTS 15 62 2560000
227212763 y4n9b0 C Oct. 8, 2023, 2:52 p.m. OK Kotlin 1.7 TESTS 15 655 22835200
227178482 DiabloX777 C Oct. 8, 2023, 11:12 a.m. OK Kotlin 1.7 TESTS 15 702 31129600
227220400 gelbelachente C Oct. 8, 2023, 3:46 p.m. OK Kotlin 1.7 TESTS 15 794 46592000
227242752 Alexit C Oct. 8, 2023, 6:54 p.m. OK MS C++ 2017 TESTS 15 124 0
227229186 chayan.surana3 C Oct. 8, 2023, 4:57 p.m. OK MS C++ 2017 TESTS 15 124 0
227258094 xiaoping3418 C Oct. 8, 2023, 10:58 p.m. OK MS C++ 2017 TESTS 15 139 0
227181133 Pepege C Oct. 8, 2023, 11:20 a.m. OK MS C++ 2017 TESTS 15 139 0
227179248 NT-GEEK C Oct. 8, 2023, 11:14 a.m. OK MS C++ 2017 TESTS 15 140 0
227179000 maosheng C Oct. 8, 2023, 11:14 a.m. OK MS C++ 2017 TESTS 15 155 0
227179014 Ravitosh C Oct. 8, 2023, 11:14 a.m. OK MS C++ 2017 TESTS 15 156 0
227231800 DRDIV C Oct. 8, 2023, 5:19 p.m. OK PyPy 3 TESTS 15 186 6758400
227184602 lapras100 C Oct. 8, 2023, 11:29 a.m. OK PyPy 3 TESTS 15 202 8806400
227175995 gs33 C Oct. 8, 2023, 11:05 a.m. OK PyPy 3 TESTS 15 249 6041600
227238886 momenelmesady4803 C Oct. 8, 2023, 6:18 p.m. OK PyPy 3 TESTS 15 436 8396800
227176697 Ashasha C Oct. 8, 2023, 11:07 a.m. OK PyPy 3 TESTS 15 451 8908800
227259733 l0stempl3 C Oct. 8, 2023, 11:53 p.m. OK PyPy 3-64 TESTS 15 77 4710400
227209486 Non-origination C Oct. 8, 2023, 2:30 p.m. OK PyPy 3-64 TESTS 15 124 9420800
227259646 RobinFromTheHood C Oct. 8, 2023, 11:51 p.m. OK PyPy 3-64 TESTS 15 124 9830400
227234248 MdAbedin C Oct. 8, 2023, 5:39 p.m. OK PyPy 3-64 TESTS 15 140 9728000
227222560 6paths C Oct. 8, 2023, 4:04 p.m. OK PyPy 3-64 TESTS 15 140 9932800
227179173 Imeon C Oct. 8, 2023, 11:14 a.m. OK PyPy 3-64 TESTS 15 140 10035200
227224115 Arpia C Oct. 8, 2023, 4:16 p.m. OK PyPy 3-64 TESTS 15 155 9523200
227175761 kidus72 C Oct. 8, 2023, 11:04 a.m. OK PyPy 3-64 TESTS 15 155 9932800
227213701 yuki_keshiki C Oct. 8, 2023, 2:59 p.m. OK PyPy 3-64 TESTS 15 155 10035200
227185865 kibr C Oct. 8, 2023, 11:32 a.m. OK PyPy 3-64 TESTS 15 155 10240000
227245245 daszybak C Oct. 8, 2023, 7:19 p.m. OK Python 3 TESTS 15 77 1331200
227211253 pennymagic156 C Oct. 8, 2023, 2:42 p.m. OK Python 3 TESTS 15 78 307200
227181908 supark C Oct. 8, 2023, 11:22 a.m. OK Python 3 TESTS 15 93 614400
227175986 Trainer_Marvin C Oct. 8, 2023, 11:05 a.m. OK Python 3 TESTS 15 93 1228800
227246571 Khaled-Ramadan C Oct. 8, 2023, 7:34 p.m. OK Python 3 TESTS 15 171 0
227218116 Volodya_Dudchak C Oct. 8, 2023, 3:30 p.m. OK Python 3 TESTS 15 186 0
227203709 proguy20211510 C Oct. 8, 2023, 1:49 p.m. OK Python 3 TESTS 15 186 0
227196686 ___a_s_1_2___ C Oct. 8, 2023, 1:03 p.m. OK Python 3 TESTS 15 186 0
227196587 Rashed. C Oct. 8, 2023, 1:02 p.m. OK Python 3 TESTS 15 186 0
227185005 not_ankit C Oct. 8, 2023, 11:30 a.m. OK Python 3 TESTS 15 186 0
227223115 Rajveer_100 C Oct. 8, 2023, 4:08 p.m. OK Rust 2021 TESTS 15 31 0
227208353 sky C Oct. 8, 2023, 2:22 p.m. OK Rust 2021 TESTS 15 31 0

remove filters

Back to search problems