Educational Codeforces Round 81 (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
1295 Educational Codeforces Round 81 (Rated for Div. 2) FINISHED False 7200 157044311 Jan. 29, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2583 ) E Permutation Separation PROGRAMMING data structures divide and conquer 2200

B"You are given a permutation p_1, p_2, ... , p_n (an array where each integer from 1 to n appears exactly once). The weight of the i -th element of this permutation is a_i . At first, you separate your permutation into two non-empty sets -- prefix and suffix. More formally, the first set contains elements p_1, p_2, ... , p_k , the second -- p_{k+1}, p_{k+2}, ... , p_n , where 1 <= k < n . After that, you may move elements between sets. The operation you are allowed to do is to choose some element of the first set and move it to the second set, or vice versa (move from the second set to the first). You have to pay a_i dollars to move the element p_i . Your goal is to make it so that each element of the first set is less than each element of the second set. Note that if one of the sets is empty, this condition is met. For example, if p = [3, 1, 2] and a = [7, 1, 4] , then the optimal strategy is: separate p into two parts [3, 1] and [2] and then move the 2 -element into first set (it costs 4 ). And if p = [3, 5, 1, 6, 2, 4] , a = [9, 1, 9, 9, 1, 9] , then the optimal strategy is: separate p into two parts [3, 5, 1] and [6, 2, 4] , and then move the 2 -element into first set (it costs 1 ), and 5 -element into second set (it also costs 1 ). Calculate the minimum number of dollars you have to spend. The first line contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the length of permutation. The second line contains n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n ). It's guaranteed that this sequence contains each element from 1 to n exactly once. The third line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ). Print one integer -- the minimum number of dollars you have to spend. "...

Tutorials

