Codeforces Global Round 7

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
1326 Codeforces Global Round 7 FINISHED False 9000 147194699 March 19, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15675 ) C Permutation Partitions PROGRAMMING combinatorics greedy math 1300

B"You are given a permutation p_1, p_2, ldots, p_n of integers from 1 to n and an integer k , such that 1 <= q k <= q n . A permutation means that every number from 1 to n is contained in p exactly once. Let's consider all partitions of this permutation into k disjoint segments. Formally, a partition is a set of segments {[l_1, r_1], [l_2, r_2], ldots, [l_k, r_k] } , such that: Two partitions are different if there exists a segment that lies in one partition but not the other. Let's calculate the partition value, defined as sum limits_{i=1}^{k} { max limits_{l_i <= q j <= q r_i} {p_j}} , for all possible partitions of the permutation into k disjoint segments. Find the maximum possible partition value over all such partitions, and the number of partitions with this value. As the second value can be very large, you should find its remainder when divided by 998 ,244 ,353 . The first line contains two integers, n and k ( 1 <= q k <= q n <= q 200 ,000 ) -- the size of the given permutation and the number of segments in a partition. The second line contains n different integers p_1, p_2, ldots, p_n ( 1 <= q p_i <= q n ) -- the given permutation. Print two integers -- the maximum possible partition value over all partitions of the permutation into k disjoint segments and the number of such partitions for which the partition value is equal to the maximum possible value, modulo 998 ,244 ,353 . Please note that you should only find the second value modulo 998 ,244 ,353 . In the first test, for k = 2 , there exists only two valid partitions: {[1, 1], [2, 3] } and {[1, 2], [3, 3] } . For each partition, the partition value is equal to 2 + 3 = 5 . So, the maximum possible value is 5 and the number of partitions is 2 . In the third test, for k = 3 , the partitions with the maximum possible partition valu"...

Tutorials

