Codeforces Round 823 (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
1730 Codeforces Round 823 (Div. 2) FINISHED False 7200 67706699 Sept. 25, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 554 ) F Almost Sorted PROGRAMMING bitmasks data structures dp 2700

B'You are given a permutation p of length n and a positive integer k . Consider a permutation q of length n such that for any integers i and j , where 1 <= i < j <= n , we have p_{q_i} <= p_{q_j} + k. Find the minimum possible number of inversions in a permutation q . A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array) and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). An inversion in a permutation a is a pair of indices i and j ( 1 <= i, j <= n ) such that i < j , but a_i > a_j . The first line contains two integers n and k ( 1 <= n <= 5000 , 1 <= k <= 8 ). The second line contains n distinct integers p_1, p_2, ldots, p_n ( 1 <= p_i <= n ). Print the minimum possible number of inversions in the permutation q . In the first example, the only permutation is q = [1] ( 0 inversions). Then p_{q_1} = 1 . In the second example, the only permutation with 1 inversion is q = [1, 3, 2] . Then p_{q_1} = 2 , p_{q_2} = 1 , p_{q_3} = 3 . In the third example, one of the possible permutations with 6 inversions is q = [3, 4, 5, 1, 2] . Then p_{q_1} = 3 , p_{q_2} = 2 , p_{q_3} = 1 , p_{q_4} = 5 , p_{q_5} = 4 . '...

Tutorials

Codeforces Round #823 — editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
173527315 Tyyyyyy F Sept. 26, 2022, 12:59 a.m. OK GNU C++14 TESTS 50 234 7270400 2700
173500587 Wangxueyi F Sept. 25, 2022, 5:36 p.m. OK GNU C++14 TESTS 50 265 107417600 2700
173537498 cun_thich_lap_trinh F Sept. 26, 2022, 4:25 a.m. OK GNU C++14 TESTS 50 280 5222400 2700
173530066 Vector_zhou F Sept. 26, 2022, 2 a.m. OK GNU C++14 TESTS 50 311 10342400 2700
173533014 Cstream F Sept. 26, 2022, 3:01 a.m. OK GNU C++14 TESTS 50 389 10342400 2700
173486891 Wailydest F Sept. 25, 2022, 4:19 p.m. OK GNU C++17 TESTS 50 296 205414400 2700
173498327 shnirelman F Sept. 25, 2022, 5:21 p.m. OK GNU C++17 TESTS 50 343 5222400 2700
173488009 SSRS_ F Sept. 25, 2022, 4:23 p.m. OK GNU C++17 TESTS 50 623 101171200 2700
173527237 Menna-Allah05 F Sept. 26, 2022, 12:57 a.m. OK GNU C++17 TESTS 50 1668 115609600 2700
173501137 NU_ICPC F Sept. 25, 2022, 5:40 p.m. OK GNU C++17 TESTS 50 1668 115609600 2700
173485211 cheissmart F Sept. 25, 2022, 4:15 p.m. OK GNU C++17 TESTS 50 1794 307200 2700
173523503 WHC-MIK-7521X F Sept. 25, 2022, 11:02 p.m. OK GNU C++17 (64) TESTS 50 218 105779200 2700
173487984 m_99 F Sept. 25, 2022, 4:22 p.m. OK GNU C++17 (64) TESTS 50 327 204800 2700
173529470 ZongDeChuangSiYiGeBa F Sept. 26, 2022, 1:47 a.m. OK GNU C++17 (64) TESTS 50 374 102400 2700
173492753 adventure F Sept. 25, 2022, 4:34 p.m. OK GNU C++17 (64) TESTS 50 576 11468800 2700
173503597 kotatsugame F Sept. 25, 2022, 5:59 p.m. OK GNU C++17 (64) TESTS 50 1388 307200 2700
173502529 PurpleCrayon F Sept. 25, 2022, 5:51 p.m. OK GNU C++17 (64) TESTS 50 1778 110899200 2700
173495597 Rubikun F Sept. 25, 2022, 5:06 p.m. OK GNU C++20 (64) TESTS 50 93 2252800 2700
173522563 SA01 F Sept. 25, 2022, 10:33 p.m. OK GNU C++20 (64) TESTS 50 202 47104000 2700
173530079 QwQcOrZ F Sept. 26, 2022, 2 a.m. OK GNU C++20 (64) TESTS 50 249 5222400 2700
173520130 keta_tsimakuridze F Sept. 25, 2022, 9:34 p.m. OK GNU C++20 (64) TESTS 50 249 111104000 2700
173539687 conzloi F Sept. 26, 2022, 5:08 a.m. OK GNU C++20 (64) TESTS 50 311 105779200 2700
173527775 Asuka F Sept. 26, 2022, 1:11 a.m. OK GNU C++20 (64) TESTS 50 311 105984000 2700
173491192 Nero F Sept. 25, 2022, 4:31 p.m. OK GNU C++20 (64) TESTS 50 312 204800 2700
173531642 He_Ren F Sept. 26, 2022, 2:33 a.m. OK GNU C++20 (64) TESTS 50 312 307200 2700
173490932 DerekFeng F Sept. 25, 2022, 4:30 p.m. OK GNU C++20 (64) TESTS 50 327 100352000 2700
173540291 zszz3 F Sept. 26, 2022, 5:18 a.m. OK GNU C++20 (64) TESTS 50 327 111308800 2700
173529824 sansen F Sept. 26, 2022, 1:55 a.m. OK Rust 2021 TESTS 50 639 102400 2700

remove filters

Back to search problems