Codeforces Global Round 19

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
1637 Codeforces Global Round 19 FINISHED False 9000 92503463 Feb. 12, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 336 ) H Minimize Inversions Number PROGRAMMING data structures math sortings

B"You are given a permutation p of length n . You can choose any subsequence, remove it from the permutation, and insert it at the beginning of the permutation keeping the same order. For every k from 0 to n , find the minimal possible number of inversions in the permutation after you choose a subsequence of length exactly k . The first line contains a single integer t ( 1 <= t <= 50 ,000 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= n <= 5 cdot 10^5 ) -- the length of the permutation. The second line of each test case contains the permutation p_1, p_2, ldots, p_n ( 1 <= p_i <= n ). It is guaranteed that the total sum of n doesn't exceed 5 cdot 10^5 . For each test case output n + 1 integers. The i -th of them must be the answer for the subsequence length of i - 1 . In the second test case: "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
146181427 Atreus H Feb. 13, 2022, 12:17 a.m. OK GNU C++17 TESTS 72 358 10035200
146152103 Um_nik H Feb. 12, 2022, 5:01 p.m. OK GNU C++17 TESTS 72 1372 58880000
146159637 ecnerwala H Feb. 12, 2022, 6:14 p.m. OK GNU C++17 (64) TESTS 72 233 3993600
146168377 rainboy H Feb. 12, 2022, 7:45 p.m. OK GNU C++17 (64) TESTS 72 249 13926400
146167805 rainboy H Feb. 12, 2022, 7:38 p.m. OK GNU C++17 (64) TESTS 72 296 11980800
146173284 4fecta H Feb. 12, 2022, 8:58 p.m. OK GNU C++17 (64) TESTS 72 405 12083200
146177859 duality H Feb. 12, 2022, 10:32 p.m. OK GNU C++17 (64) TESTS 72 577 6041600
146158154 maroonrk H Feb. 12, 2022, 6:05 p.m. OK GNU C++17 (64) TESTS 72 795 28876800
146170528 Benq H Feb. 12, 2022, 8:14 p.m. OK GNU C++17 (64) TESTS 72 935 37683200
146182368 Dmitriy.Belichenko H Feb. 13, 2022, 12:45 a.m. OK GNU C++20 (64) TESTS 72 187 8294400
146160579 ksun48 H Feb. 12, 2022, 6:21 p.m. OK GNU C++20 (64) TESTS 72 202 10240000
146174733 Marian2905 H Feb. 12, 2022, 9:23 p.m. OK GNU C++20 (64) TESTS 72 202 17510400
146150631 Maksim1744 H Feb. 12, 2022, 4:58 p.m. OK GNU C++20 (64) TESTS 72 202 17510400
146166851 Hdk2127 H Feb. 12, 2022, 7:26 p.m. OK GNU C++20 (64) TESTS 72 218 10240000
146185463 Alan233 H Feb. 13, 2022, 2:09 a.m. OK GNU C++20 (64) TESTS 72 420 13414400
146185375 Tyyyyyy H Feb. 13, 2022, 2:07 a.m. OK GNU C++20 (64) TESTS 72 686 6041600
146164022 Bambamkumar_86770 H Feb. 12, 2022, 6:53 p.m. OK GNU C++20 (64) TESTS 72 1153 180224000
146151101 tourist H Feb. 12, 2022, 4:59 p.m. OK GNU C++20 (64) TESTS 72 1153 180224000
146178146 OLOGY H Feb. 12, 2022, 10:40 p.m. OK PyPy 2 TESTS 72 764 82739200
146181712 OLOGY H Feb. 13, 2022, 12:26 a.m. OK PyPy 2 TESTS 72 779 84377600

remove filters

Back to search problems