Codeforces Round 696 (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
1474 Codeforces Round 696 (Div. 2) FINISHED False 7200 120756299 Jan. 19, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1351 ) E What Is It? PROGRAMMING constructive algorithms greedy

B"Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n . Scientists found out, that to overcome an obstacle, the robot should make p an identity permutation (make p_i = i for all i ). Unfortunately, scientists can't control the robot. Thus the only way to make p an identity permutation is applying the following operation to p multiple times: Scientists asked you to find out the maximum possible time it will take the robot to finish making p an identity permutation (i. e. worst-case scenario), so they can decide whether they should construct a new lunar rover or just rest and wait. They won't believe you without proof, so you should build an example of p and robot's operations that maximizes the answer. For a better understanding of the statement, read the sample description. The first line of input contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Each of next t lines contains the single integer n ( 2 <= q n <= q 10^5 ) xe2 x80 x93 the length of p . Note, that p is not given to you. You should find the maximum possible time over all permutations of length n . It is guaranteed, that the total sum of n over all test cases doesn't exceed 10^5 . For each test case in the first line, print how many seconds will the robot spend in the worst case. In the next line, print the initial value of p that you used to construct an answer. In the next line, print the number of operations m <= q n that the robot makes in your example. In the each of next m lines print two integers i and j -- indices of positions that the robot will swap on this operation. Note that p_j = i must holds (at the time of operation). For n = 2 , p can be either [1, 2] or [2, 1] . In the first case p is already identity, otherwise robot will mak"...

Tutorials

