Educational Codeforces Round 102 (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
1473 Educational Codeforces Round 102 (Rated for Div. 2) FINISHED False 7200 121188299 Jan. 14, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12729 ) C No More Inversions PROGRAMMING constructive algorithms

B"You have a sequence a with n elements 1, 2, 3, ... , k - 1, k, k - 1, k - 2, ... , k - (n - k) ( k <= n < 2k ). Let's call as inversion in a a pair of indices i < j such that a[i] > a[j] . Suppose, you have some permutation p of size k and you build a sequence b of size n in the following manner: b[i] = p[a[i]] . Your goal is to find such permutation p that the total number of inversions in b doesn't exceed the total number of inversions in a , and b is lexicographically maximum. Small reminder: the sequence of k integers is called a permutation if it contains all integers from 1 to k exactly once. Another small reminder: a sequence s is lexicographically smaller than another sequence t , if either s is a prefix of t , or for the first i such that s_i ne t_i , s_i < t_i holds (in the first position that these sequences are different, s has smaller number than t ). The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first and only line of each test case contains two integers n and k ( k <= n < 2k ; 1 <= k <= 10^5 ) -- the length of the sequence a and its maximum. It's guaranteed that the total sum of k over test cases doesn't exceed 10^5 . For each test case, print k integers -- the permutation p which maximizes b lexicographically without increasing the total number of inversions. It can be proven that p exists and is unique. In the first test case, the sequence a = [1] , there is only one permutation p = [1] . In the second test case, the sequence a = [1, 2] . There is no inversion in a , so there is only one permutation p = [1, 2] which doesn't increase the number of inversions. In the third test case, a = [1, 2, 1] and has 1 inversi"...

Tutorials

