Codeforces Round 136 (Div. 1)

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
220 Codeforces Round 136 (Div. 1) FINISHED False 7200 391444186 Aug. 31, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 954 ) C Little Elephant and Shifts PROGRAMMING data structures 2300

B"The Little Elephant has two permutations a and b of length n, consisting of numbers from 1 to n, inclusive. Let's denote the i-th (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) element of the permutation a as ai, the j-th (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) element of the permutation b -- as bj. The distance between permutations a and b is the minimum absolute value of the difference between the positions of the occurrences of some number in a and in b. More formally, it's such minimum |i xe2 x80 x89- xe2 x80 x89j|, that ai xe2 x80 x89= xe2 x80 x89bj. A cyclic shift number i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) of permutation b consisting from n elements is a permutation bibi xe2 x80 x89+ xe2 x80 x891... bnb1b2... bi xe2 x80 x89- xe2 x80 x891. Overall a permutation has n cyclic shifts. The Little Elephant wonders, for all cyclic shifts of permutation b, what is the distance between the cyclic shift and permutation a? The first line contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the size of the permutations. The second line contains permutation a as n distinct numbers from 1 to n, inclusive. The numbers are separated with single spaces. The third line contains permutation b in the same format. In n lines print n integers -- the answers for cyclic shifts. Print the answers to the shifts in the order of the shifts' numeration in permutation b, that is, first for the 1-st cyclic shift, then for the 2-nd, and so on."...

Tutorials