Educational Codeforces Round 81 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
70165469 17wh1a1235 E Feb. 3, 2020, 4:22 p.m. OK Clang++17 Diagnostics TESTS 25 1669 16691200 2200
69919118 toterpinguin E Jan. 31, 2020, 5:50 p.m. OK GNU C11 TESTS 25 108 20582400 2200
69999001 alpeevandrey E Feb. 1, 2020, 11:47 p.m. OK GNU C11 TESTS 25 529 12390400 2200
69807541 yajnun E Jan. 30, 2020, 2:44 a.m. OK GNU C++11 TESTS 25 62 3174400 2200
69826424 yajnun E Jan. 30, 2020, 9:17 a.m. OK GNU C++11 TESTS 25 77 3174400 2200
69932795 hhhjhy E Feb. 1, 2020, 1:30 a.m. OK GNU C++11 TESTS 25 93 16076800 2200
69873258 command_block E Jan. 31, 2020, 2:09 a.m. OK GNU C++11 TESTS 25 109 17510400 2200
69823405 TEAs E Jan. 30, 2020, 8:33 a.m. OK GNU C++11 TESTS 25 124 3174400 2200
69781612 command_block E Jan. 29, 2020, 4:34 p.m. OK GNU C++11 TESTS 25 124 17510400 2200
69769127 msuwakow E Jan. 29, 2020, 3:57 p.m. OK GNU C++11 TESTS 25 124 22732800 2200
69809896 goodmorning200 E Jan. 30, 2020, 3:52 a.m. OK GNU C++11 TESTS 25 124 24064000 2200
69935670 CTP_314 E Feb. 1, 2020, 3:34 a.m. OK GNU C++11 TESTS 25 140 16691200 2200
70434748 Sakura-hero E Feb. 6, 2020, 12:35 p.m. OK GNU C++11 TESTS 25 140 16691200 2200
69781925 KaguraNana E Jan. 29, 2020, 4:36 p.m. OK GNU C++14 TESTS 25 124 16179200 2200
69769974 watermelon_tree E Jan. 29, 2020, 3:59 p.m. OK GNU C++14 TESTS 25 171 15257600 2200
69809154 wh_bestwyj E Jan. 30, 2020, 3:32 a.m. OK GNU C++14 TESTS 25 171 15257600 2200
69840300 KisekiPurin2019 E Jan. 30, 2020, 12:58 p.m. OK GNU C++14 TESTS 25 171 21606400 2200
69780731 edsa E Jan. 29, 2020, 4:32 p.m. OK GNU C++14 TESTS 25 171 40038400 2200
70034154 vjudge4 E Feb. 2, 2020, 1:44 p.m. OK GNU C++14 TESTS 25 186 17612800 2200
69790095 demoralizer E Jan. 29, 2020, 6:15 p.m. OK GNU C++14 TESTS 25 187 7577600 2200
69772648 hellomath E Jan. 29, 2020, 4:08 p.m. OK GNU C++14 TESTS 25 187 15257600 2200
70002082 ILoLy E Feb. 2, 2020, 2:26 a.m. OK GNU C++14 TESTS 25 187 101478400 2200
70103166 gote E Feb. 3, 2020, 1:20 a.m. OK GNU C++14 TESTS 25 202 14438400 2200
69854329 Felerius E Jan. 30, 2020, 4:32 p.m. OK GNU C++17 TESTS 25 139 10854400 2200
69826228 tokitsukaze E Jan. 30, 2020, 9:14 a.m. OK GNU C++17 TESTS 25 155 16179200 2200
69932333 Felerius E Feb. 1, 2020, 1:04 a.m. OK GNU C++17 TESTS 25 156 9216000 2200
69892859 dinosaurs E Jan. 31, 2020, 10:40 a.m. OK GNU C++17 TESTS 25 171 9625600 2200
69844224 timothyhorsc E Jan. 30, 2020, 1:56 p.m. OK GNU C++17 TESTS 25 171 13209600 2200
70702876 Unsterblicher_Geist E Feb. 10, 2020, 3:43 a.m. OK GNU C++17 TESTS 25 171 35635200 2200
69776502 p6pou E Jan. 29, 2020, 4:20 p.m. OK GNU C++17 TESTS 25 187 12390400 2200
69788640 kefaa2 E Jan. 29, 2020, 5:52 p.m. OK GNU C++17 TESTS 25 202 16076800 2200
69873842 tsh E Jan. 31, 2020, 2:36 a.m. OK GNU C++17 TESTS 25 202 16076800 2200
69781302 11th E Jan. 29, 2020, 4:34 p.m. OK GNU C++17 TESTS 25 202 16793600 2200
70833598 toterpinguin E Feb. 12, 2020, 9:19 a.m. OK Go TESTS 25 155 21708800 2200
70818268 toterpinguin E Feb. 12, 2020, 1:52 a.m. OK Go TESTS 25 233 36147200 2200
69955659 prashanth7638 E Feb. 1, 2020, 10:04 a.m. OK Java 11 TESTS 25 452 11571200 2200
69796928 ZeyadKhattab E Jan. 29, 2020, 8:30 p.m. OK Java 11 TESTS 25 514 14848000 2200
69801651 TheSawan E Jan. 29, 2020, 10:53 p.m. OK Java 11 TESTS 25 576 8192000 2200
69796806 Dukkha E Jan. 29, 2020, 8:26 p.m. OK Java 11 TESTS 25 701 5017600 2200
69782415 sarthakmanna E Jan. 29, 2020, 4:39 p.m. OK Java 11 TESTS 25 716 0 2200
69959447 KharYusuf E Feb. 1, 2020, 11:03 a.m. OK Java 8 TESTS 25 327 9318400 2200
69802204 BNL E Jan. 29, 2020, 11:15 p.m. OK Java 8 TESTS 25 373 10649600 2200
69959389 KharYusuf E Feb. 1, 2020, 11:02 a.m. OK Java 8 TESTS 25 389 9318400 2200
69861499 KharYusuf E Jan. 30, 2020, 6:40 p.m. OK Java 8 TESTS 25 389 9318400 2200
70358791 Naman_123 E Feb. 5, 2020, 12:50 p.m. OK Java 8 TESTS 25 389 19046400 2200
69969132 dalt E Feb. 1, 2020, 1:26 p.m. OK Java 8 TESTS 25 389 48128000 2200
69797046 martins E Jan. 29, 2020, 8:33 p.m. OK Java 8 TESTS 25 420 25395200 2200
69788288 kr1210 E Jan. 29, 2020, 5:46 p.m. OK Java 8 TESTS 25 421 13004800 2200
69862080 KharYusuf E Jan. 30, 2020, 6:52 p.m. OK Java 8 TESTS 25 436 9216000 2200
69901901 WACry E Jan. 31, 2020, 1:13 p.m. OK Java 8 TESTS 25 467 18739200 2200
69883505 Spheniscine E Jan. 31, 2020, 7:18 a.m. OK Kotlin TESTS 25 405 20684800 2200
70004412 daxindg E Feb. 2, 2020, 3:59 a.m. OK Kotlin TESTS 25 826 74752000 2200
69767847 Heltion E Jan. 29, 2020, 3:53 p.m. OK Kotlin TESTS 25 873 39833600 2200
69821407 Spheniscine E Jan. 30, 2020, 7:59 a.m. OK Kotlin TESTS 25 888 35942400 2200
69829539 Spheniscine E Jan. 30, 2020, 10:04 a.m. OK Kotlin TESTS 25 967 36044800 2200
69992196 nehan_der_thal E Feb. 1, 2020, 7:49 p.m. OK Mono C# TESTS 25 608 53555200 2200
69776607 ngtkana E Jan. 29, 2020, 4:20 p.m. OK Mono C# TESTS 25 888 56832000 2200
69808555 mban259 E Jan. 30, 2020, 3:15 a.m. OK Mono C# TESTS 25 982 101478400 2200
69794504 r57shell E Jan. 29, 2020, 7:35 p.m. OK MS C++ TESTS 25 249 10854400 2200
70181398 hrustim25 E Feb. 3, 2020, 8:20 p.m. OK MS C++ TESTS 25 280 23347200 2200
70181210 hrustim25 E Feb. 3, 2020, 8:16 p.m. OK MS C++ TESTS 25 327 28979200 2200
70181235 hrustim25 E Feb. 3, 2020, 8:16 p.m. OK MS C++ TESTS 25 327 28979200 2200
70181016 hrustim25 E Feb. 3, 2020, 8:11 p.m. OK MS C++ TESTS 25 499 28979200 2200
70178191 hrustim25 E Feb. 3, 2020, 7:09 p.m. OK MS C++ TESTS 25 607 13209600 2200
69778482 tarattata1 E Jan. 29, 2020, 4:26 p.m. OK MS C++ TESTS 25 623 10035200 2200
69830165 tarattata1 E Jan. 30, 2020, 10:15 a.m. OK MS C++ TESTS 25 639 10035200 2200
70175692 hrustim25 E Feb. 3, 2020, 6:27 p.m. OK MS C++ TESTS 25 795 14233600 2200
69813822 AleksanderBalobanov E Jan. 30, 2020, 5:25 a.m. OK MS C++ 2017 TESTS 25 265 84172800 2200
69770882 pichulia E Jan. 29, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 25 295 11673600 2200
69819547 Parsa84 E Jan. 30, 2020, 7:17 a.m. OK MS C++ 2017 TESTS 25 514 17612800 2200
69791091 CrashMaster E Jan. 29, 2020, 6:32 p.m. OK MS C++ 2017 TESTS 25 654 16896000 2200
70175630 hrustim25 E Feb. 3, 2020, 6:26 p.m. OK MS C++ 2017 TESTS 25 826 13824000 2200
71044813 Ivan_Dunko E Feb. 14, 2020, 8:06 a.m. OK MS C++ 2017 TESTS 25 1294 20889600 2200
69823763 yudedako E Jan. 30, 2020, 8:38 a.m. OK MS C++ 2017 TESTS 25 1372 44646400 2200
69785597 pajenegod E Jan. 29, 2020, 5:08 p.m. OK PyPy 2 TESTS 25 545 35942400 2200
69785069 pajenegod E Jan. 29, 2020, 5:03 p.m. OK PyPy 2 TESTS 25 623 36659200 2200
69782286 pajenegod E Jan. 29, 2020, 4:38 p.m. OK PyPy 2 TESTS 25 748 28979200 2200
69876656 pineriver E Jan. 31, 2020, 4:24 a.m. OK PyPy 3 TESTS 25 1981 84889600 2200
69929548 titia E Jan. 31, 2020, 10:34 p.m. OK PyPy 3 TESTS 25 1996 112640000 2200
69774828 sansen E Jan. 29, 2020, 4:14 p.m. OK Rust TESTS 25 561 18739200 2200
70821525 BadDuck E Feb. 12, 2020, 4:08 a.m. OK Scala TESTS 25 1076 31232000 2200

remove filters

Back to search problems