Educational Codeforces Round 95 (Rated for 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
1418 Educational Codeforces Round 95 (Rated for Div. 2) FINISHED False 7200 131729099 Sept. 14, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16710 ) B Negative Prefixes PROGRAMMING greedy sortings

B'You are given an array a , consisting of n integers. Each position i ( 1 <= i <= n ) of the array is either locked or unlocked. You can take the values on the unlocked positions, rearrange them in any order and place them back into the unlocked positions. You are not allowed to remove any values, add the new ones or rearrange the values on the locked positions. You are allowed to leave the values in the same order as they were. For example, let a = [-1, 1, underline{3}, 2, underline{-2}, 1, -4, underline{0}] , the underlined positions are locked. You can obtain the following arrays: Let p be a sequence of prefix sums of the array a after the rearrangement. So p_1 = a_1 , p_2 = a_1 + a_2 , p_3 = a_1 + a_2 + a_3 , ... , p_n = a_1 + a_2 + ... + a_n . Let k be the maximum j ( 1 <= j <= n ) such that p_j < 0 . If there are no j such that p_j < 0 , then k = 0 . Your goal is to rearrange the values in such a way that k is minimum possible. Output the array a after the rearrangement such that the value k for it is minimum possible. If there are multiple answers then print any of them. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of testcases. Then t testcases follow. The first line of each testcase contains a single integer n ( 1 <= n <= 100 ) -- the number of elements in the array a . The second line of each testcase contains n integers a_1, a_2, ... , a_n ( -10^5 <= a_i <= 10^5 ) -- the initial array a . The third line of each testcase contains n integers l_1, l_2, ... , l_n ( 0 <= l_i <= 1 ), where l_i = 0 means that the position i is unlocked and l_i = 1 means that the position i is locked. Print n integers -- the array a after the rearrangement. Value k (the maximum j s'...

Tutorials