Educational Codeforces Round 102 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
104369725 1435730 C Jan. 14, 2021, 11:52 p.m. OK GNU C11 TESTS 5 343 0
104373884 Lucky7 C Jan. 15, 2021, 2:50 a.m. OK GNU C11 TESTS 5 358 0
104358598 bhakti8 C Jan. 14, 2021, 6:30 p.m. OK GNU C11 TESTS 5 358 0
104371818 zja601 C Jan. 15, 2021, 1:34 a.m. OK GNU C11 TESTS 5 374 0
104375750 yWieLoc C Jan. 15, 2021, 3:47 a.m. OK GNU C++11 TESTS 5 30 0
104344348 Luoxu C Jan. 14, 2021, 4:28 p.m. OK GNU C++11 TESTS 5 31 0
104370791 xxxxx250 C Jan. 15, 2021, 12:45 a.m. OK GNU C++11 TESTS 5 31 0
104349130 srijon51 C Jan. 14, 2021, 4:38 p.m. OK GNU C++11 TESTS 5 31 0
104348147 johnson10024 C Jan. 14, 2021, 4:34 p.m. OK GNU C++11 TESTS 5 31 0
104347244 zmmO_o C Jan. 14, 2021, 4:32 p.m. OK GNU C++11 TESTS 5 31 0
104346240 JuruoAln C Jan. 14, 2021, 4:30 p.m. OK GNU C++11 TESTS 5 31 0
104372111 Caplan_thruster C Jan. 15, 2021, 1:45 a.m. OK GNU C++11 TESTS 5 31 0
104371779 Hongzy C Jan. 15, 2021, 1:32 a.m. OK GNU C++11 TESTS 5 31 0
104375919 DREAMandBOY C Jan. 15, 2021, 3:51 a.m. OK GNU C++11 TESTS 5 31 0
104349669 ianujvarshney C Jan. 14, 2021, 4:42 p.m. OK GNU C++14 TESTS 5 15 0
104381618 ssGitansh C Jan. 15, 2021, 6:07 a.m. OK GNU C++14 TESTS 5 15 0
104377348 itachi_Ucchihaa C Jan. 15, 2021, 4:28 a.m. OK GNU C++14 TESTS 5 15 0
104375500 kd07 C Jan. 15, 2021, 3:39 a.m. OK GNU C++14 TESTS 5 15 0
104372084 nikkk_nischal C Jan. 15, 2021, 1:44 a.m. OK GNU C++14 TESTS 5 15 0
104341847 JinChuan C Jan. 14, 2021, 4:25 p.m. OK GNU C++14 TESTS 5 15 819200
104343825 JonnyR C Jan. 14, 2021, 4:28 p.m. OK GNU C++14 TESTS 5 15 2560000
104376488 izaj C Jan. 15, 2021, 4:06 a.m. OK GNU C++14 TESTS 5 30 0
104381336 to1900 C Jan. 15, 2021, 6:03 a.m. OK GNU C++14 TESTS 5 30 0
104377357 joy_umar_hasan C Jan. 15, 2021, 4:28 a.m. OK GNU C++14 TESTS 5 30 0
104348687 minhnguyenxuan60 C Jan. 14, 2021, 4:36 p.m. OK GNU C++17 TESTS 5 15 0
104357913 code.till.pro C Jan. 14, 2021, 6:20 p.m. OK GNU C++17 TESTS 5 15 0
104352783 lll_99 C Jan. 14, 2021, 5:10 p.m. OK GNU C++17 TESTS 5 15 0
104351704 Spider47 C Jan. 14, 2021, 4:59 p.m. OK GNU C++17 TESTS 5 15 0
104348023 Badum-Tudum C Jan. 14, 2021, 4:34 p.m. OK GNU C++17 TESTS 5 15 0
104346155 wjyue2001 C Jan. 14, 2021, 4:30 p.m. OK GNU C++17 TESTS 5 15 0
104343944 SuyashTandon C Jan. 14, 2021, 4:28 p.m. OK GNU C++17 TESTS 5 15 0
104340901 smartestOrangutan C Jan. 14, 2021, 4:24 p.m. OK GNU C++17 TESTS 5 15 0
104357846 shinyruoBegin C Jan. 14, 2021, 6:19 p.m. OK GNU C++17 TESTS 5 15 409600
104342678 ShirChoi C Jan. 14, 2021, 4:26 p.m. OK GNU C++17 TESTS 5 15 409600
104346912 snuphy C Jan. 14, 2021, 4:32 p.m. OK GNU C++17 (64) TESTS 5 15 0
104368507 dgcnz C Jan. 14, 2021, 10:54 p.m. OK GNU C++17 (64) TESTS 5 15 0
104369450 ScarletS C Jan. 14, 2021, 11:39 p.m. OK GNU C++17 (64) TESTS 5 15 0
104372688 Ernestico C Jan. 15, 2021, 2:08 a.m. OK GNU C++17 (64) TESTS 5 15 0
104354601 _Mafia C Jan. 14, 2021, 5:32 p.m. OK GNU C++17 (64) TESTS 5 15 0
104351794 PR_0202 C Jan. 14, 2021, 5 p.m. OK GNU C++17 (64) TESTS 5 15 819200
104351529 raamxD C Jan. 14, 2021, 4:57 p.m. OK GNU C++17 (64) TESTS 5 15 819200
104348750 BrownieTK C Jan. 14, 2021, 4:36 p.m. OK GNU C++17 (64) TESTS 5 15 921600
104343077 shiro53 C Jan. 14, 2021, 4:27 p.m. OK GNU C++17 (64) TESTS 5 15 1024000
104355928 vincent97198 C Jan. 14, 2021, 5:51 p.m. OK GNU C++17 (64) TESTS 5 15 1638400
104344044 maguroguma C Jan. 14, 2021, 4:28 p.m. OK Go TESTS 5 46 9728000
104356972 reennn C Jan. 14, 2021, 6:06 p.m. OK Java 11 TESTS 5 186 0
104359422 Sarvjeet619 C Jan. 14, 2021, 6:44 p.m. OK Java 11 TESTS 5 187 0
104359956 Sarvjeet619 C Jan. 14, 2021, 6:53 p.m. OK Java 11 TESTS 5 202 0
104363564 singhdhanwant C Jan. 14, 2021, 8:08 p.m. OK Java 11 TESTS 5 202 0
104361386 gssakash C Jan. 14, 2021, 7:20 p.m. OK Java 11 TESTS 5 202 0
104360459 jamesfan961101 C Jan. 14, 2021, 7:01 p.m. OK Java 11 TESTS 5 202 0
104358779 baba_yagga C Jan. 14, 2021, 6:33 p.m. OK Java 11 TESTS 5 202 0
104358724 bittubittu C Jan. 14, 2021, 6:32 p.m. OK Java 11 TESTS 5 202 0
104358315 Future_Googley C Jan. 14, 2021, 6:26 p.m. OK Java 11 TESTS 5 202 0
104355545 mohitjha727 C Jan. 14, 2021, 5:46 p.m. OK Java 11 TESTS 5 202 0
104367340 flyman3046 C Jan. 14, 2021, 10:09 p.m. OK Java 8 TESTS 5 108 0
104339659 pavel.v.shlyk C Jan. 14, 2021, 4:22 p.m. OK Java 8 TESTS 5 108 0
104359424 sumitnitesh123 C Jan. 14, 2021, 6:44 p.m. OK Java 8 TESTS 5 109 0
104354437 IBatJ C Jan. 14, 2021, 5:30 p.m. OK Java 8 TESTS 5 109 0
104363366 RonWonWon C Jan. 14, 2021, 8:04 p.m. OK Java 8 TESTS 5 124 0
104362439 aadersh321chaubey C Jan. 14, 2021, 7:42 p.m. OK Java 8 TESTS 5 124 0
104358607 Sharon C Jan. 14, 2021, 6:31 p.m. OK Java 8 TESTS 5 124 0
104355605 qlf9 C Jan. 14, 2021, 5:47 p.m. OK Java 8 TESTS 5 124 0
104355527 InANutshell C Jan. 14, 2021, 5:46 p.m. OK Java 8 TESTS 5 124 0
104354148 MubtasimShahriar C Jan. 14, 2021, 5:26 p.m. OK Java 8 TESTS 5 124 0
104374953 Spheniscine C Jan. 15, 2021, 3:22 a.m. OK Kotlin TESTS 5 124 1126400
104344639 ostroumov C Jan. 14, 2021, 4:29 p.m. OK Kotlin TESTS 5 140 1024000
104344318 LeoPro C Jan. 14, 2021, 4:28 p.m. OK Kotlin TESTS 5 171 1843200
104348714 ch_hui C Jan. 14, 2021, 4:36 p.m. OK MS C++ 2017 TESTS 5 46 9011200
104356528 jungin0507 C Jan. 14, 2021, 6 p.m. OK MS C++ 2017 TESTS 5 62 0
104349395 Wayned C Jan. 14, 2021, 4:40 p.m. OK MS C++ 2017 TESTS 5 62 0
104353253 ustaritz C Jan. 14, 2021, 5:15 p.m. OK MS C++ 2017 TESTS 5 62 409600
104352163 getN1ght C Jan. 14, 2021, 5:04 p.m. OK MS C++ 2017 TESTS 5 62 819200
104373697 dlehgns011 C Jan. 15, 2021, 2:44 a.m. OK MS C++ 2017 TESTS 5 77 1024000
104348109 abacaba_ C Jan. 14, 2021, 4:34 p.m. OK MS C++ 2017 TESTS 5 78 0
104340529 jokebird C Jan. 14, 2021, 4:24 p.m. OK MS C++ 2017 TESTS 5 78 0
104342495 jongwook123 C Jan. 14, 2021, 4:26 p.m. OK MS C++ 2017 TESTS 5 78 409600
104376726 Bekzaat17 C Jan. 15, 2021, 4:12 a.m. OK PHP TESTS 5 46 0
104341124 black_rabbit C Jan. 14, 2021, 4:25 p.m. OK PyPy 2 TESTS 5 93 9011200
104343738 kagu C Jan. 14, 2021, 4:27 p.m. OK PyPy 2 TESTS 5 109 4096000
104347698 GuptaSir C Jan. 14, 2021, 4:33 p.m. OK PyPy 3 TESTS 5 108 7065600
104339757 hxu10 C Jan. 14, 2021, 4:22 p.m. OK PyPy 3 TESTS 5 124 9523200
104356788 conqueror_of_tourist C Jan. 14, 2021, 6:03 p.m. OK PyPy 3 TESTS 5 124 10649600
104349591 nhipata C Jan. 14, 2021, 4:41 p.m. OK PyPy 3 TESTS 5 140 7577600
104352063 happyn6s1 C Jan. 14, 2021, 5:02 p.m. OK PyPy 3 TESTS 5 140 7884800
104363122 deepanshu_pali C Jan. 14, 2021, 7:58 p.m. OK PyPy 3 TESTS 5 140 8089600
104351055 marcus.li C Jan. 14, 2021, 4:53 p.m. OK PyPy 3 TESTS 5 140 8192000
104350264 aberent C Jan. 14, 2021, 4:46 p.m. OK PyPy 3 TESTS 5 140 9830400
104365820 musdolph C Jan. 14, 2021, 9:15 p.m. OK PyPy 3 TESTS 5 155 7475200
104364358 ramgarg102 C Jan. 14, 2021, 8:29 p.m. OK PyPy 3 TESTS 5 155 7475200
104377128 paka C Jan. 15, 2021, 4:22 a.m. OK Python 3 TESTS 5 77 7065600
104347338 batman_memory C Jan. 14, 2021, 4:33 p.m. OK Python 3 TESTS 5 78 6553600
104353447 wilsantow C Jan. 14, 2021, 5:18 p.m. OK Python 3 TESTS 5 93 5017600
104352989 hxu10 C Jan. 14, 2021, 5:13 p.m. OK Python 3 TESTS 5 108 7987200
104349569 _Asymptote_ C Jan. 14, 2021, 4:41 p.m. OK Python 3 TESTS 5 108 7987200
104361349 CLA_US C Jan. 14, 2021, 7:20 p.m. OK Python 3 TESTS 5 124 7577600
104354567 bhy_ahmed C Jan. 14, 2021, 5:32 p.m. OK Python 3 TESTS 5 155 4505600
104352479 hidir C Jan. 14, 2021, 5:07 p.m. OK Python 3 TESTS 5 170 3072000
104350540 Joel_Sathi C Jan. 14, 2021, 4:48 p.m. OK Python 3 TESTS 5 170 3072000
104358264 sh1194 C Jan. 14, 2021, 6:25 p.m. OK Python 3 TESTS 5 171 3072000

remove filters

Back to search problems