Educational Codeforces Round 24

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
818 Educational Codeforces Round 24 FINISHED False 8100 233074499 June 29, 2017, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3019 ) B Permutation Game PROGRAMMING implementation 1600

B"n children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutation a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an of length n. It is an integer sequence such that each integer from 1 to n appears exactly once in it. The game consists of m steps. On each step the current leader with index i counts out ai people in clockwise order, starting from the next person. The last one to be pointed at by the leader becomes the new leader. You are given numbers l1, xe2 x80 x89l2, xe2 x80 x89..., xe2 x80 x89lm -- indices of leaders in the beginning of each step. Child with number l1 is the first leader in the game. Write a program which will restore a possible permutation a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an. If there are multiple solutions then print any of them. If there is no solution then print -1. The first line contains two integer numbers n, m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100). The second line contains m integer numbers l1, xe2 x80 x89l2, xe2 x80 x89..., xe2 x80 x89lm (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- indices of leaders in the beginning of each step. Print such permutation of n numbers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an that leaders in the game will be exactly l1, xe2 x80 x89l2, xe2 x80 x89..., xe2 x80 x89lm if all the rules are followed. If there are multiple solutions print any of them. If there is no permutation which satisfies all described conditions print -1. Let's follow leadership in the first example: "...

Tutorials