Unofficial Editorial for Educational Round 95 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
92868957 saiduzzamanzishan B Sept. 15, 2020, 3:32 a.m. OK Clang++17 Diagnostics TESTS 6 1029 4198400
92867198 Wenbo888 B Sept. 15, 2020, 2:42 a.m. OK GNU C11 TESTS 6 390 0
92836471 amanj5486 B Sept. 14, 2020, 4:20 p.m. OK GNU C11 TESTS 6 405 0
92836213 Sanku201 B Sept. 14, 2020, 4:19 p.m. OK GNU C11 TESTS 6 420 0
92861698 flayer_hunter B Sept. 14, 2020, 10:28 p.m. OK GNU C11 TESTS 6 421 0
92831586 Mithu.ict B Sept. 14, 2020, 4 p.m. OK GNU C11 TESTS 6 436 0
92837739 Iizshit B Sept. 14, 2020, 4:26 p.m. OK GNU C11 TESTS 6 436 0
92829604 babaiserror B Sept. 14, 2020, 3:53 p.m. OK GNU C11 TESTS 6 436 0
92872164 wddmahe B Sept. 15, 2020, 4:54 a.m. OK GNU C++11 TESTS 6 31 1228800
92829944 xzyz7777 B Sept. 14, 2020, 3:54 p.m. OK GNU C++11 TESTS 6 46 0
92835832 MonkeyKing B Sept. 14, 2020, 4:17 p.m. OK GNU C++11 TESTS 6 46 0
92837688 Mackerel_Pike B Sept. 14, 2020, 4:26 p.m. OK GNU C++11 TESTS 6 46 0
92839120 suxxsfe B Sept. 14, 2020, 4:31 p.m. OK GNU C++11 TESTS 6 46 0
92866510 zhtjtcz B Sept. 15, 2020, 2:19 a.m. OK GNU C++11 TESTS 6 46 102400
92870718 Payphone--X B Sept. 15, 2020, 4:18 a.m. OK GNU C++11 TESTS 6 46 819200
92873639 _Backl1ght B Sept. 15, 2020, 5:25 a.m. OK GNU C++11 TESTS 6 46 1843200
92867539 Hpnes B Sept. 15, 2020, 2:52 a.m. OK GNU C++11 TESTS 6 46 76185600
92871583 TLE_Automat B Sept. 15, 2020, 4:39 a.m. OK GNU C++11 TESTS 6 61 0
92829054 __rYu__ B Sept. 14, 2020, 3:51 p.m. OK GNU C++14 TESTS 6 31 204800
92842478 Sarah_montasser B Sept. 14, 2020, 4:54 p.m. OK GNU C++14 TESTS 6 46 102400
92852498 abhijeetsisodiya97 B Sept. 14, 2020, 6:46 p.m. OK GNU C++14 TESTS 6 46 102400
92869416 VFX B Sept. 15, 2020, 3:44 a.m. OK GNU C++14 TESTS 6 46 102400
92860498 mr.convict B Sept. 14, 2020, 9:31 p.m. OK GNU C++14 TESTS 6 46 204800
92858522 Alom19 B Sept. 14, 2020, 8:29 p.m. OK GNU C++14 TESTS 6 46 204800
92859734 srejanbera B Sept. 14, 2020, 9:04 p.m. OK GNU C++14 TESTS 6 46 204800
92852032 Sarah_montasser B Sept. 14, 2020, 6:40 p.m. OK GNU C++14 TESTS 6 46 204800
92851927 bachkana_coder B Sept. 14, 2020, 6:39 p.m. OK GNU C++14 TESTS 6 46 204800
92860920 Kukulkan B Sept. 14, 2020, 9:49 p.m. OK GNU C++14 TESTS 6 46 204800
92830592 contigo B Sept. 14, 2020, 3:56 p.m. OK GNU C++17 TESTS 6 46 102400
92874116 kirtik_jangale B Sept. 15, 2020, 5:34 a.m. OK GNU C++17 TESTS 6 46 102400
92844584 sourav.sah333 B Sept. 14, 2020, 5:15 p.m. OK GNU C++17 TESTS 6 46 102400
92839887 Mariam_Yasser B Sept. 14, 2020, 4:34 p.m. OK GNU C++17 TESTS 6 46 102400
92838809 asisdeo B Sept. 14, 2020, 4:30 p.m. OK GNU C++17 TESTS 6 46 102400
92835905 keshav_sharma_ji_ B Sept. 14, 2020, 4:17 p.m. OK GNU C++17 TESTS 6 46 102400
92859115 saiful.dh B Sept. 14, 2020, 8:45 p.m. OK GNU C++17 TESTS 6 46 204800
92859589 moomoo02 B Sept. 14, 2020, 8:59 p.m. OK GNU C++17 TESTS 6 46 204800
92871289 mukim B Sept. 15, 2020, 4:33 a.m. OK GNU C++17 TESTS 6 46 204800
92875020 StEpAn_123 B Sept. 15, 2020, 5:51 a.m. OK GNU C++17 TESTS 6 46 204800
92853380 MonarchBlank B Sept. 14, 2020, 6:59 p.m. OK GNU C++17 (64) TESTS 6 31 102400
92851087 akshatarun17 B Sept. 14, 2020, 6:28 p.m. OK GNU C++17 (64) TESTS 6 46 0
92850662 akshatarun17 B Sept. 14, 2020, 6:22 p.m. OK GNU C++17 (64) TESTS 6 46 0
92868712 errorgorn B Sept. 15, 2020, 3:26 a.m. OK GNU C++17 (64) TESTS 6 46 0
92874358 KyrieKing B Sept. 15, 2020, 5:38 a.m. OK GNU C++17 (64) TESTS 6 46 0
92867336 6553368 B Sept. 15, 2020, 2:46 a.m. OK GNU C++17 (64) TESTS 6 46 0
92861677 invisible_guest B Sept. 14, 2020, 10:27 p.m. OK GNU C++17 (64) TESTS 6 46 0
92859724 user9029 B Sept. 14, 2020, 9:04 p.m. OK GNU C++17 (64) TESTS 6 46 0
92857327 lucid_dreamer B Sept. 14, 2020, 7:59 p.m. OK GNU C++17 (64) TESTS 6 46 0
92851809 shanks1 B Sept. 14, 2020, 6:37 p.m. OK GNU C++17 (64) TESTS 6 46 0
92844061 smalex69 B Sept. 14, 2020, 5:10 p.m. OK Go TESTS 6 46 102400
92842726 Sabareeshk B Sept. 14, 2020, 4:57 p.m. OK Go TESTS 6 140 0
92843594 smalex69 B Sept. 14, 2020, 5:05 p.m. OK Go TESTS 6 608 1024000
92836203 codehacker003 B Sept. 14, 2020, 4:19 p.m. OK Java 11 TESTS 6 187 0
92836421 Apfeloxid B Sept. 14, 2020, 4:20 p.m. OK Java 11 TESTS 6 218 0
92858028 akman10 B Sept. 14, 2020, 8:17 p.m. OK Java 11 TESTS 6 218 0
92853689 skittles1412 B Sept. 14, 2020, 7:03 p.m. OK Java 11 TESTS 6 218 0
92844736 Apass.Jack B Sept. 14, 2020, 5:17 p.m. OK Java 11 TESTS 6 218 0
92841246 Ste B Sept. 14, 2020, 4:44 p.m. OK Java 11 TESTS 6 218 0
92874990 chris_11 B Sept. 15, 2020, 5:50 a.m. OK Java 11 TESTS 6 233 0
92864464 Apass.Jack B Sept. 15, 2020, 1 a.m. OK Java 11 TESTS 6 233 0
92860717 cassiopeia_delphinus B Sept. 14, 2020, 9:40 p.m. OK Java 11 TESTS 6 233 0
92830325 akman10 B Sept. 14, 2020, 3:55 p.m. OK Java 11 TESTS 6 233 0
92840730 fakhoury B Sept. 14, 2020, 4:40 p.m. OK Java 8 TESTS 6 124 0
92834758 _maverick B Sept. 14, 2020, 4:13 p.m. OK Java 8 TESTS 6 124 0
92867625 sumitnitesh123 B Sept. 15, 2020, 2:55 a.m. OK Java 8 TESTS 6 139 0
92860573 TriumphantEggplant B Sept. 14, 2020, 9:34 p.m. OK Java 8 TESTS 6 139 0
92857245 sourav2999 B Sept. 14, 2020, 7:58 p.m. OK Java 8 TESTS 6 139 0
92832545 karthikch B Sept. 14, 2020, 4:03 p.m. OK Java 8 TESTS 6 139 0
92865870 MartyByrde B Sept. 15, 2020, 1:55 a.m. OK Java 8 TESTS 6 140 0
92852533 rational_fool B Sept. 14, 2020, 6:47 p.m. OK Java 8 TESTS 6 140 0
92836531 arun07 B Sept. 14, 2020, 4:20 p.m. OK Java 8 TESTS 6 140 0
92832420 pavel.v.shlyk B Sept. 14, 2020, 4:03 p.m. OK Java 8 TESTS 6 140 0
92865756 Spheniscine B Sept. 15, 2020, 1:50 a.m. OK Kotlin TESTS 6 171 1536000
92858263 Mirimax B Sept. 14, 2020, 8:22 p.m. OK Kotlin TESTS 6 467 0
92858408 Mirimax B Sept. 14, 2020, 8:26 p.m. OK Kotlin TESTS 6 498 0
92857969 Mirimax B Sept. 14, 2020, 8:15 p.m. OK Kotlin TESTS 6 498 1740800
92858136 Mirimax B Sept. 14, 2020, 8:20 p.m. OK Kotlin TESTS 6 499 0
92829380 define_chan B Sept. 14, 2020, 3:52 p.m. OK MS C++ 2017 TESTS 6 78 0
92828600 WBTG B Sept. 14, 2020, 3:49 p.m. OK MS C++ 2017 TESTS 6 93 0
92836927 redphosphorus B Sept. 14, 2020, 4:22 p.m. OK MS C++ 2017 TESTS 6 186 102400
92859726 letshavesomefun B Sept. 14, 2020, 9:04 p.m. OK MS C++ 2017 TESTS 6 202 0
92837371 TheSherlockHomie B Sept. 14, 2020, 4:24 p.m. OK MS C++ 2017 TESTS 6 202 0
92846238 shacastic B Sept. 14, 2020, 5:32 p.m. OK MS C++ 2017 TESTS 6 202 102400
92832317 Myao B Sept. 14, 2020, 4:03 p.m. OK MS C++ 2017 TESTS 6 202 102400
92831458 ckdfs B Sept. 14, 2020, 3:59 p.m. OK MS C++ 2017 TESTS 6 202 1228800
92830273 IndignantHydra B Sept. 14, 2020, 3:55 p.m. OK MS C++ 2017 TESTS 6 202 1228800
92834159 ykmeningslost B Sept. 14, 2020, 4:10 p.m. OK MS C++ 2017 TESTS 6 217 0
92873274 explorer_sifat B Sept. 15, 2020, 5:18 a.m. OK Node.js TESTS 6 155 7475200
92829156 mo-hit B Sept. 14, 2020, 3:51 p.m. OK PyPy 2 TESTS 6 233 12083200
92844869 bazzyadb B Sept. 14, 2020, 5:18 p.m. OK PyPy 2 TESTS 6 1154 6860800
92835526 apoorvwatsky B Sept. 14, 2020, 4:16 p.m. OK PyPy 3 TESTS 6 217 5632000
92838427 apoorvwatsky B Sept. 14, 2020, 4:29 p.m. OK PyPy 3 TESTS 6 218 5836800
92844627 deepanshu_pali B Sept. 14, 2020, 5:16 p.m. OK PyPy 3 TESTS 6 233 6860800
92858356 Akhil_Rautela B Sept. 14, 2020, 8:25 p.m. OK PyPy 3 TESTS 6 249 8192000
92844271 anubhavsinha98 B Sept. 14, 2020, 5:12 p.m. OK PyPy 3 TESTS 6 280 7782400
92873019 thnkndblv B Sept. 15, 2020, 5:13 a.m. OK PyPy 3 TESTS 6 311 9523200
92830621 kazukun1311 B Sept. 14, 2020, 3:56 p.m. OK PyPy 3 TESTS 6 311 9523200
92864593 koxuan B Sept. 15, 2020, 1:06 a.m. OK PyPy 3 TESTS 6 312 8908800
92846199 tiwari0000 B Sept. 14, 2020, 5:31 p.m. OK PyPy 3 TESTS 6 312 9216000
92849952 bit_2 B Sept. 14, 2020, 6:14 p.m. OK PyPy 3 TESTS 6 326 9830400
92838693 supachai_pay B Sept. 14, 2020, 4:30 p.m. OK Python 2 TESTS 6 280 204800
92861281 llllllll B Sept. 14, 2020, 10:07 p.m. OK Python 3 TESTS 6 186 307200
92863143 pppss B Sept. 14, 2020, 11:53 p.m. OK Python 3 TESTS 6 202 409600
92870207 Ruslan448 B Sept. 15, 2020, 4:05 a.m. OK Python 3 TESTS 6 217 307200
92832938 crysis16 B Sept. 14, 2020, 4:05 p.m. OK Python 3 TESTS 6 217 307200
92835538 Goonzard B Sept. 14, 2020, 4:16 p.m. OK Python 3 TESTS 6 218 307200
92831806 Camazotz B Sept. 14, 2020, 4:01 p.m. OK Python 3 TESTS 6 218 307200
92856681 eugalt B Sept. 14, 2020, 7:48 p.m. OK Python 3 TESTS 6 233 0
92859991 apeksharustagi1998 B Sept. 14, 2020, 9:13 p.m. OK Python 3 TESTS 6 234 307200
92855868 Moody_in_a_hoodie B Sept. 14, 2020, 7:37 p.m. OK Python 3 TESTS 6 234 307200
92831520 eadadi B Sept. 14, 2020, 4 p.m. OK Python 3 TESTS 6 248 307200
92831982 GeoffreyY B Sept. 14, 2020, 4:01 p.m. OK Rust TESTS 6 62 102400
92861401 IvanDyachenko B Sept. 14, 2020, 10:13 p.m. OK Scala TESTS 6 607 102400

remove filters

Back to search problems