Educational Codeforces Round 4

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
612 Educational Codeforces Round 4 FINISHED False 7200 280767599 Dec. 25, 2015, 3 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1717 ) E Square Root of Permutation PROGRAMMING combinatorics constructive algorithms dfs and similar graphs math 2200

B'A permutation of length n is an array containing each integer from 1 to n exactly once. For example, q xe2 x80 x89= xe2 x80 x89[4, xe2 x80 x895, xe2 x80 x891, xe2 x80 x892, xe2 x80 x893] is a permutation. For the permutation q the square of permutation is the permutation p that p[i] xe2 x80 x89= xe2 x80 x89q[q[i]] for each i xe2 x80 x89= xe2 x80 x891... n. For example, the square of q xe2 x80 x89= xe2 x80 x89[4, xe2 x80 x895, xe2 x80 x891, xe2 x80 x892, xe2 x80 x893] is p xe2 x80 x89= xe2 x80 x89q2 xe2 x80 x89= xe2 x80 x89[2, xe2 x80 x893, xe2 x80 x894, xe2 x80 x895, xe2 x80 x891]. This problem is about the inverse operation: given the permutation p you task is to find such permutation q that q2 xe2 x80 x89= xe2 x80 x89p. If there are several such q find any of them. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of elements in permutation p. The second line contains n distinct integers p1, xe2 x80 x89p2, xe2 x80 x89..., xe2 x80 x89pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the elements of permutation p. If there is no permutation q such that q2 xe2 x80 x89= xe2 x80 x89p print the number "-1". If the answer exists print it. The only line should contain n different integers qi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89qi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the elements of the permutation q. If there are several solutions print any of them.'...

Tutorials