52991

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
47863864 Sk. B Jan. 3, 2019, 8:17 a.m. OK Clang++17 Diagnostics TESTS 46 46 0 1600
47868502 Sk. B Jan. 3, 2019, 11:25 a.m. OK Clang++17 Diagnostics TESTS 46 46 0 1600
47868538 vjudge1 B Jan. 3, 2019, 11:26 a.m. OK Clang++17 Diagnostics TESTS 46 46 0 1600
28146385 nanae1914 B June 29, 2017, 3:44 p.m. OK D TESTS 46 30 2969600 1600
28153940 Pilacis B June 29, 2017, 5:13 p.m. OK Delphi TESTS 46 15 2560000 1600
28153832 ruban B June 29, 2017, 5:11 p.m. OK Delphi TESTS 46 15 31027200 1600
28195320 hieutony159357 B July 1, 2017, 4:41 p.m. OK FPC TESTS 46 15 1638400 1600
28322357 1.o4 B July 6, 2017, 9:28 a.m. OK FPC TESTS 46 15 1638400 1600
28194970 slavik228 B July 1, 2017, 4:18 p.m. OK FPC TESTS 46 15 1638400 1600
28194061 hieutony159357 B July 1, 2017, 3:14 p.m. OK FPC TESTS 46 15 1638400 1600
28164315 Grom9941 B June 30, 2017, 5:29 a.m. OK FPC TESTS 46 15 1638400 1600
28730020 hieutony15935 B July 20, 2017, 4:56 p.m. OK FPC TESTS 46 30 1638400 1600
28479611 hieutony159357 B July 12, 2017, 4:47 p.m. OK FPC TESTS 46 30 1638400 1600
28387454 Slonik B July 9, 2017, 12:37 p.m. OK FPC TESTS 46 30 1638400 1600
28480076 hieutony159357 B July 12, 2017, 5:10 p.m. OK FPC TESTS 46 31 1638400 1600
28146332 rainboy B June 29, 2017, 3:44 p.m. OK GNU C TESTS 46 15 1945600 1600
28280181 theintelligentboy B July 4, 2017, 12:26 p.m. OK GNU C TESTS 46 15 1945600 1600
28163011 MajAK B June 30, 2017, 3:42 a.m. OK GNU C TESTS 46 15 1945600 1600
28147080 YGFAM B June 29, 2017, 3:51 p.m. OK GNU C TESTS 46 15 1945600 1600
28144836 sahuang B June 29, 2017, 3:29 p.m. OK GNU C TESTS 46 15 1945600 1600
35540215 anirudhbansal B Feb. 21, 2018, 7:16 a.m. OK GNU C TESTS 46 15 2048000 1600
28280784 theintelligentboy B July 4, 2017, 12:51 p.m. OK GNU C TESTS 46 30 1945600 1600
28169953 mananb31 B June 30, 2017, 10:52 a.m. OK GNU C TESTS 46 30 1945600 1600
28151708 Rutvik_Kothari B June 29, 2017, 4:42 p.m. OK GNU C TESTS 46 30 1945600 1600
28150015 l_modric B June 29, 2017, 4:21 p.m. OK GNU C TESTS 46 31 1945600 1600
39263796 crowworks695 B June 15, 2018, 10:53 a.m. OK GNU C++ TESTS 46 15 0 1600
32524480 palak_08 B Nov. 21, 2017, 12:07 p.m. OK GNU C++ TESTS 46 15 0 1600
31849723 meJVJ B Oct. 28, 2017, 7:56 p.m. OK GNU C++ TESTS 46 15 0 1600
31149985 Majka B Oct. 8, 2017, 4:41 p.m. OK GNU C++ TESTS 46 15 0 1600
30355524 Always B Sept. 15, 2017, 2:09 a.m. OK GNU C++ TESTS 46 15 0 1600
30127818 vjudge2 B Sept. 6, 2017, 9:50 a.m. OK GNU C++ TESTS 46 15 0 1600
29939175 dhuacm6 B Aug. 31, 2017, 9:38 a.m. OK GNU C++ TESTS 46 15 0 1600
29939157 Sherlock_Tang B Aug. 31, 2017, 9:37 a.m. OK GNU C++ TESTS 46 15 0 1600
29847037 KrK B Aug. 28, 2017, 1:55 p.m. OK GNU C++ TESTS 46 15 0 1600
29683458 Wishawk B Aug. 22, 2017, 1:08 p.m. OK GNU C++ TESTS 46 15 0 1600
28151985 fsociety00 B June 29, 2017, 4:46 p.m. OK GNU C11 TESTS 46 15 1945600 1600
47446251 vjudge4 B Dec. 24, 2018, 6:26 a.m. OK GNU C11 TESTS 46 31 0 1600
50413695 vjudge1 B Feb. 24, 2019, 5:07 a.m. OK GNU C11 TESTS 46 31 0 1600
47847660 vjudge5 B Jan. 2, 2019, 3:41 p.m. OK GNU C11 TESTS 46 31 0 1600
47624154 vjudge4 B Dec. 28, 2018, 2:15 p.m. OK GNU C11 TESTS 46 31 0 1600
47624144 keu B Dec. 28, 2018, 2:14 p.m. OK GNU C11 TESTS 46 31 0 1600
47525088 vjudge4 B Dec. 26, 2018, 3:23 p.m. OK GNU C11 TESTS 46 31 0 1600
47479607 vjudge4 B Dec. 25, 2018, 3:21 a.m. OK GNU C11 TESTS 46 31 0 1600
47453178 vjudge5 B Dec. 24, 2018, 11:03 a.m. OK GNU C11 TESTS 46 31 0 1600
47453048 Silencer_A B Dec. 24, 2018, 10:59 a.m. OK GNU C11 TESTS 46 31 0 1600
29599779 just_soso B Aug. 19, 2017, 1:40 p.m. OK GNU C++11 TESTS 46 15 0 1600
29640164 nowing B Aug. 21, 2017, 9:35 a.m. OK GNU C++11 TESTS 46 15 0 1600
29643177 LaurynasN B Aug. 21, 2017, 12:18 p.m. OK GNU C++11 TESTS 46 15 0 1600
29840321 IlhomjonMuxtorov B Aug. 28, 2017, 7:28 a.m. OK GNU C++11 TESTS 46 15 0 1600
29840874 Nodirbek_Sattorov B Aug. 28, 2017, 8:05 a.m. OK GNU C++11 TESTS 46 15 0 1600
29841452 fenix23 B Aug. 28, 2017, 8:43 a.m. OK GNU C++11 TESTS 46 15 0 1600
30038449 lawrenceli B Sept. 3, 2017, 3:06 p.m. OK GNU C++11 TESTS 46 15 0 1600
30597170 DrSwad B Sept. 21, 2017, 6:40 p.m. OK GNU C++11 TESTS 46 15 0 1600
32316134 little_misfortune B Nov. 14, 2017, 4:05 p.m. OK GNU C++11 TESTS 46 15 0 1600
30896861 sspu_zhaojingyuan1996 B Oct. 1, 2017, 2:43 a.m. OK GNU C++11 TESTS 46 15 0 1600
31851873 jvj_iit B Oct. 28, 2017, 10:07 p.m. OK GNU C++14 TESTS 46 15 0 1600
31222300 AJAYHAYAGREEVE B Oct. 11, 2017, 4:34 p.m. OK GNU C++14 TESTS 46 15 0 1600
31174857 ss1h2a3tw B Oct. 9, 2017, 6:15 p.m. OK GNU C++14 TESTS 46 15 0 1600
31173228 Shmosby B Oct. 9, 2017, 4:50 p.m. OK GNU C++14 TESTS 46 15 0 1600
31170219 harryoooooooooo B Oct. 9, 2017, 2:35 p.m. OK GNU C++14 TESTS 46 15 0 1600
30994539 llbra8z B Oct. 4, 2017, 2:30 p.m. OK GNU C++14 TESTS 46 15 0 1600
30754529 ffern B Sept. 26, 2017, 3:01 p.m. OK GNU C++14 TESTS 46 15 0 1600
30221451 r.redmage B Sept. 9, 2017, 9:10 a.m. OK GNU C++14 TESTS 46 15 0 1600
30002573 konstantin_013 B Sept. 2, 2017, 5:31 a.m. OK GNU C++14 TESTS 46 15 0 1600
29922065 Mhamadli B Aug. 30, 2017, 3:02 p.m. OK GNU C++14 TESTS 46 15 0 1600
38986156 065583 B June 6, 2018, 7:01 a.m. OK GNU C++17 TESTS 46 15 0 1600
66405881 TAB_0905 B Dec. 6, 2019, 1:40 p.m. OK GNU C++17 TESTS 46 15 0 1600
55396358 amcodeforces B June 10, 2019, 11:57 a.m. OK GNU C++17 TESTS 46 15 0 1600
50566011 vjudge2 B Feb. 27, 2019, 1:10 p.m. OK GNU C++17 TESTS 46 15 0 1600
38996867 MSteine B June 6, 2018, 2:07 p.m. OK GNU C++17 TESTS 46 15 409600 1600
45564765 vjudge5 B Nov. 11, 2018, 1:44 p.m. OK GNU C++17 TESTS 46 15 409600 1600
56980951 roll_no_1 B July 13, 2019, 1:52 p.m. OK GNU C++17 TESTS 46 15 1740800 1600
36069060 easyhoon B March 8, 2018, 11:40 a.m. OK GNU C++17 TESTS 46 15 1945600 1600
35528831 __________ B Feb. 20, 2018, 5:26 p.m. OK GNU C++17 TESTS 46 15 2048000 1600
69658118 dlbin7 B Jan. 28, 2020, 8:19 a.m. OK GNU C++17 TESTS 46 30 0 1600
39650665 xuziling B June 25, 2018, 1:23 p.m. OK GNU C++17 Diagnostics TESTS 46 998 0 1600
28196324 only_methol B July 1, 2017, 5:48 p.m. OK Go TESTS 46 31 23142400 1600
29319470 codeonwort B Aug. 10, 2017, 6:52 a.m. OK Haskell TESTS 46 15 53248000 1600
28211873 sl0th B July 2, 2017, 2:04 p.m. OK Haskell TESTS 46 31 53248000 1600
68363848 its_aks_ulure B Jan. 7, 2020, 3:10 p.m. OK Java 11 TESTS 46 186 0 1600
68363768 its_aks_ulure B Jan. 7, 2020, 3:07 p.m. OK Java 11 TESTS 46 202 0 1600
53440397 mikkk B April 27, 2019, 11:17 p.m. OK Java 8 TESTS 46 109 0 1600
51545032 catforce B March 19, 2019, 7:47 p.m. OK Java 8 TESTS 46 109 0 1600
40678797 Heisen_Berg B July 23, 2018, 5:23 p.m. OK Java 8 TESTS 46 109 0 1600
29678673 mashinist B Aug. 22, 2017, 9:13 a.m. OK Java 8 TESTS 46 109 0 1600
66742409 unicorn20141 B Dec. 12, 2019, 9:43 p.m. OK Java 8 TESTS 46 109 0 1600
28352479 OmarRadwan B July 7, 2017, 3:41 p.m. OK Java 8 TESTS 46 109 20172800 1600
28301314 Kammola B July 5, 2017, 10:19 a.m. OK Java 8 TESTS 46 109 20172800 1600
28407597 Lizzy- B July 10, 2017, 12:54 p.m. OK Java 8 TESTS 46 109 20480000 1600
28249180 kocko B July 3, 2017, 8:29 a.m. OK Java 8 TESTS 46 109 20480000 1600
28211252 Mihir_Gajera1 B July 2, 2017, 1:25 p.m. OK Java 8 TESTS 46 109 20480000 1600
28150424 simonmysun B June 29, 2017, 4:26 p.m. OK JavaScript TESTS 46 31 6144000 1600
28145148 leign B June 29, 2017, 3:33 p.m. OK Mono C# TESTS 46 46 9318400 1600
28209065 ME_AJUUUUUDAAA B July 2, 2017, 11:21 a.m. OK Mono C# TESTS 46 46 9318400 1600
28168675 CrafterKolyan B June 30, 2017, 9:28 a.m. OK Mono C# TESTS 46 46 9318400 1600
28212089 lusine.petrosyan1 B July 2, 2017, 2:19 p.m. OK Mono C# TESTS 46 62 9318400 1600
28187608 flowmemo B July 1, 2017, 8:40 a.m. OK Mono C# TESTS 46 62 11776000 1600
28179251 IleksaNott B June 30, 2017, 7:21 p.m. OK MS C# TESTS 46 46 11673600 1600
28156075 artsin666 B June 29, 2017, 6:23 p.m. OK MS C# TESTS 46 61 9625600 1600
28187593 flowmemo B July 1, 2017, 8:39 a.m. OK MS C# TESTS 46 61 11776000 1600
28150147 Maeda B June 29, 2017, 4:22 p.m. OK MS C# TESTS 46 62 9318400 1600
28557281 luka25 B July 14, 2017, 8:23 p.m. OK MS C# TESTS 46 62 9318400 1600
28144450 og.kostya B June 29, 2017, 3:26 p.m. OK MS C# TESTS 46 62 9420800 1600
28238380 zazak B July 2, 2017, 10:24 p.m. OK MS C# TESTS 46 62 11673600 1600
28174177 ShowStopper728 B June 30, 2017, 2:05 p.m. OK MS C# TESTS 46 77 11776000 1600
28146363 AnatolyTolstobrov B June 29, 2017, 3:44 p.m. OK MS C# TESTS 46 77 11878400 1600
30364480 eastblue B Sept. 15, 2017, 1:49 p.m. OK MS C++ TESTS 46 15 0 1600
28346298 _mactep B July 7, 2017, 9:19 a.m. OK MS C++ TESTS 46 15 1945600 1600
28377058 KobetheGOAT B July 8, 2017, 10:37 p.m. OK MS C++ TESTS 46 15 1945600 1600
28174924 tskhada B June 30, 2017, 2:27 p.m. OK MS C++ TESTS 46 15 1945600 1600
29130620 vjudge4 B Aug. 2, 2017, 12:57 p.m. OK MS C++ TESTS 46 15 2048000 1600
28257792 SakoXF B July 3, 2017, 2:12 p.m. OK MS C++ TESTS 46 15 2048000 1600
28192691 Ivan_Bondarev B July 1, 2017, 1:42 p.m. OK MS C++ TESTS 46 15 2048000 1600
28171890 redoak B June 30, 2017, 12:39 p.m. OK MS C++ TESTS 46 15 2048000 1600
28171812 redoak B June 30, 2017, 12:36 p.m. OK MS C++ TESTS 46 15 2048000 1600
28166884 razdva123 B June 30, 2017, 7:57 a.m. OK MS C++ TESTS 46 15 2048000 1600
66587194 HishamDroubi B Dec. 10, 2019, 11:39 a.m. OK MS C++ 2017 TESTS 46 31 307200 1600
32760449 mayakin B Nov. 28, 2017, 8:32 p.m. OK PHP TESTS 46 31 6041600 1600
28212046 sragavan B July 2, 2017, 2:16 p.m. OK PyPy 2 TESTS 46 62 21913600 1600
28144017 Yash_ B June 29, 2017, 3:22 p.m. OK PyPy 2 TESTS 46 62 21913600 1600
28157121 thuglife69 B June 29, 2017, 7:29 p.m. OK PyPy 2 TESTS 46 77 21913600 1600
28145577 tjake B June 29, 2017, 3:37 p.m. OK PyPy 2 TESTS 46 77 21913600 1600
28144068 Cypi B June 29, 2017, 3:22 p.m. OK PyPy 2 TESTS 46 77 21913600 1600
28154995 saathvik782 B June 29, 2017, 5:35 p.m. OK PyPy 2 TESTS 46 92 21913600 1600
28144892 Mateon1 B June 29, 2017, 3:30 p.m. OK PyPy 2 TESTS 46 93 21913600 1600
28393728 mattiasm83 B July 9, 2017, 8:09 p.m. OK PyPy 3 TESTS 46 109 23142400 1600
28161909 Blencer B June 30, 2017, 2:33 a.m. OK PyPy 3 TESTS 46 124 23142400 1600
28153274 Naoki_M B June 29, 2017, 5:03 p.m. OK PyPy 3 TESTS 46 124 23142400 1600
28147535 sas B June 29, 2017, 3:56 p.m. OK PyPy 3 TESTS 46 124 23142400 1600
66634897 shiv1470 B Dec. 11, 2019, 12:33 p.m. OK PyPy 3 TESTS 46 155 1126400 1600
56413994 scambret B July 2, 2019, 2:59 a.m. OK PyPy 3 TESTS 46 155 1228800 1600
56792486 co_devil B July 10, 2019, 11:11 a.m. OK PyPy 3 TESTS 46 249 10649600 1600
28580674 akshesh B July 15, 2017, 7:04 p.m. OK Python 2 TESTS 46 61 4710400 1600
31154155 WNG B Oct. 8, 2017, 8:33 p.m. OK Python 2 TESTS 46 62 0 1600
29719456 isgulkov B Aug. 24, 2017, 12:34 a.m. OK Python 2 TESTS 46 62 0 1600
28645869 vjudge2 B July 17, 2017, 5:53 p.m. OK Python 2 TESTS 46 62 4710400 1600
28335792 your_conscience B July 6, 2017, 8:03 p.m. OK Python 2 TESTS 46 62 4710400 1600
28314906 ajoisa B July 6, 2017, 2:44 a.m. OK Python 2 TESTS 46 62 4710400 1600
28197006 zensh B July 1, 2017, 6:41 p.m. OK Python 2 TESTS 46 62 4710400 1600
28155150 Trunks B June 29, 2017, 5:40 p.m. OK Python 2 TESTS 46 62 4710400 1600
28148862 Wizmann B June 29, 2017, 4:09 p.m. OK Python 2 TESTS 46 62 4710400 1600
28161902 fluffyowl B June 30, 2017, 2:33 a.m. OK Python 2 TESTS 46 77 4710400 1600
29810309 Qumeric B Aug. 26, 2017, 4:07 p.m. OK Python 3 TESTS 46 61 0 1600
29955884 id1 B Aug. 31, 2017, 5:34 p.m. OK Python 3 TESTS 46 62 307200 1600
28878402 handsome_89244 B July 25, 2017, 2:25 p.m. OK Python 3 TESTS 46 62 4608000 1600
28980552 GabrielSiq B July 30, 2017, 1:46 a.m. OK Python 3 TESTS 46 62 4915200 1600
32484068 yugle7 B Nov. 19, 2017, 9:01 p.m. OK Python 3 TESTS 46 62 5529600 1600
28213215 Sina_Imani B July 2, 2017, 3:40 p.m. OK Python 3 TESTS 46 62 5529600 1600
28212687 Leymore B July 2, 2017, 3:02 p.m. OK Python 3 TESTS 46 62 5529600 1600
28181079 aadish B June 30, 2017, 10:54 p.m. OK Python 3 TESTS 46 62 5529600 1600
28156854 eugalt B June 29, 2017, 7:11 p.m. OK Python 3 TESTS 46 62 5529600 1600
28156359 kishertka B June 29, 2017, 6:39 p.m. OK Python 3 TESTS 46 62 5529600 1600

remove filters

Back to search problems