Codeforces Round 845 (Div. 2) and ByteRace 2023

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
1777 Codeforces Round 845 (Div. 2) and ByteRace 2023 FINISHED False 7200 69693890 Jan. 21, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9503 ) C Quiz Master PROGRAMMING math sortings two pointers

B'A school has to decide on its team for an international quiz. There are n students in the school. We can describe the students using an array a where a_i is the smartness of the i -th ( 1 <= i <= n ) student. There are m topics 1, 2, 3, ldots, m from which the quiz questions will be formed. The i -th student is considered proficient in a topic T if (a_i bmod T) = 0 . Otherwise, he is a rookie in that topic. We say that a team of students is collectively proficient in all the topics if for every topic there is a member of the team proficient in this topic. Find a team that is collectively proficient in all the topics such that the maximum difference between the smartness of any two students in that team is minimized. Output this difference. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains n and m ( 1 <= n,m <= 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^5 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . It is guaranteed that the sum of m over all test cases does not exceed 10^5 . For each test case, print the answer on a new line. If there is no solution, output -1 . In the first test case, we have participants with smartnesses 3 and 7 , and m = 4 . Thus, there is no student with smartness divisible by 2 . Since 2 <= q m , there is no way to choose a team. In the second test case, we can select the participant with smartness 2 to be the only one on the team. This way the team will be collectively proficient in both topics 1 and 2 . In the third test case, consider the team with participants of smartnesses 4, 5, 6, 7 . This way the team will be c'...

Tutorials

