Codeforces Round 874 (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
1833 Codeforces Round 874 (Div. 3) FINISHED False 8100 52759463 May 19, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7791 ) F Ira and Flamenco PROGRAMMING combinatorics data structures implementation sortings

B'Ira loves Spanish flamenco dance very much. She decided to start her own dance studio and found n students, i th of whom has level a_i . Ira can choose several of her students and set a dance with them. So she can set a huge number of dances, but she is only interested in magnificent dances. The dance is called magnificent if the following is true: For example, if m = 3 and a = [4, 2, 2, 3, 6] , the following dances are magnificent (students participating in the dance are highlighted in red): [ color{red}{4}, 2, color{red}{2}, color{red}{3}, 6] , [ color{red}{4}, color{red}{2}, 2, color{red}{3}, 6] . At the same time dances [ color{red}{4}, 2, 2, color{red}{3}, 6] , [4, color{red}{2}, color{red}{2}, color{red}{3}, 6] , [ color{red}{4}, 2, 2, color{red}{3}, color{red}{6}] are not magnificent. In the dance [ color{red}{4}, 2, 2, color{red}{3}, 6] only 2 students participate, although m = 3 . The dance [4, color{red}{2}, color{red}{2}, color{red}{3}, 6] involves students with levels 2 and 2 , although levels of all dancers must be pairwise distinct. In the dance [ color{red}{4}, 2, 2, color{red}{3}, color{red}{6}] students with levels 3 and 6 participate, but |3 - 6| = 3 , although m = 3 . Help Ira count the number of magnificent dances that she can set. Since this number can be very large, count it modulo 10^9 + 7 . Two dances are considered different if the sets of students participating in them are different. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- number of testcases. The first line of each testcase contains integers n and m ( 1 <= m <= n <= 2 cdot 10^5 ) -- the number of Ira students and the number of dancers in the magnificent dance. The second line of each testcase contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- levels o'...

Tutorials

