Codeforces Round 935 (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
1945 Codeforces Round 935 (Div. 3) FINISHED False 8100 26344463 March 19, 2024, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15429 ) C Left and Right Houses PROGRAMMING brute force

B'In the village of Letovo, there are n houses. The villagers decided to build a big road that will divide the village into left and right sides. Each resident wants to live on either the right or the left side of the street, which is described as a sequence a_1, a_2, ... , a_n , where a_j = 0 if the resident of the j -th house wants to live on the left side of the street; otherwise, a_j = 1 . The road will pass between two houses. The houses to the left of it will be declared the left-side, and the houses to the right will be declared the right-side. More formally, let the road pass between houses i and i+1 . Then the houses at positions between 1 and i will be on the left side of the street, and at positions between i+1 and n will be on the right side. The road also may pass before the first and after the last house; in this case, the entire village is declared to be either the right or left side, respectively. To make the design fair, it was decided to lay the road so that at least half of the residents on each side of the village are satisfied with the choice. That is, among x residents on one side, at least lceil frac{x}{2} rceil should want to live on that side, where lceil x rceil denotes rounding up a real number x . Determine after which house i the road should be laid in order to satisfy the described condition and be as close to the middle of the village as possible. Formally, among all suitable positions i , minimize <= ft| frac{n}{2} - i right| . If there are multiple suitable positions i with the minimum <= ft| frac{n}{2} - i right| , output the smaller one. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 2 cdot 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= n <= 3 cdot 10^5 ). The '...

Tutorials