74961

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
73705523 ruban C March 19, 2020, 3:47 p.m. OK Delphi TESTS 66 78 189337600 1300
73703398 denchik007orel57 C March 19, 2020, 3:42 p.m. OK FPC TESTS 66 62 819200 1300
73814031 Madalina_Chirpicinic C March 20, 2020, 5:09 p.m. OK FPC TESTS 66 77 819200 1300
73760734 _sam__ C March 20, 2020, 5:12 a.m. OK GNU C11 TESTS 66 61 4915200 1300
73833127 kartik_2907 C March 20, 2020, 8:39 p.m. OK GNU C11 TESTS 66 62 0 1300
73781217 ordinary123 C March 20, 2020, 10:07 a.m. OK GNU C11 TESTS 66 62 0 1300
73781282 ARSLANNN C March 20, 2020, 10:08 a.m. OK GNU C11 TESTS 66 62 0 1300
73782489 akash19jain C March 20, 2020, 10:25 a.m. OK GNU C11 TESTS 66 62 0 1300
73792849 Iamso C March 20, 2020, 12:43 p.m. OK GNU C11 TESTS 66 62 0 1300
73761992 mygodimatomato C March 20, 2020, 5:31 a.m. OK GNU C11 TESTS 66 62 819200 1300
73703205 PhiCis C March 19, 2020, 3:42 p.m. OK GNU C11 TESTS 66 62 1638400 1300
73722380 c0degeek C March 19, 2020, 4:32 p.m. OK GNU C11 TESTS 66 77 1638400 1300
73702012 755352046 C March 19, 2020, 3:39 p.m. OK GNU C11 TESTS 66 77 1638400 1300
73751321 GGAutomaton C March 20, 2020, 1:16 a.m. OK GNU C++11 TESTS 66 31 0 1300
73832622 xht37 C March 20, 2020, 8:31 p.m. OK GNU C++11 TESTS 66 31 7372800 1300
73764589 cornivores Leidaxxb C March 20, 2020, 6:11 a.m. OK GNU C++11 TESTS 66 46 819200 1300
73768057 Sterling7 C March 20, 2020, 6:59 a.m. OK GNU C++11 TESTS 66 46 819200 1300
73789513 A.K.E.E. C March 20, 2020, 12:04 p.m. OK GNU C++11 TESTS 66 46 819200 1300
73750972 mikoo C March 20, 2020, 1:04 a.m. OK GNU C++11 TESTS 66 46 819200 1300
73707180 hzh767641495 C March 19, 2020, 3:51 p.m. OK GNU C++11 TESTS 66 46 1638400 1300
73706872 qq767641495 C March 19, 2020, 3:50 p.m. OK GNU C++11 TESTS 66 46 1638400 1300
73704282 Another_CraZYali C March 19, 2020, 3:44 p.m. OK GNU C++11 TESTS 66 46 1638400 1300
73760856 mengbierr C March 20, 2020, 5:14 a.m. OK GNU C++11 TESTS 66 46 2560000 1300
73702647 tokitsukaze C March 19, 2020, 3:40 p.m. OK GNU C++14 TESTS 66 46 921600 1300
73759432 broomstick C March 20, 2020, 4:49 a.m. OK GNU C++14 TESTS 66 62 0 1300
73835132 Almypa C March 20, 2020, 9:15 p.m. OK GNU C++14 TESTS 66 62 0 1300
73757314 rajdetroja C March 20, 2020, 4:06 a.m. OK GNU C++14 TESTS 66 62 819200 1300
73784765 Adel_Rizq C March 20, 2020, 11:01 a.m. OK GNU C++14 TESTS 66 62 819200 1300
73776515 iefnah06 C March 20, 2020, 8:57 a.m. OK GNU C++14 TESTS 66 62 1638400 1300
73704413 zcb C March 19, 2020, 3:45 p.m. OK GNU C++14 TESTS 66 62 1638400 1300
73715684 shahidul_brur C March 19, 2020, 4:13 p.m. OK GNU C++14 TESTS 66 62 2457600 1300
73759009 Komal_0509 C March 20, 2020, 4:41 a.m. OK GNU C++14 TESTS 66 62 2457600 1300
73707628 amitray1608 C March 19, 2020, 3:52 p.m. OK GNU C++14 TESTS 66 62 2457600 1300
73751677 _andyli C March 20, 2020, 1:29 a.m. OK GNU C++17 TESTS 66 31 3686400 1300
73781748 AAA_AA C March 20, 2020, 10:15 a.m. OK GNU C++17 TESTS 66 62 0 1300
73783692 Kripton2005 C March 20, 2020, 10:44 a.m. OK GNU C++17 TESTS 66 62 0 1300
73753745 ruz C March 20, 2020, 2:36 a.m. OK GNU C++17 TESTS 66 62 0 1300
73754822 Shou_ko C March 20, 2020, 3:07 a.m. OK GNU C++17 TESTS 66 62 0 1300
73761456 rniranjan93 C March 20, 2020, 5:23 a.m. OK GNU C++17 TESTS 66 62 0 1300
73803153 vjudge2 C March 20, 2020, 2:45 p.m. OK GNU C++17 TESTS 66 62 819200 1300
73832604 Mildog C March 20, 2020, 8:31 p.m. OK GNU C++17 TESTS 66 62 819200 1300
73724216 DanielChang19 C March 19, 2020, 4:37 p.m. OK GNU C++17 TESTS 66 62 819200 1300
73795999 Robukhi C March 20, 2020, 1:21 p.m. OK GNU C++17 TESTS 66 62 819200 1300
73825351 neal C March 20, 2020, 6:57 p.m. OK GNU C++17 (64) TESTS 66 62 2969600 1300
73833599 legion_geek C March 20, 2020, 8:46 p.m. OK GNU C++17 (64) TESTS 66 93 13209600 1300
73833520 legion_geek C March 20, 2020, 8:45 p.m. OK GNU C++17 (64) TESTS 66 93 13209600 1300
73741095 Jughead C March 19, 2020, 8:45 p.m. OK Go TESTS 66 62 102400 1300
73721777 yuki2006 C March 19, 2020, 4:30 p.m. OK Go TESTS 66 124 6246400 1300
73754910 synapse C March 20, 2020, 3:09 a.m. OK Go TESTS 66 140 819200 1300
73714214 sf14t C March 19, 2020, 4:09 p.m. OK Java 11 TESTS 66 218 0 1300
73767940 anujj C March 20, 2020, 6:57 a.m. OK Java 11 TESTS 66 233 0 1300
73746976 atishay127 C March 19, 2020, 10:47 p.m. OK Java 11 TESTS 66 233 0 1300
73758811 abhi123valani C March 20, 2020, 4:37 a.m. OK Java 11 TESTS 66 248 0 1300
73784971 kirtidabas C March 20, 2020, 11:03 a.m. OK Java 11 TESTS 66 249 0 1300
73758222 its_aks_ulure C March 20, 2020, 4:24 a.m. OK Java 11 TESTS 66 249 0 1300
73722021 achen.80 C March 19, 2020, 4:31 p.m. OK Java 11 TESTS 66 249 0 1300
73720203 Moonlit C March 19, 2020, 4:25 p.m. OK Java 11 TESTS 66 249 0 1300
73717964 anhpp C March 19, 2020, 4:19 p.m. OK Java 11 TESTS 66 249 0 1300
73754406 Raj9400 C March 20, 2020, 2:56 a.m. OK Java 11 TESTS 66 264 0 1300
73756104 bluesky111 C March 20, 2020, 3:38 a.m. OK Java 8 TESTS 66 124 0 1300
73704876 Darko C March 19, 2020, 3:46 p.m. OK Java 8 TESTS 66 124 0 1300
73762666 amolpratap007 C March 20, 2020, 5:42 a.m. OK Java 8 TESTS 66 139 0 1300
73817467 laxit_y C March 20, 2020, 5:42 p.m. OK Java 8 TESTS 66 139 0 1300
73785635 Bhargav9427 C March 20, 2020, 11:13 a.m. OK Java 8 TESTS 66 139 0 1300
73717515 schwarzahl C March 19, 2020, 4:18 p.m. OK Java 8 TESTS 66 139 0 1300
73805557 MafKrjoBhai C March 20, 2020, 3:16 p.m. OK Java 8 TESTS 66 140 0 1300
73745683 Mann_27__ C March 19, 2020, 10:12 p.m. OK Java 8 TESTS 66 140 0 1300
73708576 sguar C March 19, 2020, 3:55 p.m. OK Java 8 TESTS 66 140 0 1300
73760999 te_amo C March 20, 2020, 5:16 a.m. OK Java 8 TESTS 66 140 17817600 1300
73754114 Spheniscine C March 20, 2020, 2:47 a.m. OK Kotlin TESTS 66 186 3686400 1300
73753136 Spheniscine C March 20, 2020, 2:18 a.m. OK Kotlin TESTS 66 186 3891200 1300
73802070 SlavaG C March 20, 2020, 2:33 p.m. OK Kotlin TESTS 66 202 5529600 1300
73714268 SlavaG C March 19, 2020, 4:09 p.m. OK Kotlin TESTS 66 218 5734400 1300
73776010 PugachAG C March 20, 2020, 8:49 a.m. OK Kotlin TESTS 66 265 14745600 1300
73710715 sid9406 C March 19, 2020, 4 p.m. OK Kotlin TESTS 66 327 14028800 1300
73780422 darnley C March 20, 2020, 9:56 a.m. OK Kotlin TESTS 66 358 16793600 1300
73721392 AsuraPro C March 19, 2020, 4:29 p.m. OK Kotlin TESTS 66 405 4403200 1300
73731921 jonas.havelka.42 C March 19, 2020, 5 p.m. OK Kotlin TESTS 66 405 15155200 1300
73718380 abdukodir C March 19, 2020, 4:20 p.m. OK Kotlin TESTS 66 670 16486400 1300
73772304 htspur C March 20, 2020, 8 a.m. OK Mono C# TESTS 66 109 7270400 1300
73705212 O_Ramanujan C March 19, 2020, 3:46 p.m. OK Mono C# TESTS 66 124 22016000 1300
73746411 TMHazem C March 19, 2020, 10:31 p.m. OK MS C++ TESTS 66 62 2969600 1300
73708415 jaispa C March 19, 2020, 3:54 p.m. OK MS C++ TESTS 66 156 0 1300
73724389 theweird C March 19, 2020, 4:38 p.m. OK MS C++ TESTS 66 187 1638400 1300
73702270 Spirit_of_the_moon C March 19, 2020, 3:39 p.m. OK MS C++ TESTS 66 280 9728000 1300
73720331 hwqconceptnick C March 19, 2020, 4:26 p.m. OK MS C++ 2017 TESTS 66 78 307200 1300
73774966 hnust_zengwei1 C March 20, 2020, 8:37 a.m. OK MS C++ 2017 TESTS 66 78 819200 1300
73756767 qwe123rt45 C March 20, 2020, 3:52 a.m. OK MS C++ 2017 TESTS 66 78 16076800 1300
73732724 Tuenjuko C March 19, 2020, 5:02 p.m. OK MS C++ 2017 TESTS 66 93 0 1300
73774630 hnust_zengwei1 C March 20, 2020, 8:32 a.m. OK MS C++ 2017 TESTS 66 93 819200 1300
73717826 ZCW2000 C March 19, 2020, 4:19 p.m. OK MS C++ 2017 TESTS 66 93 1843200 1300
73702920 Player1_SERG C March 19, 2020, 3:41 p.m. OK MS C++ 2017 TESTS 66 109 1638400 1300
73831833 danilgrig C March 20, 2020, 8:19 p.m. OK MS C++ 2017 TESTS 66 171 819200 1300
73708278 Mikage32 C March 19, 2020, 3:54 p.m. OK MS C++ 2017 TESTS 66 171 1843200 1300
73707552 mrx_slm C March 19, 2020, 3:52 p.m. OK MS C++ 2017 TESTS 66 186 3276800 1300
73792268 Harolinch C March 20, 2020, 12:36 p.m. OK Node.js TESTS 66 280 15052800 1300
73786769 Harolinch C March 20, 2020, 11:28 a.m. OK Node.js TESTS 66 280 15155200 1300
73702401 klond90 C March 19, 2020, 3:40 p.m. OK Node.js TESTS 66 920 29593600 1300
73805323 mayakin C March 20, 2020, 3:13 p.m. OK PHP TESTS 66 451 16384000 1300
73706692 snape_here C March 19, 2020, 3:50 p.m. OK PyPy 2 TESTS 66 249 19968000 1300
73711794 hritik3878 C March 19, 2020, 4:03 p.m. OK PyPy 2 TESTS 66 311 13926400 1300
73750636 the_sf C March 20, 2020, 12:52 a.m. OK PyPy 2 TESTS 66 342 19148800 1300
73711562 wolffd C March 19, 2020, 4:02 p.m. OK PyPy 2 TESTS 66 420 18227200 1300
73718097 fel2fram C March 19, 2020, 4:19 p.m. OK PyPy 2 TESTS 66 763 16588800 1300
73723818 ImNewables C March 19, 2020, 4:36 p.m. OK PyPy 3 TESTS 66 249 18636800 1300
73834125 summer.3AM C March 20, 2020, 8:56 p.m. OK PyPy 3 TESTS 66 280 11776000 1300
73756612 renjied C March 20, 2020, 3:50 a.m. OK PyPy 3 TESTS 66 280 13414400 1300
73703278 dhruva_shashi C March 19, 2020, 3:42 p.m. OK PyPy 3 TESTS 66 280 15257600 1300
73706055 VVejalla C March 19, 2020, 3:48 p.m. OK PyPy 3 TESTS 66 280 15462400 1300
73768548 koptev C March 20, 2020, 7:06 a.m. OK PyPy 3 TESTS 66 280 16179200 1300
73723793 viditrockz26 C March 19, 2020, 4:36 p.m. OK PyPy 3 TESTS 66 280 16793600 1300
73798235 vishwesh18 C March 20, 2020, 1:47 p.m. OK PyPy 3 TESTS 66 280 16896000 1300
73766199 sapna_tomar C March 20, 2020, 6:32 a.m. OK PyPy 3 TESTS 66 280 16998400 1300
73724236 HeavensC C March 19, 2020, 4:37 p.m. OK PyPy 3 TESTS 66 280 18739200 1300
73706423 hkawaguc C March 19, 2020, 3:49 p.m. OK Python 3 TESTS 66 217 14643200 1300
73750907 eugalt C March 20, 2020, 1:02 a.m. OK Python 3 TESTS 66 249 11878400 1300
73766688 Daniil_Gorohov C March 20, 2020, 6:39 a.m. OK Python 3 TESTS 66 249 14643200 1300
73703995 jamesb007 C March 19, 2020, 3:44 p.m. OK Python 3 TESTS 66 249 14643200 1300
73745821 eugalt C March 19, 2020, 10:15 p.m. OK Python 3 TESTS 66 264 14233600 1300
73703201 guiferviz C March 19, 2020, 3:42 p.m. OK Python 3 TESTS 66 264 14643200 1300
73769709 mr_jt C March 20, 2020, 7:23 a.m. OK Python 3 TESTS 66 265 14336000 1300
73810836 FlyingBag65 C March 20, 2020, 4:30 p.m. OK Python 3 TESTS 66 265 14643200 1300
73705022 squiggly C March 19, 2020, 3:46 p.m. OK Python 3 TESTS 66 265 14643200 1300
73747570 eugalt C March 19, 2020, 11:07 p.m. OK Python 3 TESTS 66 280 11366400 1300
73706513 simanman C March 19, 2020, 3:50 p.m. OK Ruby TESTS 66 389 40448000 1300
73719230 rustafarian C March 19, 2020, 4:23 p.m. OK Rust TESTS 66 93 9318400 1300
73705057 BadDuck C March 19, 2020, 3:46 p.m. OK Scala TESTS 66 623 17510400 1300

remove filters

Back to search problems