22299

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
15161852 Gassa E Jan. 2, 2016, 6:57 p.m. OK D TESTS 18 748 44134400 2200
15162098 Profeeder E Jan. 2, 2016, 7:26 p.m. OK FPC TESTS 18 1716 32870400 2200
15727446 ez_zkj E Feb. 1, 2016, 8:33 a.m. OK FPC TESTS 18 1856 16076800 2200
15433588 _piyush E Jan. 18, 2016, 11:19 p.m. OK FPC TESTS 18 1949 13004800 2200
24741425 rainboy E Feb. 17, 2017, 4:23 p.m. OK GNU C TESTS 18 498 21913600 2200
34088295 alan_cty E Jan. 11, 2018, 1:09 p.m. OK GNU C++ TESTS 18 139 22937600 2200
18883239 vjudge4 E July 4, 2016, 12:43 p.m. OK GNU C++ TESTS 18 155 23859200 2200
19060716 acyume E July 13, 2016, 2:24 a.m. OK GNU C++ TESTS 18 311 16998400 2200
19060614 acyume E July 13, 2016, 2:15 a.m. OK GNU C++ TESTS 18 312 13004800 2200
15186962 wumaodang E Jan. 5, 2016, 3:25 a.m. OK GNU C++ TESTS 18 327 12800000 2200
23900810 xzyxzy E Jan. 17, 2017, 11:33 a.m. OK GNU C++ TESTS 18 343 47206400 2200
25454381 vjudge2 E March 13, 2017, 1:13 p.m. OK GNU C++ TESTS 18 343 48947200 2200
23193682 lzr_010506 E Dec. 21, 2016, 7:59 a.m. OK GNU C++ TESTS 18 358 23347200 2200
24894467 Claris E Feb. 22, 2017, 1:46 p.m. OK GNU C++ TESTS 18 358 26931200 2200
20037064 ShineRain E Aug. 22, 2016, 1:34 a.m. OK GNU C++ TESTS 18 373 25190400 2200
61042270 shurongwang E Sept. 22, 2019, 1:41 a.m. OK GNU C++11 TESTS 18 139 47206400 2200
61008665 chenxiaoyan E Sept. 21, 2019, 11:44 a.m. OK GNU C++11 TESTS 18 140 39116800 2200
15067761 Ioser E Dec. 28, 2015, 8:59 a.m. OK GNU C++11 TESTS 18 155 23859200 2200
31037943 NOIRP E Oct. 5, 2017, 2:54 p.m. OK GNU C++11 TESTS 18 156 47308800 2200
51659297 Ebola_Emperor E March 22, 2019, 1:07 a.m. OK GNU C++11 TESTS 18 171 37273600 2200
31037767 NOIRP E Oct. 5, 2017, 2:48 p.m. OK GNU C++11 TESTS 18 171 47308800 2200
31037719 NOIRP E Oct. 5, 2017, 2:47 p.m. OK GNU C++11 TESTS 18 171 47308800 2200
39982680 vjudge2 E July 5, 2018, 11:38 a.m. OK GNU C++11 TESTS 18 186 30310400 2200
44106077 Umi E Oct. 11, 2018, 9:18 a.m. OK GNU C++11 TESTS 18 186 35430400 2200
61008722 chenxiaoyan E Sept. 21, 2019, 11:45 a.m. OK GNU C++11 TESTS 18 186 39833600 2200
24450321 Egor.Lifar E Feb. 5, 2017, 11:28 a.m. OK GNU C++14 TESTS 18 202 45568000 2200
46660348 ParagonX97 E Dec. 5, 2018, 6:51 p.m. OK GNU C++14 TESTS 18 421 20992000 2200
67579503 S_Aditya E Dec. 25, 2019, 5:10 a.m. OK GNU C++14 TESTS 18 436 15360000 2200
61188604 Myrcella E Sept. 24, 2019, 1:09 a.m. OK GNU C++14 TESTS 18 436 20172800 2200
61290186 GODF E Sept. 25, 2019, 8:16 p.m. OK GNU C++14 TESTS 18 436 44032000 2200
49176648 m1sch3f E Jan. 29, 2019, 9:07 p.m. OK GNU C++14 TESTS 18 436 46592000 2200
34224072 isaf27 E Jan. 16, 2018, 2:10 p.m. OK GNU C++14 TESTS 18 451 32256000 2200
36442534 i_hate_cp E March 20, 2018, 9:12 p.m. OK GNU C++14 TESTS 18 451 45772800 2200
45198843 Hahahahahahahhahaha E Nov. 2, 2018, 8:49 a.m. OK GNU C++14 TESTS 18 452 27955200 2200
67425937 BaChVuViEt E Dec. 22, 2019, 1:26 p.m. OK GNU C++14 TESTS 18 452 30822400 2200
49495511 vjudge1 E Feb. 5, 2019, 12:38 p.m. OK GNU C++17 TESTS 18 405 28774400 2200
60309467 TAMREF E Sept. 9, 2019, 3:12 p.m. OK GNU C++17 TESTS 18 421 21094400 2200
49495331 Balerion E Feb. 5, 2019, 12:32 p.m. OK GNU C++17 TESTS 18 421 28774400 2200
64279840 Bohun E Nov. 5, 2019, 12:50 a.m. OK GNU C++17 TESTS 18 451 42393600 2200
47535061 Doriath E Dec. 26, 2018, 11:59 p.m. OK GNU C++17 TESTS 18 452 26521600 2200
60207442 Paruelain E Sept. 7, 2019, 8:45 a.m. OK GNU C++17 TESTS 18 452 31334400 2200
62765895 misir E Oct. 17, 2019, 8:37 a.m. OK GNU C++17 TESTS 18 452 32153600 2200
53373366 chinmay0906 E April 26, 2019, 6:40 p.m. OK GNU C++17 TESTS 18 452 34099200 2200
49283204 vjudge5 E Jan. 31, 2019, 5:06 p.m. OK GNU C++17 TESTS 18 452 43827200 2200
61042096 Patti E Sept. 22, 2019, 1:31 a.m. OK GNU C++17 TESTS 18 452 63180800 2200
19646803 pavel.rosputko E Aug. 5, 2016, 7:52 a.m. OK Haskell TESTS 18 1091 146944000 2200
15074861 kuldeeppatel E Dec. 28, 2015, 5:08 p.m. OK Java 7 TESTS 18 482 3481600 2200
15013666 knightL E Dec. 25, 2015, 3:50 p.m. OK Java 7 TESTS 18 498 58163200 2200
15014378 fromWork E Dec. 25, 2015, 3:57 p.m. OK Java 7 TESTS 18 561 41881600 2200
15124918 paletov E Dec. 30, 2015, 5:48 p.m. OK Java 7 TESTS 18 732 104140800 2200
15156444 uwi E Jan. 2, 2016, 8:55 a.m. OK Java 8 TESTS 18 405 19660800 2200
15020617 zhenyiluo E Dec. 25, 2015, 5:57 p.m. OK Java 8 TESTS 18 421 53350400 2200
15010605 Egor E Dec. 25, 2015, 3:24 p.m. OK Java 8 TESTS 18 451 53350400 2200
15017054 arechitsky E Dec. 25, 2015, 4:31 p.m. OK Java 8 TESTS 18 530 51507200 2200
24741400 Dukkha E Feb. 17, 2017, 4:22 p.m. OK Java 8 TESTS 18 576 56934400 2200
15769313 opticoder E Feb. 3, 2016, 1:29 p.m. OK Java 8 TESTS 18 717 138137600 2200
15406890 mdldml E Jan. 16, 2016, 5:19 p.m. OK Java 8 TESTS 18 732 127180800 2200
41922402 IDzekh E Aug. 21, 2018, 5:25 a.m. OK Java 8 TESTS 18 779 95539200 2200
64878490 Oom E Nov. 14, 2019, 10:47 a.m. OK Java 8 TESTS 18 842 171212800 2200
38632323 PrakharJain E May 26, 2018, 11:42 a.m. OK Java 8 TESTS 18 873 200396800 2200
15721326 ikulich E Jan. 31, 2016, 11:02 p.m. OK JavaScript TESTS 18 1933 164556800 2200
29028268 bubnov E July 30, 2017, 9:47 p.m. OK Kotlin TESTS 18 1231 138854400 2200
42342992 Slamur E Sept. 1, 2018, 6:38 p.m. OK Kotlin TESTS 18 1232 176435200 2200
15035547 og.kostya E Dec. 26, 2015, 5:47 p.m. OK MS C# TESTS 18 280 30617600 2200
15016309 azukun E Dec. 25, 2015, 4:21 p.m. OK MS C# TESTS 18 873 121753600 2200
15040373 aLLex E Dec. 27, 2015, 6:47 a.m. OK MS C# TESTS 18 935 102912000 2200
15017940 ZJZNKU E Dec. 25, 2015, 4:45 p.m. OK MS C++ TESTS 18 436 28262400 2200
15021810 KhaustovPavel E Dec. 25, 2015, 7:26 p.m. OK MS C++ TESTS 18 468 25088000 2200
15020902 Taube E Dec. 25, 2015, 6:15 p.m. OK MS C++ TESTS 18 483 62259200 2200
15018157 AleksanderBalobanov E Dec. 25, 2015, 4:48 p.m. OK MS C++ TESTS 18 483 101376000 2200
15012778 DimonK E Dec. 25, 2015, 3:41 p.m. OK MS C++ TESTS 18 498 35328000 2200
15323634 rzmn E Jan. 12, 2016, 9:52 p.m. OK MS C++ TESTS 18 514 35840000 2200
15026115 Aguin E Dec. 26, 2015, 5:39 a.m. OK MS C++ TESTS 18 514 54374400 2200
15019433 kirill146 E Dec. 25, 2015, 5:11 p.m. OK MS C++ TESTS 18 514 60928000 2200
16219696 ferc E Feb. 20, 2016, 3:16 a.m. OK MS C++ TESTS 18 530 30412800 2200
16344743 PreciseMind E Feb. 26, 2016, 11:05 a.m. OK MS C++ TESTS 18 560 47718400 2200
49866573 I_love_myself E Feb. 13, 2019, 12:13 p.m. OK MS C++ 2017 TESTS 18 1357 37580800 2200
15059946 marmistrz E Dec. 27, 2015, 6:08 p.m. OK Ocaml TESTS 18 779 37888000 2200
15014492 alexey.shchepin E Dec. 25, 2015, 3:59 p.m. OK Ocaml TESTS 18 1092 39014400 2200
15149643 gugugu E Jan. 1, 2016, 3:33 p.m. OK PyPy 2 TESTS 18 780 109772800 2200

remove filters

Back to search problems