Codeforces Round #696 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
104864618 Suiseiseki E Jan. 20, 2021, 2:53 a.m. OK GNU C++11 TESTS 16 46 204800
104862428 AC-Evil E Jan. 20, 2021, 1:56 a.m. OK GNU C++11 TESTS 16 46 409600
104862711 Flying_streaky_pork E Jan. 20, 2021, 2:06 a.m. OK GNU C++11 TESTS 16 61 0
104838834 gjznb E Jan. 19, 2021, 5:18 p.m. OK GNU C++11 TESTS 16 62 0
104866906 fallleaves01 E Jan. 20, 2021, 3:46 a.m. OK GNU C++11 TESTS 16 62 409600
104830836 Pyqe E Jan. 19, 2021, 4:22 p.m. OK GNU C++11 TESTS 16 62 819200
104860873 RainAir E Jan. 20, 2021, 1:06 a.m. OK GNU C++11 TESTS 16 62 819200
104840205 serotonin E Jan. 19, 2021, 5:27 p.m. OK GNU C++11 TESTS 16 62 1638400
104864202 wsyhb E Jan. 20, 2021, 2:42 a.m. OK GNU C++11 TESTS 16 62 2048000
104837949 1015634 E Jan. 19, 2021, 5:13 p.m. OK GNU C++11 TESTS 16 62 2150400
104838386 rookie1100 E Jan. 19, 2021, 5:15 p.m. OK GNU C++14 TESTS 16 46 2867200
104831560 SuperJ6 E Jan. 19, 2021, 4:24 p.m. OK GNU C++14 TESTS 16 61 0
104832403 TD06 E Jan. 19, 2021, 4:26 p.m. OK GNU C++14 TESTS 16 61 2457600
104856664 wh0816 E Jan. 19, 2021, 10:25 p.m. OK GNU C++14 TESTS 16 62 819200
104868814 marcOS E Jan. 20, 2021, 4:27 a.m. OK GNU C++14 TESTS 16 62 2048000
104843882 Abdelrhman_Akram E Jan. 19, 2021, 6:01 p.m. OK GNU C++14 TESTS 16 62 2048000
104852257 fcw E Jan. 19, 2021, 8:16 p.m. OK GNU C++14 TESTS 16 62 3993600
104838900 vsriram1012 E Jan. 19, 2021, 5:18 p.m. OK GNU C++14 TESTS 16 62 4812800
104870017 lockwood E Jan. 20, 2021, 4:50 a.m. OK GNU C++14 TESTS 16 77 2457600
104851454 Schrodingers_Dog E Jan. 19, 2021, 8 p.m. OK GNU C++14 TESTS 16 77 3993600
104836057 Golden E Jan. 19, 2021, 4:34 p.m. OK GNU C++17 TESTS 16 46 2048000
104833599 Smoge E Jan. 19, 2021, 4:29 p.m. OK GNU C++17 TESTS 16 46 2048000
104863776 ...zzz... E Jan. 20, 2021, 2:33 a.m. OK GNU C++17 TESTS 16 61 409600
104864062 ...zzz... E Jan. 20, 2021, 2:39 a.m. OK GNU C++17 TESTS 16 61 409600
104866567 avnyu E Jan. 20, 2021, 3:38 a.m. OK GNU C++17 TESTS 16 61 1228800
104840536 IgorI E Jan. 19, 2021, 5:29 p.m. OK GNU C++17 TESTS 16 61 1945600
104852954 Petr1Furious E Jan. 19, 2021, 8:31 p.m. OK GNU C++17 TESTS 16 61 2048000
104872628 rath772k E Jan. 20, 2021, 5:30 a.m. OK GNU C++17 TESTS 16 61 2048000
104870477 pikel_rik E Jan. 20, 2021, 4:58 a.m. OK GNU C++17 TESTS 16 61 2048000
104848966 antonis.white E Jan. 19, 2021, 7:13 p.m. OK GNU C++17 TESTS 16 61 2048000
104834904 yash_daga E Jan. 19, 2021, 4:32 p.m. OK GNU C++17 (64) TESTS 16 46 0
104845357 ScarletS E Jan. 19, 2021, 6:19 p.m. OK GNU C++17 (64) TESTS 16 46 409600
104837891 I_Remember_Olya_ashmelev E Jan. 19, 2021, 5:13 p.m. OK GNU C++17 (64) TESTS 16 46 2150400
104840043 erray E Jan. 19, 2021, 5:25 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104860451 Ernestico E Jan. 20, 2021, 12:51 a.m. OK GNU C++17 (64) TESTS 16 46 2560000
104854823 Scano E Jan. 19, 2021, 9:21 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104851623 DougNobrega E Jan. 19, 2021, 8:03 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104846616 PauloMiranda98 E Jan. 19, 2021, 6:37 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104845153 egneeS E Jan. 19, 2021, 6:16 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104840117 erray E Jan. 19, 2021, 5:26 p.m. OK GNU C++17 (64) TESTS 16 46 2560000
104864761 sarthakmanna E Jan. 20, 2021, 2:57 a.m. OK Java 11 TESTS 16 218 1331200
104838103 Dukkha E Jan. 19, 2021, 5:14 p.m. OK Java 11 TESTS 16 265 0
104856745 Restricted E Jan. 19, 2021, 10:28 p.m. OK Java 11 TESTS 16 265 0
104870661 Akmal_developer E Jan. 20, 2021, 5:01 a.m. OK Java 8 TESTS 16 170 0
104865021 flyman3046 E Jan. 20, 2021, 3:04 a.m. OK Java 8 TESTS 16 171 0
104869817 mircea85 E Jan. 20, 2021, 4:46 a.m. OK Mono C# TESTS 16 109 3174400
104839716 Yupiteru E Jan. 19, 2021, 5:23 p.m. OK .NET Core C# TESTS 16 124 14540800
104839883 titia E Jan. 19, 2021, 5:24 p.m. OK PyPy 3 TESTS 16 374 11366400
104833484 pineriver E Jan. 19, 2021, 4:29 p.m. OK PyPy 3 TESTS 16 374 30310400
104850013 sh1194 E Jan. 19, 2021, 7:33 p.m. OK Python 3 TESTS 16 639 8499200
104849860 sh1194 E Jan. 19, 2021, 7:30 p.m. OK Python 3 TESTS 16 670 8396800
104849830 sh1194 E Jan. 19, 2021, 7:29 p.m. OK Python 3 TESTS 16 670 8396800
104849926 sh1194 E Jan. 19, 2021, 7:31 p.m. OK Python 3 TESTS 16 717 8396800

remove filters

Back to search problems