127377

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
252391792 zhujiangyuan C March 20, 2024, 4:48 a.m. OK C++14 (GCC 6-32) TESTS 9 15 1536000
252350896 Royboy01 C March 19, 2024, 6:41 p.m. OK C++14 (GCC 6-32) TESTS 9 15 3481600
252308410 pppwolf C March 19, 2024, 2:06 p.m. OK C++14 (GCC 6-32) TESTS 5 15 3481600
252381095 zhaoyuxiang C March 20, 2024, 1:54 a.m. OK C++14 (GCC 6-32) TESTS 9 15 16998400
252315000 wondering001 C March 19, 2024, 2:45 p.m. OK C++14 (GCC 6-32) TESTS 5 15 24064000
252354328 Darshanraj C March 19, 2024, 7:12 p.m. OK C++14 (GCC 6-32) TESTS 9 30 307200
252392994 l1ability C March 20, 2024, 5:03 a.m. OK C++14 (GCC 6-32) TESTS 9 31 1024000
252364239 sstojilkovic19 C March 19, 2024, 8:58 p.m. OK C++14 (GCC 6-32) TESTS 9 31 1024000
252339816 KingBob C March 19, 2024, 5:17 p.m. OK C++14 (GCC 6-32) TESTS 5 31 1024000
252329229 dreamoon_love_AA C March 19, 2024, 4:06 p.m. OK C++14 (GCC 6-32) TESTS 5 31 1024000
252375563 Ra16bit C March 20, 2024, 12:04 a.m. OK C++17 (GCC 7-32) TESTS 9 15 307200
252304231 DZYCD C March 19, 2024, 1:42 p.m. OK C++17 (GCC 7-32) TESTS 5 15 307200
252390723 happydreamer C March 20, 2024, 4:32 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252385938 31415998 C March 20, 2024, 3:18 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252385399 KimiZhou C March 20, 2024, 3:09 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252382538 aa80 C March 20, 2024, 2:21 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252381960 MJSoto123 C March 20, 2024, 2:11 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252380771 The_Last_one_to_give_up C March 20, 2024, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252379596 LeNcyer C March 20, 2024, 1:27 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252379048 ShahdAbdelaziz C March 20, 2024, 1:16 a.m. OK C++17 (GCC 7-32) TESTS 9 15 1024000
252384714 Marckess C March 20, 2024, 2:58 a.m. OK C++20 (GCC 13-64) TESTS 9 15 1024000
252368016 gbula C March 19, 2024, 9:45 p.m. OK C++20 (GCC 13-64) TESTS 9 15 1024000
252359399 d0nrEv4-urh0pe C March 19, 2024, 8:03 p.m. OK C++20 (GCC 13-64) TESTS 9 15 1024000
252350167 duck_tape C March 19, 2024, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 9 15 1024000
252317848 qqwrv C March 19, 2024, 3:01 p.m. OK C++20 (GCC 13-64) TESTS 5 15 1126400
252330815 C0ldSmi1e C March 19, 2024, 4:16 p.m. OK C++20 (GCC 13-64) TESTS 5 15 2662400
252380426 MostafaY C March 20, 2024, 1:42 a.m. OK C++20 (GCC 13-64) TESTS 9 15 3481600
252355779 Shoeib C March 19, 2024, 7:26 p.m. OK C++20 (GCC 13-64) TESTS 9 15 3481600
252335936 EvgenyUtkin C March 19, 2024, 4:50 p.m. OK C++20 (GCC 13-64) TESTS 5 15 3481600
252308238 V_I_P C March 19, 2024, 2:06 p.m. OK C++20 (GCC 13-64) TESTS 5 15 3481600
252302267 Istiyak1264 C March 19, 2024, 1:31 p.m. OK GNU C11 TESTS 5 93 307200
252340047 SimoFerri C March 19, 2024, 5:19 p.m. OK GNU C11 TESTS 9 109 716800
252311946 sleepntsheep C March 19, 2024, 2:27 p.m. OK GNU C11 TESTS 5 109 2662400
252305352 MooNaz C March 19, 2024, 1:49 p.m. OK GNU C11 TESTS 5 109 2662400
252334026 RiceTofu C March 19, 2024, 4:37 p.m. OK Java 21 TESTS 5 248 0
252392216 priyaroy3370 C March 20, 2024, 4:53 a.m. OK Java 21 TESTS 9 264 102400
252326113 Eslam_Ahmed C March 19, 2024, 3:48 p.m. OK Java 21 TESTS 5 280 0
252334017 beatboy C March 19, 2024, 4:37 p.m. OK Java 21 TESTS 5 280 7577600
252326471 fabiowg C March 19, 2024, 3:50 p.m. OK Java 21 TESTS 5 311 102400
252304004 AKhacks C March 19, 2024, 1:41 p.m. OK Java 21 TESTS 5 312 0
252396788 rutul21 C March 20, 2024, 5:45 a.m. OK Java 21 TESTS 9 326 5017600
252313729 mohit1510 C March 19, 2024, 2:37 p.m. OK Java 21 TESTS 5 343 0
252315155 ankush9140 C March 19, 2024, 2:46 p.m. OK Java 21 TESTS 5 374 307200
252362310 rishabhrajfeb22 C March 19, 2024, 8:35 p.m. OK Java 21 TESTS 9 404 512000
252397087 51Hz C March 20, 2024, 5:49 a.m. OK Java 8 TESTS 9 139 0
252333450 etian6795 C March 19, 2024, 4:33 p.m. OK Java 8 TESTS 5 140 0
252312048 mada-mada C March 19, 2024, 2:28 p.m. OK Java 8 TESTS 5 187 0
252367708 Shenta C March 19, 2024, 9:40 p.m. OK Java 8 TESTS 9 218 0
252305503 Billert C March 19, 2024, 1:50 p.m. OK Java 8 TESTS 5 233 0
252351994 Sumitsingh7 C March 19, 2024, 6:50 p.m. OK Java 8 TESTS 9 233 15360000
252335051 aryanartist30 C March 19, 2024, 4:44 p.m. OK Java 8 TESTS 5 327 0
252353103 Maheshwari_Saksham C March 19, 2024, 7 p.m. OK Java 8 TESTS 9 327 1638400
252301227 zk77 C March 19, 2024, 1:26 p.m. OK Java 8 TESTS 5 342 0
252300557 zk77 C March 19, 2024, 1:22 p.m. OK Java 8 TESTS 5 405 0
252317668 crapcode C March 19, 2024, 3 p.m. OK PHP TESTS 5 108 0
252351511 sparsh_agarwal_007 C March 19, 2024, 6:46 p.m. OK PyPy 3 TESTS 9 530 9011200
252347140 EvGen1u5 C March 19, 2024, 6:11 p.m. OK PyPy 3 TESTS 9 560 7168000
252300791 n_matari C March 19, 2024, 1:23 p.m. OK PyPy 3 TESTS 5 592 8806400
252317258 vishruth_21 C March 19, 2024, 2:58 p.m. OK PyPy 3 TESTS 5 623 14438400
252333969 Paras2856 C March 19, 2024, 4:36 p.m. OK PyPy 3 TESTS 5 733 9625600
252360873 Hossam_Hassan_Taher C March 19, 2024, 8:18 p.m. OK PyPy 3-64 TESTS 9 108 9216000
252347302 strashila C March 19, 2024, 6:12 p.m. OK PyPy 3-64 TESTS 9 109 10444800
252328216 InHng C March 19, 2024, 4 p.m. OK PyPy 3-64 TESTS 5 124 9113600
252373437 OmarMoBadr C March 19, 2024, 11:19 p.m. OK PyPy 3-64 TESTS 9 124 29491200
252366927 voicon C March 19, 2024, 9:30 p.m. OK PyPy 3-64 TESTS 9 139 9011200
252340390 gardengnome C March 19, 2024, 5:21 p.m. OK PyPy 3-64 TESTS 9 140 9523200
252303109 mikeac C March 19, 2024, 1:36 p.m. OK PyPy 3-64 TESTS 5 155 9216000
252361027 kefolen C March 19, 2024, 8:20 p.m. OK PyPy 3-64 TESTS 9 155 9420800
252354071 Jensen123 C March 19, 2024, 7:09 p.m. OK PyPy 3-64 TESTS 9 155 9420800
252366069 DRDIV C March 19, 2024, 9:20 p.m. OK PyPy 3-64 TESTS 9 171 9420800
252301626 100987654321 C March 19, 2024, 1:28 p.m. OK Python 3 TESTS 5 217 14131200
252316085 eugalt C March 19, 2024, 2:51 p.m. OK Python 3 TESTS 5 233 14131200
252328779 harshkankhar1 C March 19, 2024, 4:04 p.m. OK Python 3 TESTS 5 249 921600
252333467 22H51A6762-Manikanta C March 19, 2024, 4:33 p.m. OK Python 3 TESTS 5 249 14131200
252331750 tootwp C March 19, 2024, 4:22 p.m. OK Python 3 TESTS 5 264 3379200
252302750 _balrog_ C March 19, 2024, 1:34 p.m. OK Python 3 TESTS 5 280 921600
252330437 whawking C March 19, 2024, 4:14 p.m. OK Python 3 TESTS 5 280 10956800
252338227 manoharsingh2402 C March 19, 2024, 5:06 p.m. OK Python 3 TESTS 5 311 13004800
252309048 aditya.ad.agrawal C March 19, 2024, 2:10 p.m. OK Python 3 TESTS 5 342 6553600
252344574 howzz_the_josh C March 19, 2024, 5:52 p.m. OK Python 3 TESTS 9 343 18534400
252358543 0x81 C March 19, 2024, 7:54 p.m. OK Ruby 3 TESTS 9 607 3788800
252318346 AJinGoo C March 19, 2024, 3:04 p.m. OK Rust 2021 TESTS 5 15 6041600
252328400 rob.xu.meng C March 19, 2024, 4:01 p.m. OK Rust 2021 TESTS 5 171 716800

remove filters

Back to search problems