Codeforces Round 779 (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
1658 Codeforces Round 779 (Div. 2) FINISHED False 7200 83431499 March 27, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9389 ) C Shinju and the Lost Permutation PROGRAMMING constructive algorithms math

B"Shinju loves permutations very much! Today, she has borrowed a permutation p from Juju to play with. The i -th cyclic shift of a permutation p is a transformation on the permutation such that p = [p_1, p_2, ldots, p_n] will now become p = [p_{n-i+1}, ldots, p_n, p_1,p_2, ldots, p_{n-i}] . Let's define the power of permutation p as the number of distinct elements in the prefix maximums array b of the permutation. The prefix maximums array b is the array of length n such that b_i = max(p_1, p_2, ldots, p_i) . For example, the power of [1, 2, 5, 4, 6, 3] is 4 since b=[1,2,5,5,6,6] and there are 4 distinct elements in b . Unfortunately, Shinju has lost the permutation p ! The only information she remembers is an array c , where c_i is the power of the (i-1) -th cyclic shift of the permutation p . She's also not confident that she remembers it correctly, so she wants to know if her memory is good enough. Given the array c , determine if there exists a permutation p that is consistent with c . You do not have to construct the permutation p . 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). The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 5 cdot 10^3 ) -- the number of test cases. The first line of each test case contains an integer n ( 1 <= n <= 10^5 ). The second line of each test case contains n integers c_1,c_2, ldots,c_n ( 1 <= q c_i <= q n ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print"...

Tutorials