116636

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
206576710 mban259 F May 20, 2023, 12:29 a.m. OK C# 10 TESTS 17 248 44441600
206535577 ruban F May 19, 2023, 4:32 p.m. OK Delphi TESTS 14 1060 205414400
206540267 CaveNightingale F May 19, 2023, 4:43 p.m. OK GNU C11 TESTS 14 93 4812800
206538128 wixx F May 19, 2023, 4:38 p.m. OK GNU C++14 TESTS 14 62 7270400
206539459 Just_a_dude F May 19, 2023, 4:41 p.m. OK GNU C++14 TESTS 14 78 2457600
206545590 Zero_Skillz_999 F May 19, 2023, 4:57 p.m. OK GNU C++14 TESTS 14 78 4812800
206539810 jiangzhihui F May 19, 2023, 4:42 p.m. OK GNU C++14 TESTS 14 93 3174400
206536131 Ismail_Alrifai F May 19, 2023, 4:33 p.m. OK GNU C++14 TESTS 14 109 5632000
206539127 Osama_SaIeh F May 19, 2023, 4:40 p.m. OK GNU C++14 TESTS 14 109 9113600
206548083 sanchitjain333 F May 19, 2023, 5:12 p.m. OK GNU C++14 TESTS 14 155 7987200
206539638 lhzzzzzy F May 19, 2023, 4:41 p.m. OK GNU C++14 TESTS 14 156 2457600
206577566 Shui_Dream F May 20, 2023, 12:57 a.m. OK GNU C++14 TESTS 17 156 5632000
206577751 gerard.onats F May 20, 2023, 1:03 a.m. OK GNU C++14 TESTS 17 156 8192000
206546343 9-9 F May 19, 2023, 5:01 p.m. OK GNU C++17 TESTS 14 62 3993600
206534026 guytan F May 19, 2023, 4:28 p.m. OK GNU C++17 TESTS 14 77 3993600
206546969 9-9 F May 19, 2023, 5:05 p.m. OK GNU C++17 TESTS 14 77 3993600
206547943 Jamik F May 19, 2023, 5:11 p.m. OK GNU C++17 TESTS 14 77 4403200
206540968 beeeeeeeeeeee F May 19, 2023, 4:44 p.m. OK GNU C++17 TESTS 14 78 3788800
206565509 stash F May 19, 2023, 7:45 p.m. OK GNU C++17 TESTS 14 93 1638400
206572633 fakedAC F May 19, 2023, 10:06 p.m. OK GNU C++17 TESTS 17 93 4915200
206555250 Dominater069 F May 19, 2023, 5:46 p.m. OK GNU C++17 TESTS 14 93 8601600
206546898 lyfdxh F May 19, 2023, 5:04 p.m. OK GNU C++17 TESTS 14 108 6656000
206535867 yoyoboyss F May 19, 2023, 4:33 p.m. OK GNU C++17 TESTS 14 109 1228800
206538626 tnaito F May 19, 2023, 4:39 p.m. OK GNU C++17 (64) TESTS 14 61 9011200
206538615 1250713087 F May 19, 2023, 4:39 p.m. OK GNU C++17 (64) TESTS 14 62 13824000
206534151 luckyblock233 F May 19, 2023, 4:29 p.m. OK GNU C++17 (64) TESTS 14 78 3891200
206574113 enslaved F May 19, 2023, 10:53 p.m. OK GNU C++17 (64) TESTS 17 78 5324800
206540059 Gozheva F May 19, 2023, 4:42 p.m. OK GNU C++17 (64) TESTS 14 78 10444800
206561533 Proofy F May 19, 2023, 6:53 p.m. OK GNU C++17 (64) TESTS 14 93 5017600
206552582 goege F May 19, 2023, 5:21 p.m. OK GNU C++17 (64) TESTS 14 93 32153600
206554467 HossamHero7 F May 19, 2023, 5:38 p.m. OK GNU C++17 (64) TESTS 14 109 11571200
206575835 Rania F May 19, 2023, 11:56 p.m. OK GNU C++17 (64) TESTS 17 109 15667200
206555352 sarwar_ F May 19, 2023, 5:47 p.m. OK GNU C++17 (64) TESTS 14 124 12902400
206577312 mehrunesartem F May 20, 2023, 12:50 a.m. OK GNU C++20 (64) TESTS 17 46 2457600
206538154 TooManyMind F May 19, 2023, 4:38 p.m. OK GNU C++20 (64) TESTS 14 46 4710400
206553888 Catee F May 19, 2023, 5:33 p.m. OK GNU C++20 (64) TESTS 14 46 5017600
206538338 visitpage F May 19, 2023, 4:38 p.m. OK GNU C++20 (64) TESTS 14 46 5017600
206535334 sukabulie F May 19, 2023, 4:31 p.m. OK GNU C++20 (64) TESTS 14 61 6451200
206539300 Thanhs F May 19, 2023, 4:41 p.m. OK GNU C++20 (64) TESTS 14 62 4812800
206556486 c9a2hainguyen F May 19, 2023, 5:58 p.m. OK GNU C++20 (64) TESTS 14 62 5222400
206569913 AliVu F May 19, 2023, 8:59 p.m. OK GNU C++20 (64) TESTS 17 62 5222400
206554828 sorry_xiaohuli F May 19, 2023, 5:41 p.m. OK GNU C++20 (64) TESTS 14 62 6144000
206570898 TamimEhsan F May 19, 2023, 9:22 p.m. OK GNU C++20 (64) TESTS 17 62 7168000
206569384 DOOMJUICE F May 19, 2023, 8:49 p.m. OK Java 11 TESTS 17 421 14950400
206545479 ankur314 F May 19, 2023, 4:56 p.m. OK Java 11 TESTS 14 452 39014400
206537800 etian6795 F May 19, 2023, 4:37 p.m. OK Java 11 TESTS 14 873 33894400
206546524 336699go F May 19, 2023, 5:02 p.m. OK Java 11 TESTS 14 1544 5017600
206576788 mumuxinfei F May 20, 2023, 12:32 a.m. OK Java 17 TESTS 17 421 7680000
206544398 frey4 F May 19, 2023, 4:52 p.m. OK Java 17 TESTS 14 421 20275200
206537094 v7fgg F May 19, 2023, 4:35 p.m. OK Java 17 TESTS 14 436 29593600
206576076 kamranm F May 20, 2023, 12:05 a.m. OK Java 17 TESTS 17 530 205414400
206534997 MrOtter F May 19, 2023, 4:31 p.m. OK Java 17 TESTS 14 655 40960000
206541678 Ani_S F May 19, 2023, 4:46 p.m. OK Java 17 TESTS 14 764 36761600
206537006 Virendra115 F May 19, 2023, 4:35 p.m. OK Java 8 TESTS 14 280 3072000
206558429 ND_ F May 19, 2023, 6:17 p.m. OK Java 8 TESTS 14 342 14336000
206573550 javaisbetter F May 19, 2023, 10:34 p.m. OK Java 8 TESTS 17 420 29491200
206535275 vaibhav_1710 F May 19, 2023, 4:31 p.m. OK Java 8 TESTS 14 452 13619200
206539376 UniversalAdmin F May 19, 2023, 4:41 p.m. OK Java 8 TESTS 14 452 79052800
206573859 lpychemistry F May 19, 2023, 10:44 p.m. OK Java 8 TESTS 17 545 49664000
206565507 IanISam F May 19, 2023, 7:45 p.m. OK Java 8 TESTS 14 592 16793600
206545448 kirill146 F May 19, 2023, 4:56 p.m. OK MS C++ 2017 TESTS 14 358 19558400
206565885 hxu10 F May 19, 2023, 7:51 p.m. OK PyPy 3 TESTS 17 374 26521600
206539399 andy0liang F May 19, 2023, 4:41 p.m. OK PyPy 3 TESTS 14 467 31027200
206554165 Ayushman_123 F May 19, 2023, 5:35 p.m. OK PyPy 3 TESTS 14 561 29900800
206557696 shehebe F May 19, 2023, 6:10 p.m. OK PyPy 3 TESTS 14 1184 57344000
206568277 gardengnome F May 19, 2023, 8:27 p.m. OK PyPy 3-64 TESTS 17 170 27750400
206578234 qishui7 F May 20, 2023, 1:16 a.m. OK PyPy 3-64 TESTS 17 187 27852800
206554889 abhinav.iitd205 F May 19, 2023, 5:42 p.m. OK PyPy 3-64 TESTS 14 202 26726400
206572586 RobinFromTheHood F May 19, 2023, 10:05 p.m. OK PyPy 3-64 TESTS 17 234 35123200
206550303 qishui7 F May 19, 2023, 5:16 p.m. OK PyPy 3-64 TESTS 14 265 44236800
206567053 beethoven97 F May 19, 2023, 8:09 p.m. OK PyPy 3-64 TESTS 17 343 41574400
206537746 Maximilian06 F May 19, 2023, 4:37 p.m. OK PyPy 3-64 TESTS 14 358 29900800
206550503 Grapymage F May 19, 2023, 5:18 p.m. OK PyPy 3-64 TESTS 14 358 39424000
206538644 SoleProprietor F May 19, 2023, 4:39 p.m. OK PyPy 3-64 TESTS 14 374 45977600
206554358 redheadphone2 F May 19, 2023, 5:37 p.m. OK PyPy 3-64 TESTS 14 389 34918400
206560161 ivoryxiong F May 19, 2023, 6:36 p.m. OK Python 3 TESTS 14 233 28876800
206534382 rtlgmofrpm F May 19, 2023, 4:29 p.m. OK Python 3 TESTS 14 342 27648000
206552527 kingsneverdie1411 F May 19, 2023, 5:21 p.m. OK Python 3 TESTS 14 1590 34304000
206573697 magnus.hegdahl F May 19, 2023, 10:39 p.m. OK Rust 2021 TESTS 17 31 5836800
206573555 magnus.hegdahl F May 19, 2023, 10:35 p.m. OK Rust 2021 TESTS 17 31 5836800
206574227 magnus.hegdahl F May 19, 2023, 10:57 p.m. OK Rust 2021 TESTS 17 31 7680000
206573249 magnus.hegdahl F May 19, 2023, 10:26 p.m. OK Rust 2021 TESTS 17 46 5324800
206553449 0npata F May 19, 2023, 5:28 p.m. OK Rust 2021 TESTS 14 62 9216000
206536970 haihamabossu F May 19, 2023, 4:35 p.m. OK Rust 2021 TESTS 14 108 19865600

remove filters

Back to search problems