Codeforces Round #136 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3077993 AleksanderBalobanov C Feb. 6, 2013, 2:58 p.m. OK Delphi TESTS 36 234 18944000 2300
2101558 con_nha_ngheo C Sept. 7, 2012, 4:25 a.m. OK FPC TESTS 36 140 2764800 2300
2099426 wxyz1234 C Sept. 6, 2012, 9:04 a.m. OK FPC TESTS 36 190 3788800 2300
2079344 Sereja C Aug. 31, 2012, 4:40 p.m. OK FPC TESTS 36 200 12595200 2300
2733211 nhphuongltv C Dec. 9, 2012, 7:16 a.m. OK FPC TESTS 36 265 16793600 2300
2083406 blackapple C Aug. 31, 2012, 6:37 p.m. OK FPC TESTS 36 380 11468800 2300
2090730 denis_ C Sept. 2, 2012, 4:23 p.m. OK FPC TESTS 36 410 34304000 2300
2081322 Furko C Aug. 31, 2012, 5:12 p.m. OK FPC TESTS 36 440 34304000 2300
2095746 giongto35 C Sept. 4, 2012, 6:35 p.m. OK FPC TESTS 36 560 9113600 2300
2095744 giongto35 C Sept. 4, 2012, 6:35 p.m. OK FPC TESTS 36 580 9113600 2300
3418919 Goshish C March 29, 2013, 11:34 a.m. OK GNU C++ TESTS 36 93 3584000 2300
4928640 MakingMaker C Oct. 29, 2013, 12:42 p.m. OK GNU C++ TESTS 36 93 8294400 2300
2084155 thanabhat C Aug. 31, 2012, 7:46 p.m. OK GNU C++ TESTS 36 110 4403200 2300
2686753 cacol89 C Dec. 2, 2012, 1:58 p.m. OK GNU C++ TESTS 36 125 3993600 2300
3111482 lauer C Feb. 13, 2013, 12:04 p.m. OK GNU C++ TESTS 36 125 4198400 2300
2105152 sdad120 C Sept. 9, 2012, 1:32 a.m. OK GNU C++ TESTS 36 125 6246400 2300
2108694 -XraY- C Sept. 10, 2012, 12:49 p.m. OK GNU C++ TESTS 36 130 3891200 2300
2091408 gogokefakefa C Sept. 3, 2012, 12:27 a.m. OK GNU C++ TESTS 36 130 6553600 2300
2081014 hytirt C Aug. 31, 2012, 5:07 p.m. OK GNU C++ TESTS 36 140 2867200 2300
2806678 Nekosyndrome C Dec. 22, 2012, 12:10 p.m. OK GNU C++ TESTS 36 140 5017600 2300
9973936 raihatneloy C Feb. 23, 2015, 8:54 p.m. OK GNU C++0x TESTS 36 218 4812800 2300
2410410 mruxim C Oct. 22, 2012, 4:09 p.m. OK GNU C++0x TESTS 36 281 4608000 2300
9507788 hkglly C Jan. 23, 2015, 3:50 a.m. OK GNU C++0x TESTS 36 310 4096000 2300
2080422 PinkieDashForever C Aug. 31, 2012, 4:57 p.m. OK GNU C++0x TESTS 36 310 6348800 2300
9917775 I_love_Hoang_Yen C Feb. 18, 2015, 5:40 p.m. OK GNU C++0x TESTS 36 312 4505600 2300
9917991 sdya C Feb. 18, 2015, 5:58 p.m. OK GNU C++0x TESTS 36 312 6656000 2300
2078636 Archon.JK C Aug. 31, 2012, 4:29 p.m. OK GNU C++0x TESTS 36 330 5632000 2300
2079751 watashi C Aug. 31, 2012, 4:47 p.m. OK GNU C++0x TESTS 36 330 7987200 2300
4810213 mrTux C Oct. 16, 2013, 8:39 p.m. OK GNU C++0x TESTS 36 342 4608000 2300
7846259 ecapia C Sept. 18, 2014, 10:19 p.m. OK GNU C++0x TESTS 36 342 6860800 2300
15761063 ko_osaga C Feb. 3, 2016, 2:33 a.m. OK GNU C++11 TESTS 36 186 2969600 2300
15761056 ko_osaga C Feb. 3, 2016, 2:32 a.m. OK GNU C++11 TESTS 36 186 4198400 2300
17328425 OmarHashim C April 15, 2016, 2:44 p.m. OK GNU C++11 TESTS 36 186 6144000 2300
15152159 .I. C Jan. 1, 2016, 7:18 p.m. OK GNU C++11 TESTS 36 216 8601600 2300
54956755 SoiMae C June 2, 2019, 12:10 a.m. OK GNU C++11 TESTS 36 218 4403200 2300
32121041 lqs2015 C Nov. 7, 2017, 1:53 p.m. OK GNU C++11 TESTS 36 218 4812800 2300
26632292 dsyhy C April 24, 2017, 3:18 a.m. OK GNU C++11 TESTS 36 218 10444800 2300
11405802 kefaa C June 3, 2015, 6:27 p.m. OK GNU C++11 TESTS 36 248 4403200 2300
58822009 luogu_bot1 C Aug. 14, 2019, 2:24 p.m. OK GNU C++11 TESTS 36 248 4812800 2300
12130023 huantwofat C July 20, 2015, 12:09 p.m. OK GNU C++11 TESTS 36 248 7270400 2300
59651522 ayk16 C Aug. 29, 2019, 8:26 a.m. OK GNU C++14 TESTS 36 186 6348800 2300
26678703 ConnorZhong C April 26, 2017, 9:18 a.m. OK GNU C++14 TESTS 36 186 18739200 2300
42413841 FelixChen C Sept. 3, 2018, 5:39 a.m. OK GNU C++14 TESTS 36 248 6451200 2300
67196292 ElangBondol C Dec. 19, 2019, 9:10 a.m. OK GNU C++14 TESTS 36 278 3993600 2300
30958635 LiChenKoh C Oct. 3, 2017, 5:27 a.m. OK GNU C++14 TESTS 36 280 4710400 2300
35971772 Marckess C March 5, 2018, 4:26 p.m. OK GNU C++14 TESTS 36 280 6041600 2300
28910188 erfan._.m C July 26, 2017, 3:47 p.m. OK GNU C++14 TESTS 36 280 21299200 2300
33263304 vjudge4 C Dec. 15, 2017, 12:23 p.m. OK GNU C++14 TESTS 36 310 6041600 2300
26507863 ei133333 C April 20, 2017, 4:52 a.m. OK GNU C++14 TESTS 36 310 6860800 2300
57798061 vjudge4 C July 26, 2019, 12:12 p.m. OK GNU C++14 TESTS 36 312 11366400 2300
58837429 tfg C Aug. 14, 2019, 10:13 p.m. OK GNU C++17 TESTS 36 186 2867200 2300
44267811 KATATONIA C Oct. 13, 2018, 5:29 p.m. OK GNU C++17 TESTS 36 280 4300800 2300
57798673 1024_20171786 C July 26, 2019, 12:25 p.m. OK GNU C++17 TESTS 36 310 4198400 2300
58836865 Kuroni C Aug. 14, 2019, 9:43 p.m. OK GNU C++17 TESTS 36 310 6963200 2300
49550628 ruo C Feb. 7, 2019, 5:34 a.m. OK GNU C++17 TESTS 36 342 4403200 2300
60931693 Hoshi08 C Sept. 20, 2019, 1:57 p.m. OK GNU C++17 TESTS 36 342 5017600 2300
58840036 aryanc403 C Aug. 15, 2019, 1:23 a.m. OK GNU C++17 TESTS 36 342 6041600 2300
58839930 aryanc403 C Aug. 15, 2019, 1:18 a.m. OK GNU C++17 TESTS 36 342 8089600 2300
58405312 Phortox C Aug. 6, 2019, 8:10 p.m. OK GNU C++17 TESTS 36 372 4608000 2300
49550810 anjn98 C Feb. 7, 2019, 5:46 a.m. OK GNU C++17 TESTS 36 372 5222400 2300
2101835 uwi C Sept. 7, 2012, 7:31 a.m. OK Java 6 TESTS 36 296 43520000 2300
2100851 uwi C Sept. 6, 2012, 4:35 p.m. OK Java 6 TESTS 36 360 45056000 2300
2077876 uwi C Aug. 31, 2012, 4:19 p.m. OK Java 6 TESTS 36 360 45056000 2300
2080624 pashkal C Aug. 31, 2012, 5:01 p.m. OK Java 6 TESTS 36 360 45158400 2300
2089656 sayuan C Sept. 2, 2012, 8:55 a.m. OK Java 6 TESTS 36 390 45772800 2300
2107457 Kornacker C Sept. 9, 2012, 10:52 p.m. OK Java 6 TESTS 36 440 44441600 2300
2127978 tsun C Sept. 11, 2012, 1:56 a.m. OK Java 6 TESTS 36 560 44134400 2300
2080151 Cepera C Aug. 31, 2012, 4:53 p.m. OK Java 6 TESTS 36 640 45363200 2300
2076958 Egor C Aug. 31, 2012, 4:08 p.m. OK Java 6 TESTS 36 660 45363200 2300
2081598 niyaznigmatul C Aug. 31, 2012, 5:17 p.m. OK Java 6 TESTS 36 690 50995200 2300
2081219 jiangzhijie C Aug. 31, 2012, 5:10 p.m. OK Java 7 TESTS 36 590 45260800 2300
2078991 alexey.enkov C Aug. 31, 2012, 4:34 p.m. OK Java 7 TESTS 36 630 48128000 2300
2154531 mmaxio C Sept. 12, 2012, 4:23 p.m. OK Java 7 TESTS 36 640 47104000 2300
2083489 Jokser C Aug. 31, 2012, 6:42 p.m. OK Java 7 TESTS 36 810 79872000 2300
2079808 yarrr C Aug. 31, 2012, 4:47 p.m. OK Java 7 TESTS 36 970 51814400 2300
2685811 vjudge4 C Dec. 2, 2012, 8:19 a.m. OK Java 7 TESTS 36 1296 20480000 2300
2091792 happydpc C Sept. 3, 2012, 6:30 a.m. OK Java 7 TESTS 36 1380 45465600 2300
10194485 AlexFetisov C March 7, 2015, 5:20 p.m. OK Java 8 TESTS 36 810 204800 2300
54639491 Ahmad_Elsagheer C May 25, 2019, 6:40 p.m. OK Java 8 TESTS 36 1028 11366400 2300
39800302 amnesiac_dusk C June 30, 2018, 2:12 p.m. OK Java 8 TESTS 36 1060 2764800 2300
45076371 xodiac C Oct. 30, 2018, 1:02 a.m. OK Java 8 TESTS 36 1308 20172800 2300
16029622 alibaba C Feb. 15, 2016, 9:02 a.m. OK Java 8 TESTS 36 1434 28467200 2300
2082976 pperm C Aug. 31, 2012, 6:22 p.m. OK MS C++ TESTS 36 110 4198400 2300
2087372 Restart C Sept. 1, 2012, 12:04 p.m. OK MS C++ TESTS 36 140 7065600 2300
7045215 ainta C July 8, 2014, 6:24 a.m. OK MS C++ TESTS 36 156 3686400 2300
2476755 gotoac C Nov. 1, 2012, 8:31 a.m. OK MS C++ TESTS 36 156 6553600 2300
2476752 gotoac C Nov. 1, 2012, 8:30 a.m. OK MS C++ TESTS 36 156 6553600 2300
7045419 pjsdream C July 8, 2014, 6:55 a.m. OK MS C++ TESTS 36 186 4403200 2300
2077084 arosusti C Aug. 31, 2012, 4:09 p.m. OK MS C++ TESTS 36 230 4403200 2300
3346778 nanke_ C March 17, 2013, 11:50 p.m. OK MS C++ TESTS 36 234 4198400 2300
2093024 acrux C Sept. 3, 2012, 1:30 p.m. OK MS C++ TESTS 36 250 5120000 2300
2106416 stgatilov C Sept. 9, 2012, 12:56 p.m. OK MS C++ TESTS 36 250 6041600 2300
2078539 alexey.shchepin C Aug. 31, 2012, 4:28 p.m. OK Ocaml TESTS 36 1140 10649600 2300

remove filters

Back to search problems