Codeforces Round #845 (Div. 2) and ByteRace 2023 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
190019077 DmitriyAnikeyev C Jan. 21, 2023, 4:16 p.m. OK C# 10 TESTS 28 374 25088000
190036201 wackyIndian C Jan. 21, 2023, 7:01 p.m. OK GNU C11 TESTS 28 280 10342400
190036002 Umnikfan C Jan. 21, 2023, 6:59 p.m. OK GNU C11 TESTS 28 280 10342400
190035778 Umnikfan C Jan. 21, 2023, 6:57 p.m. OK GNU C11 TESTS 28 280 10342400
190035896 Umnikfan C Jan. 21, 2023, 6:59 p.m. OK GNU C11 TESTS 28 296 10342400
190058073 wackyIndian C Jan. 22, 2023, 4:32 a.m. OK GNU C11 TESTS 32 311 10342400
190017715 X_Cross C Jan. 21, 2023, 4:11 p.m. OK GNU C++14 TESTS 28 62 2867200
190015667 Till_Past C Jan. 21, 2023, 4:04 p.m. OK GNU C++14 TESTS 28 78 1433600
190013110 praying_cqf C Jan. 21, 2023, 3:55 p.m. OK GNU C++14 TESTS 28 78 161587200
190056327 servants C Jan. 22, 2023, 3:44 a.m. OK GNU C++14 TESTS 29 93 2457600
190020050 BabbyBoo C Jan. 21, 2023, 4:19 p.m. OK GNU C++14 TESTS 28 93 8294400
190063914 Sameer_04 C Jan. 22, 2023, 6:01 a.m. OK GNU C++14 TESTS 32 93 10752000
190063120 adannklgdnglk C Jan. 22, 2023, 5:51 a.m. OK GNU C++14 TESTS 32 93 10752000
190045170 MLA19 C Jan. 21, 2023, 9:14 p.m. OK GNU C++14 TESTS 29 93 10752000
190058199 Wolfstar C Jan. 22, 2023, 4:34 a.m. OK GNU C++14 TESTS 32 93 11366400
190018131 sejun C Jan. 21, 2023, 4:12 p.m. OK GNU C++14 TESTS 28 108 12697600
190024313 sgsonugoyalsg C Jan. 21, 2023, 4:32 p.m. OK GNU C++17 TESTS 28 62 2150400
190040467 Azimjonm0012 C Jan. 21, 2023, 7:51 p.m. OK GNU C++17 TESTS 29 62 3174400
190013523 tanyifan C Jan. 21, 2023, 3:57 p.m. OK GNU C++17 TESTS 28 78 7270400
190051299 Kosmo00 C Jan. 22, 2023, 12:42 a.m. OK GNU C++17 TESTS 29 93 9523200
190023478 nitin12384 C Jan. 21, 2023, 4:30 p.m. OK GNU C++17 TESTS 28 93 9830400
190061121 dapingguo8 C Jan. 22, 2023, 5:24 a.m. OK GNU C++17 TESTS 32 93 9932800
190060084 nitin12384 C Jan. 22, 2023, 5:07 a.m. OK GNU C++17 TESTS 32 93 10240000
190049732 ammar_shaikh C Jan. 21, 2023, 11:35 p.m. OK GNU C++17 TESTS 29 93 10342400
190053629 lxyb C Jan. 22, 2023, 2:14 a.m. OK GNU C++17 TESTS 29 93 10342400
190055683 Teja_1039 C Jan. 22, 2023, 3:26 a.m. OK GNU C++17 TESTS 29 93 10342400
190042088 TrendBattles C Jan. 21, 2023, 8:16 p.m. OK GNU C++17 (64) TESTS 29 78 12390400
190056843 wakaranai C Jan. 22, 2023, 4 a.m. OK GNU C++17 (64) TESTS 29 78 12492800
190058277 atharvd C Jan. 22, 2023, 4:36 a.m. OK GNU C++17 (64) TESTS 32 93 11776000
190013780 AboAImanaI C Jan. 21, 2023, 3:58 p.m. OK GNU C++17 (64) TESTS 28 93 12492800
190017349 Andreasyan C Jan. 21, 2023, 4:10 p.m. OK GNU C++17 (64) TESTS 28 93 12492800
190048517 enslaved C Jan. 21, 2023, 10:44 p.m. OK GNU C++17 (64) TESTS 29 109 12083200
190047617 scotchtape13 C Jan. 21, 2023, 10:15 p.m. OK GNU C++17 (64) TESTS 29 109 12083200
190062797 cjk041212 C Jan. 22, 2023, 5:47 a.m. OK GNU C++17 (64) TESTS 32 109 22937600
190051688 YaoLingF C Jan. 22, 2023, 12:58 a.m. OK GNU C++17 (64) TESTS 29 109 22937600
190055835 Kath1031 C Jan. 22, 2023, 3:30 a.m. OK GNU C++17 (64) TESTS 29 124 12902400
190036648 5hu8h C Jan. 21, 2023, 7:06 p.m. OK GNU C++20 (64) TESTS 28 77 2560000
190015557 Sigh C Jan. 21, 2023, 4:04 p.m. OK GNU C++20 (64) TESTS 28 77 12185600
190034483 tahmidarefin C Jan. 21, 2023, 6:49 p.m. OK GNU C++20 (64) TESTS 28 78 12083200
190063282 hasan_tawsif C Jan. 22, 2023, 5:54 a.m. OK GNU C++20 (64) TESTS 32 78 12492800
190060276 Only_Y C Jan. 22, 2023, 5:10 a.m. OK GNU C++20 (64) TESTS 32 78 13209600
190062016 abhinav_20 C Jan. 22, 2023, 5:37 a.m. OK GNU C++20 (64) TESTS 32 78 13312000
190036024 5hu8h C Jan. 21, 2023, 7 p.m. OK GNU C++20 (64) TESTS 28 93 2560000
190058865 wyhong3103 C Jan. 22, 2023, 4:46 a.m. OK GNU C++20 (64) TESTS 32 93 11776000
190054457 jtrh C Jan. 22, 2023, 2:51 a.m. OK GNU C++20 (64) TESTS 29 93 12083200
190055378 GeorgeBur C Jan. 22, 2023, 3:18 a.m. OK GNU C++20 (64) TESTS 29 93 12083200
190014057 goudezhao C Jan. 21, 2023, 3:58 p.m. OK Java 11 TESTS 28 421 0
190039444 kritikmodi C Jan. 21, 2023, 7:38 p.m. OK Java 11 TESTS 29 545 0
190039578 kritikmodi C Jan. 21, 2023, 7:39 p.m. OK Java 11 TESTS 29 592 0
190060534 __Serendipity C Jan. 22, 2023, 5:15 a.m. OK Java 11 TESTS 32 592 31334400
190036988 NewbiePupil C Jan. 21, 2023, 7:09 p.m. OK Java 11 TESTS 28 592 36249600
190037899 NewbiePupil C Jan. 21, 2023, 7:19 p.m. OK Java 11 TESTS 28 608 36249600
190037730 NewbiePupil C Jan. 21, 2023, 7:17 p.m. OK Java 11 TESTS 28 608 36249600
190049366 dzhi C Jan. 21, 2023, 11:18 p.m. OK Java 11 TESTS 29 623 30208000
190039022 HeXecutor C Jan. 21, 2023, 7:32 p.m. OK Java 11 TESTS 29 904 38707200
190044852 theSSS C Jan. 21, 2023, 9:07 p.m. OK Java 11 TESTS 29 1013 36556800
190017001 mareshkau C Jan. 21, 2023, 4:08 p.m. OK Java 17 TESTS 28 390 0
190053211 kkz666 C Jan. 22, 2023, 1:59 a.m. OK Java 17 TESTS 29 405 614400
190037652 this.is.shivamsingh C Jan. 21, 2023, 7:16 p.m. OK Java 17 TESTS 28 623 32563200
190035236 not_just_rr C Jan. 21, 2023, 6:53 p.m. OK Java 17 TESTS 28 716 59187200
190040969 Abhinavrajhans C Jan. 21, 2023, 7:58 p.m. OK Java 17 TESTS 29 732 33382400
190061807 Black-Heart C Jan. 22, 2023, 5:34 a.m. OK Java 17 TESTS 32 982 108339200
190047223 Restricted C Jan. 21, 2023, 10:02 p.m. OK Java 17 TESTS 29 1106 73318400
190039341 Mustela_Erminea C Jan. 21, 2023, 7:36 p.m. OK Java 17 TESTS 29 1216 31948800
190057875 CCS_Covenant C Jan. 22, 2023, 4:28 a.m. OK Java 17 TESTS 32 1325 131174400
190047041 Restricted C Jan. 21, 2023, 9:57 p.m. OK Java 17 TESTS 29 1934 112742400
190017875 AbdelrahmanFathy C Jan. 21, 2023, 4:11 p.m. OK Java 8 TESTS 28 312 0
190039210 DylanSmith C Jan. 21, 2023, 7:35 p.m. OK Java 8 TESTS 29 327 0
190018932 _Clf C Jan. 21, 2023, 4:15 p.m. OK Java 8 TESTS 28 327 0
190014728 Virendra115 C Jan. 21, 2023, 4:01 p.m. OK Java 8 TESTS 28 327 0
190046687 lpychemistry C Jan. 21, 2023, 9:48 p.m. OK Java 8 TESTS 29 389 0
190039626 UniversalAdmin C Jan. 21, 2023, 7:40 p.m. OK Java 8 TESTS 29 436 29081600
190039596 Xenotrix C Jan. 21, 2023, 7:39 p.m. OK Java 8 TESTS 29 436 29081600
190057510 aryaman_571 C Jan. 22, 2023, 4:18 a.m. OK Java 8 TESTS 32 483 29184000
190014515 amitkumar88 C Jan. 21, 2023, 4 p.m. OK Java 8 TESTS 28 576 0
190056552 pribic C Jan. 22, 2023, 3:52 a.m. OK Java 8 TESTS 29 607 35635200
190040883 ktropin C Jan. 21, 2023, 7:57 p.m. OK Mono C# TESTS 29 592 24576000
190039655 ktropin C Jan. 21, 2023, 7:40 p.m. OK Mono C# TESTS 29 670 24780800
190040849 ktropin C Jan. 21, 2023, 7:56 p.m. OK Mono C# TESTS 29 701 24576000
190012804 te06008 C Jan. 21, 2023, 3:54 p.m. OK MS C++ 2017 TESTS 28 218 819200
190037401 Ncato_Del_Gormo7 C Jan. 21, 2023, 7:14 p.m. OK MS C++ 2017 TESTS 28 311 5120000
190058965 1434314294 C Jan. 22, 2023, 4:48 a.m. OK MS C++ 2017 TESTS 32 327 10342400
190019619 ballace C Jan. 21, 2023, 4:18 p.m. OK MS C++ 2017 TESTS 28 811 11980800
190022286 6ziv C Jan. 21, 2023, 4:26 p.m. OK MS C++ 2017 TESTS 28 1123 409600
190054088 Track-Days C Jan. 22, 2023, 2:32 a.m. OK PyPy 3 TESTS 29 498 19353600
190060257 rajeshpenugonda C Jan. 22, 2023, 5:10 a.m. OK PyPy 3 TESTS 32 639 42598400
190042190 aayush_chhabra C Jan. 21, 2023, 8:18 p.m. OK PyPy 3 TESTS 29 1044 75571200
190020325 petras741 C Jan. 21, 2023, 4:20 p.m. OK PyPy 3 TESTS 28 1154 16486400
190016539 plevande C Jan. 21, 2023, 4:07 p.m. OK PyPy 3 TESTS 28 1528 33177600
190051886 sjNxksbzj C Jan. 22, 2023, 1:07 a.m. OK PyPy 3 TESTS 29 1653 34508800
190047410 InvalidSyntax C Jan. 21, 2023, 10:07 p.m. OK PyPy 3-64 TESTS 29 358 40550400
190037891 sushmanth.dampur8780 C Jan. 21, 2023, 7:19 p.m. OK PyPy 3-64 TESTS 28 404 42905600
190052693 sjNxksbzj C Jan. 22, 2023, 1:43 a.m. OK PyPy 3-64 TESTS 29 420 42598400
190058068 Youarenotgood C Jan. 22, 2023, 4:32 a.m. OK PyPy 3-64 TESTS 32 420 42905600
190034459 AyuAnchor C Jan. 21, 2023, 6:48 p.m. OK PyPy 3-64 TESTS 28 436 43929600
190057237 nsharc4 C Jan. 22, 2023, 4:12 a.m. OK PyPy 3-64 TESTS 32 467 42803200
190046529 RobinFromTheHood C Jan. 21, 2023, 9:44 p.m. OK PyPy 3-64 TESTS 29 467 44032000
190037862 gardengnome C Jan. 21, 2023, 7:18 p.m. OK PyPy 3-64 TESTS 28 467 46182400
190040831 kavorka C Jan. 21, 2023, 7:56 p.m. OK PyPy 3-64 TESTS 29 482 59699200
190018582 ueta C Jan. 21, 2023, 4:14 p.m. OK PyPy 3-64 TESTS 28 514 25190400
190049191 jiayuan8 C Jan. 21, 2023, 11:11 p.m. OK Python 3 TESTS 29 919 22118400
190017665 avnyu C Jan. 21, 2023, 4:11 p.m. OK Rust 2021 TESTS 28 93 22835200
190053504 pohzipohzi C Jan. 22, 2023, 2:10 a.m. OK Rust 2021 TESTS 29 390 1228800

remove filters

Back to search problems