Codeforces Round #779 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
151200893 DXpoe C March 28, 2022, 4:03 a.m. OK Clang++17 Diagnostics TESTS 8 436 27340800
151171467 ruban C March 27, 2022, 5:25 p.m. OK Delphi TESTS 8 30 19353600
151192660 8208210229zyc C March 28, 2022, 12:22 a.m. OK GNU C11 TESTS 8 31 409600
151169429 ppsracchriskim C March 27, 2022, 5:08 p.m. OK GNU C11 TESTS 8 46 409600
151198419 SeventhMonth C March 28, 2022, 3:08 a.m. OK GNU C++14 TESTS 8 15 409600
151169549 harshit07__ C March 27, 2022, 5:09 p.m. OK GNU C++14 TESTS 8 15 409600
151198730 BLKyohou C March 28, 2022, 3:16 a.m. OK GNU C++14 TESTS 8 15 409600
151168647 Winterfrost C March 27, 2022, 5:03 p.m. OK GNU C++14 TESTS 8 15 512000
151182250 F_it C March 27, 2022, 7:42 p.m. OK GNU C++14 TESTS 8 15 819200
151162211 yiwu C March 27, 2022, 4:26 p.m. OK GNU C++14 TESTS 8 15 819200
151159859 FairyPumpkin C March 27, 2022, 4:21 p.m. OK GNU C++14 TESTS 8 15 819200
151194792 A1m233 C March 28, 2022, 1:29 a.m. OK GNU C++14 TESTS 8 15 819200
151192859 Sawan73 C March 28, 2022, 12:29 a.m. OK GNU C++14 TESTS 8 15 819200
151191881 aohkgnadnart C March 27, 2022, 11:54 p.m. OK GNU C++14 TESTS 8 15 1024000
151199532 strikalo C March 28, 2022, 3:34 a.m. OK GNU C++17 TESTS 8 15 409600
151198132 yuja C March 28, 2022, 3:01 a.m. OK GNU C++17 TESTS 8 15 409600
151198047 chenjj C March 28, 2022, 2:59 a.m. OK GNU C++17 TESTS 8 15 409600
151196742 l_liang C March 28, 2022, 2:26 a.m. OK GNU C++17 TESTS 8 15 409600
151195327 subobo C March 28, 2022, 1:46 a.m. OK GNU C++17 TESTS 8 15 409600
151194114 Sry_Yo__oH_Wait C March 28, 2022, 1:08 a.m. OK GNU C++17 TESTS 8 15 409600
151193353 baddog C March 28, 2022, 12:44 a.m. OK GNU C++17 TESTS 8 15 409600
151190787 krishshewani7 C March 27, 2022, 11:14 p.m. OK GNU C++17 TESTS 8 15 409600
151206833 prtks_22 C March 28, 2022, 5:49 a.m. OK GNU C++17 TESTS 8 15 409600
151203815 shayancoder C March 28, 2022, 4:59 a.m. OK GNU C++17 TESTS 8 15 409600
151185330 santiagogamer37 C March 27, 2022, 8:39 p.m. OK GNU C++17 (64) TESTS 8 15 0
151173606 hnust_liyi C March 27, 2022, 5:47 p.m. OK GNU C++17 (64) TESTS 8 15 307200
151199241 AkshitDh C March 28, 2022, 3:27 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151205577 YoungChigga C March 28, 2022, 5:29 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151201080 Amank2854 C March 28, 2022, 4:07 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151200369 Wang_Yuan C March 28, 2022, 3:53 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151200203 dididadu C March 28, 2022, 3:49 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151199800 naman1601 C March 28, 2022, 3:40 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151196066 mercury3682 C March 28, 2022, 2:07 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151196057 Steins__Gate C March 28, 2022, 2:07 a.m. OK GNU C++17 (64) TESTS 8 15 409600
151205800 XLS_A C March 28, 2022, 5:32 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151204213 hect123 C March 28, 2022, 5:07 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151204052 JiaRanDiana C March 28, 2022, 5:04 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151202507 sayanmedya C March 28, 2022, 4:35 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151201357 priyanshbarya C March 28, 2022, 4:13 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151199114 psa_28 C March 28, 2022, 3:24 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151198400 HalfStar C March 28, 2022, 3:08 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151198154 hghgh C March 28, 2022, 3:01 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151206967 Stobered C March 28, 2022, 5:51 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151207577 _HuangLB_ C March 28, 2022, 6 a.m. OK GNU C++20 (64) TESTS 8 15 409600
151195479 acrafle C March 28, 2022, 1:51 a.m. OK Go TESTS 8 31 3584000
151194246 0x3F C March 28, 2022, 1:12 a.m. OK Go TESTS 8 46 921600
151194517 0x3F C March 28, 2022, 1:20 a.m. OK Go TESTS 8 62 921600
151194420 0x3F C March 28, 2022, 1:17 a.m. OK Go TESTS 8 62 921600
151161799 LXL C March 27, 2022, 4:26 p.m. OK Go TESTS 8 62 921600
151192938 koqo C March 28, 2022, 12:31 a.m. OK Go TESTS 8 78 1433600
151186907 _ryan18_ C March 27, 2022, 9:15 p.m. OK Java 11 TESTS 8 171 0
151185791 henrychenOutlook C March 27, 2022, 8:49 p.m. OK Java 11 TESTS 8 171 0
151184332 Khater C March 27, 2022, 8:20 p.m. OK Java 11 TESTS 8 171 0
151180787 LongWalk C March 27, 2022, 7:18 p.m. OK Java 11 TESTS 8 171 0
151179001 LongWalk C March 27, 2022, 6:54 p.m. OK Java 11 TESTS 8 171 0
151177740 LongWalk C March 27, 2022, 6:36 p.m. OK Java 11 TESTS 8 171 0
151199340 ashish1729 C March 28, 2022, 3:30 a.m. OK Java 11 TESTS 8 186 0
151196859 arcde40 C March 28, 2022, 2:29 a.m. OK Java 11 TESTS 8 186 0
151168174 LongWalk C March 27, 2022, 5 p.m. OK Java 11 TESTS 8 186 0
151203218 Tier33 C March 28, 2022, 4:48 a.m. OK Java 11 TESTS 8 187 0
151199251 govindrajput C March 28, 2022, 3:27 a.m. OK Java 8 TESTS 8 93 0
151180348 invincible777 C March 27, 2022, 7:12 p.m. OK Java 8 TESTS 8 93 0
151170541 NoobAk C March 27, 2022, 5:17 p.m. OK Java 8 TESTS 8 93 0
151193735 saltedfish54250 C March 28, 2022, 12:56 a.m. OK Java 8 TESTS 8 93 0
151179539 ak_ankit C March 27, 2022, 7:01 p.m. OK Java 8 TESTS 8 108 0
151200794 aggarwalanshul01 C March 28, 2022, 4:02 a.m. OK Java 8 TESTS 8 109 0
151197872 ninjamayank C March 28, 2022, 2:54 a.m. OK Java 8 TESTS 8 109 0
151191197 kasyu C March 27, 2022, 11:29 p.m. OK Java 8 TESTS 8 109 0
151187109 adi_7861 C March 27, 2022, 9:21 p.m. OK Java 8 TESTS 8 109 0
151178114 sky9313 C March 27, 2022, 6:42 p.m. OK Java 8 TESTS 8 109 0
151200579 BruteForcee C March 28, 2022, 3:57 a.m. OK Kotlin 1.4 TESTS 8 139 921600
151185323 Tlatoani C March 27, 2022, 8:39 p.m. OK Kotlin 1.4 TESTS 8 186 1945600
151161857 hotkey C March 27, 2022, 4:26 p.m. OK Kotlin 1.4 TESTS 8 187 2252800
151158998 BIT C March 27, 2022, 4:19 p.m. OK Mono C# TESTS 8 77 11366400
151196421 LuckyInaba14 C March 28, 2022, 2:17 a.m. OK MS C++ 2017 TESTS 8 31 409600
151204749 F_Rio C March 28, 2022, 5:15 a.m. OK MS C++ 2017 TESTS 8 31 409600
151161113 te06008 C March 27, 2022, 4:24 p.m. OK MS C++ 2017 TESTS 8 62 409600
151195858 code-n-roll C March 28, 2022, 2:02 a.m. OK MS C++ 2017 TESTS 8 62 409600
151193195 return_myself C March 28, 2022, 12:39 a.m. OK MS C++ 2017 TESTS 8 62 819200
151201925 xzzzzz C March 28, 2022, 4:24 a.m. OK MS C++ 2017 TESTS 8 62 2764800
151171382 Alexey C March 27, 2022, 5:24 p.m. OK MS C++ 2017 TESTS 8 78 409600
151176092 DikshantAvi C March 27, 2022, 6:15 p.m. OK MS C++ 2017 TESTS 8 78 819200
151163560 Blejac C March 27, 2022, 4:29 p.m. OK MS C++ 2017 TESTS 8 93 409600
151160074 XYShaoKang C March 27, 2022, 4:22 p.m. OK Node.js TESTS 8 140 6246400
151205871 1_2_3_4_5_9 C March 28, 2022, 5:33 a.m. OK PyPy 2 TESTS 8 124 7065600
151174561 dogydevstorage C March 27, 2022, 5:58 p.m. OK PyPy 3 TESTS 8 140 8908800
151171590 MrDrogon C March 27, 2022, 5:26 p.m. OK PyPy 3 TESTS 8 155 9420800
151168312 sushmanth.dampur8780 C March 27, 2022, 5:01 p.m. OK PyPy 3 TESTS 8 171 10240000
151163309 sangram03 C March 27, 2022, 4:29 p.m. OK PyPy 3 TESTS 8 218 12288000
151182463 legend.ary_as C March 27, 2022, 7:46 p.m. OK PyPy 3 TESTS 8 249 13004800
151173538 Mansurbek C March 27, 2022, 5:46 p.m. OK PyPy 3 TESTS 8 264 9830400
151183792 KingMace C March 27, 2022, 8:10 p.m. OK PyPy 3 TESTS 8 280 10342400
151183699 KingMace C March 27, 2022, 8:08 p.m. OK PyPy 3 TESTS 8 280 10342400
151172170 abhijeet.panihar.cse20 C March 27, 2022, 5:31 p.m. OK PyPy 3 TESTS 8 280 15052800
151169285 tryharda C March 27, 2022, 5:07 p.m. OK PyPy 3 TESTS 8 280 15052800
151183514 radoan.sharkar.richi C March 27, 2022, 8:05 p.m. OK PyPy 3-64 TESTS 8 124 13721600
151171973 Nemisis2.O C March 27, 2022, 5:30 p.m. OK PyPy 3-64 TESTS 8 124 13926400
151174128 wskhanh C March 27, 2022, 5:53 p.m. OK PyPy 3-64 TESTS 8 124 14540800
151171665 Skillful_Wanderer C March 27, 2022, 5:27 p.m. OK PyPy 3-64 TESTS 8 124 14848000
151165365 ossau_guildo C March 27, 2022, 4:33 p.m. OK PyPy 3-64 TESTS 8 124 16076800
151189743 MrVroom999 C March 27, 2022, 10:37 p.m. OK PyPy 3-64 TESTS 8 139 14848000
151176313 MashaM C March 27, 2022, 6:18 p.m. OK PyPy 3-64 TESTS 8 139 14950400
151185709 stand_by C March 27, 2022, 8:47 p.m. OK PyPy 3-64 TESTS 8 139 15155200
151205987 skp_r C March 28, 2022, 5:35 a.m. OK PyPy 3-64 TESTS 8 140 14028800
151202922 Code_Breaker101 C March 28, 2022, 4:43 a.m. OK PyPy 3-64 TESTS 8 140 14848000
151198052 pennymagic156 C March 28, 2022, 2:59 a.m. OK Python 3 TESTS 8 78 6963200
151179540 divyamkakkar24 C March 27, 2022, 7:01 p.m. OK Python 3 TESTS 8 93 6451200
151202816 IronMan_P0 C March 28, 2022, 4:41 a.m. OK Python 3 TESTS 8 93 6963200
151197749 IanISam C March 28, 2022, 2:51 a.m. OK Python 3 TESTS 8 93 6963200
151196692 pennymagic156 C March 28, 2022, 2:25 a.m. OK Python 3 TESTS 8 93 6963200
151196669 pennymagic156 C March 28, 2022, 2:24 a.m. OK Python 3 TESTS 8 93 6963200
151187073 Rainmaker2627 C March 27, 2022, 9:20 p.m. OK Python 3 TESTS 8 93 6963200
151185824 noobsatish C March 27, 2022, 8:50 p.m. OK Python 3 TESTS 8 93 6963200
151185820 jr638091 C March 27, 2022, 8:50 p.m. OK Python 3 TESTS 8 93 6963200
151183846 Rainmaker2627 C March 27, 2022, 8:11 p.m. OK Python 3 TESTS 8 93 6963200
151198164 bqn C March 28, 2022, 3:02 a.m. OK Rust 2021 TESTS 8 30 3174400
151175146 46hinat C March 27, 2022, 6:04 p.m. OK Rust 2021 TESTS 8 31 819200
151169223 clause C March 27, 2022, 5:07 p.m. OK Rust 2021 TESTS 8 31 819200

remove filters

Back to search problems