Codeforces Round 119 (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
187 Codeforces Round 119 (Div. 1) FINISHED False 7200 401207386 May 10, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2860 ) A Permutations PROGRAMMING greedy 1600

B'Happy PMP is freshman and he is learning about algorithmic problems. He enjoys playing algorithmic games a lot. One of the seniors gave Happy PMP a nice game. He is given two permutations of numbers 1 through n and is asked to convert the first one to the second. In one move he can remove the last number from the permutation of numbers and inserts it back in an arbitrary position. He can either insert last number between any two consecutive numbers, or he can place it at the beginning of the permutation. Happy PMP has an algorithm that solves the problem. But it is not fast enough. He wants to know the minimum number of moves to convert the first permutation to the second. 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 x892 xc2 xb7105) -- the quantity of the numbers in the both given permutations. Next line contains n space-separated integers -- the first permutation. Each number between 1 to n will appear in the permutation exactly once. Next line describe the second permutation in the same format. Print a single integer denoting the minimum number of moves required to convert the first permutation to the second. In the first sample, he removes number 1 from end of the list and places it at the beginning. After that he takes number 2 and places it between 1 and 3. In the second sample, he removes number 5 and inserts it after 1. In the third sample, the sequence of changes are like this: '...

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3084042 Mosyagin A Feb. 8, 2013, 3:06 p.m. OK Delphi TESTS 58 78 1638400 1600
2863510 Misha100896 A Jan. 1, 2013, 12:49 p.m. OK Delphi TESTS 58 78 1638400 1600
1675319 Timur_Keks A May 10, 2012, 4:08 p.m. OK Delphi TESTS 58 80 11059200 1600
1684707 TarasSavitskyi A May 12, 2012, 4:36 p.m. OK Delphi TESTS 58 80 11776000 1600
1682587 ErzhanDS A May 12, 2012, 4:45 a.m. OK Delphi TESTS 58 80 12595200 1600
1674104 Spumote A May 10, 2012, 3:51 p.m. OK Delphi TESTS 58 80 14233600 1600
1682309 Ramp A May 11, 2012, 8:26 p.m. OK Delphi TESTS 58 80 17408000 1600
1673293 BaJIuK A May 10, 2012, 3:42 p.m. OK Delphi TESTS 58 80 33894400 1600
1688870 bdsql A May 15, 2012, 10:20 a.m. OK Delphi TESTS 58 90 10956800 1600
1678014 your_conscience A May 10, 2012, 5:10 p.m. OK Delphi TESTS 58 90 15462400 1600
2489257 superpear A Nov. 2, 2012, 5:58 a.m. OK FPC TESTS 58 109 7987200 1600
1767972 norikas A June 6, 2012, 5:05 p.m. OK FPC TESTS 58 110 2764800 1600
1681609 tjg A May 11, 2012, 1:43 p.m. OK FPC TESTS 58 110 2764800 1600
4210775 Nik_Storm_2010 A July 31, 2013, 7:59 p.m. OK FPC TESTS 58 124 1638400 1600
4990321 llaugusty A Nov. 5, 2013, 4:55 a.m. OK FPC TESTS 58 124 7987200 1600
2235051 niike0goood A Sept. 23, 2012, 2:06 p.m. OK FPC TESTS 58 125 3174400 1600
3422973 nhandi A March 30, 2013, 1:06 p.m. OK FPC TESTS 58 125 3379200 1600
1733467 coolinging A May 28, 2012, 6:09 a.m. OK FPC TESTS 58 130 2764800 1600
1702966 MisaRu A May 19, 2012, 6:05 a.m. OK FPC TESTS 58 130 2764800 1600
1701293 whitetooth A May 18, 2012, 12:09 p.m. OK FPC TESTS 58 130 2764800 1600
3038350 hariprasath A Jan. 30, 2013, 7:23 p.m. OK GNU C TESTS 58 140 1638400 1600
1997540 vjudge5 A Aug. 10, 2012, 10:42 a.m. OK GNU C TESTS 58 160 3891200 1600
1723247 vjudge5 A May 27, 2012, 5:19 a.m. OK GNU C TESTS 58 170 2969600 1600
1672744 stubbscroll A May 10, 2012, 3:36 p.m. OK GNU C TESTS 58 170 3481600 1600
14748931 vprime5 A Dec. 10, 2015, 6:35 p.m. OK GNU C TESTS 58 186 1638400 1600
14748891 vprime5 A Dec. 10, 2015, 6:32 p.m. OK GNU C TESTS 58 186 1638400 1600
14699858 dududcbier A Dec. 8, 2015, 3:01 p.m. OK GNU C TESTS 58 186 2355200 1600
17435437 bnuvjudge2 A April 22, 2016, 1:42 p.m. OK GNU C TESTS 58 186 3686400 1600
17420734 bnuvjudge2 A April 21, 2016, 2:13 p.m. OK GNU C TESTS 58 186 3686400 1600
14749389 vprime5 A Dec. 10, 2015, 7:14 p.m. OK GNU C TESTS 58 218 1638400 1600
1673290 prpr A May 10, 2012, 3:42 p.m. OK GNU C++ TESTS 58 60 3788800 1600
38471884 Scut82 A May 21, 2018, 12:32 a.m. OK GNU C++ TESTS 58 62 1638400 1600
3822028 Simplex A June 4, 2013, 3:01 p.m. OK GNU C++ TESTS 58 78 1638400 1600
3263617 H3X A March 7, 2013, 8:41 p.m. OK GNU C++ TESTS 58 78 1638400 1600
3416244 juancate A March 28, 2013, 3:23 p.m. OK GNU C++ TESTS 58 78 2457600 1600
1672947 vexorian A May 10, 2012, 3:38 p.m. OK GNU C++ TESTS 58 90 2969600 1600
1690241 grsiy A May 16, 2012, 11:23 a.m. OK GNU C++ TESTS 58 90 3072000 1600
1686064 aminlore A May 13, 2012, 10:35 a.m. OK GNU C++ TESTS 58 90 3072000 1600
1686218 ysymyth A May 13, 2012, 12:10 p.m. OK GNU C++ TESTS 58 90 3993600 1600
41688977 Scut82 A Aug. 17, 2018, 2:46 p.m. OK GNU C++ TESTS 58 92 1638400 1600
1676787 jiangzhijie A May 10, 2012, 4:37 p.m. OK GNU C++0x TESTS 58 50 7065600 1600
4931003 Orfest A Oct. 29, 2013, 8:49 p.m. OK GNU C++0x TESTS 58 78 2457600 1600
1672598 riadwaw A May 10, 2012, 3:33 p.m. OK GNU C++0x TESTS 58 90 3072000 1600
3759223 Avitella A May 23, 2013, 3:59 a.m. OK GNU C++0x TESTS 58 109 24064000 1600
1678955 hex539 A May 10, 2012, 6:05 p.m. OK GNU C++0x TESTS 58 110 2969600 1600
1672934 hex539 A May 10, 2012, 3:38 p.m. OK GNU C++0x TESTS 58 110 2969600 1600
9273616 suchir A Dec. 26, 2014, 7:56 a.m. OK GNU C++0x TESTS 58 122 2457600 1600
5828170 marat.snowbear A Jan. 28, 2014, 8:49 p.m. OK GNU C++0x TESTS 58 124 2457600 1600
4391469 Mark_Fan A Sept. 1, 2013, 6:12 a.m. OK GNU C++0x TESTS 58 124 4198400 1600
7987860 maxkvant A Sept. 27, 2014, 6:16 p.m. OK GNU C++0x TESTS 58 154 3993600 1600
58915886 rainboy A Aug. 16, 2019, 2:57 p.m. OK GNU C11 TESTS 58 156 1638400 1600
63293856 yuy A Oct. 24, 2019, 12:27 p.m. OK GNU C++11 TESTS 58 62 2457600 1600
18230553 eddy1021 A June 3, 2016, 11:41 a.m. OK GNU C++11 TESTS 58 62 3891200 1600
40991264 ReaLNero1 A July 31, 2018, 12:32 a.m. OK GNU C++11 TESTS 58 92 5632000 1600
14032219 sicon54 A Nov. 2, 2015, 6:29 p.m. OK GNU C++11 TESTS 58 156 614400 1600
18739994 szawinis A June 26, 2016, 4:18 p.m. OK GNU C++11 TESTS 58 156 1638400 1600
15180603 joisino A Jan. 4, 2016, 11:58 a.m. OK GNU C++11 TESTS 58 156 1638400 1600
14356451 brunopc A Nov. 20, 2015, 9:19 a.m. OK GNU C++11 TESTS 58 156 1638400 1600
14309775 renju A Nov. 17, 2015, 8:47 a.m. OK GNU C++11 TESTS 58 156 1638400 1600
14290973 yancouto A Nov. 16, 2015, 12:34 a.m. OK GNU C++11 TESTS 58 156 1638400 1600
68971292 cor001 A Jan. 17, 2020, 7:06 a.m. OK GNU C++11 TESTS 58 156 1638400 1600
35067039 LiChenKoh A Feb. 8, 2018, 5:11 p.m. OK GNU C++14 TESTS 58 62 5120000 1600
29329749 pazabol A Aug. 10, 2017, 3:13 p.m. OK GNU C++14 TESTS 58 156 3584000 1600
29329867 pazabol A Aug. 10, 2017, 3:20 p.m. OK GNU C++14 TESTS 58 156 3584000 1600
46428284 LiSA A Dec. 1, 2018, 3:03 a.m. OK GNU C++14 TESTS 58 216 2457600 1600
57722884 Theofratus A July 25, 2019, 6:12 a.m. OK GNU C++14 TESTS 58 218 1638400 1600
49308058 dharmenderlodhi186 A Feb. 1, 2019, 6:34 a.m. OK GNU C++14 TESTS 58 218 1638400 1600
27918058 venkat1997 A June 20, 2017, 5:56 a.m. OK GNU C++14 TESTS 58 218 1638400 1600
69669990 pkj A Jan. 28, 2020, 12:41 p.m. OK GNU C++14 TESTS 58 218 1638400 1600
27285284 srinu37 A May 22, 2017, 1:44 p.m. OK GNU C++14 TESTS 58 218 2457600 1600
52002796 ZNI A March 30, 2019, 7 a.m. OK GNU C++14 TESTS 58 218 2457600 1600
54522094 Bayati A May 23, 2019, 12:44 p.m. OK GNU C++17 TESTS 58 218 1638400 1600
46428235 tfg A Dec. 1, 2018, 3:01 a.m. OK GNU C++17 TESTS 58 218 1638400 1600
44686237 ruo A Oct. 22, 2018, 9:42 a.m. OK GNU C++17 TESTS 58 218 1638400 1600
63127120 tnakao A Oct. 22, 2019, 1:08 p.m. OK GNU C++17 TESTS 58 218 1638400 1600
63199847 Juanito98 A Oct. 22, 2019, 8 p.m. OK GNU C++17 TESTS 58 218 2355200 1600
58927124 cyansea A Aug. 16, 2019, 8:15 p.m. OK GNU C++17 TESTS 58 218 2457600 1600
38978617 Laith98 A June 5, 2018, 8:24 p.m. OK GNU C++17 TESTS 58 248 1638400 1600
54485707 we_dont_talk_anymore A May 22, 2019, 12:59 p.m. OK GNU C++17 TESTS 58 248 3174400 1600
59449977 sammithkanur A Aug. 25, 2019, 2:38 p.m. OK GNU C++17 TESTS 58 248 3174400 1600
62574521 failed_coder A Oct. 14, 2019, 3:29 p.m. OK GNU C++17 TESTS 58 248 3379200 1600
1679249 cojna A May 10, 2012, 6:21 p.m. OK Haskell TESTS 58 730 64102400 1600
1672571 Egor A May 10, 2012, 3:32 p.m. OK Java 6 TESTS 58 110 43110400 1600
1876707 ilyakor A July 8, 2012, 4:19 p.m. OK Java 6 TESTS 58 140 43212800 1600
1672634 uwi A May 10, 2012, 3:34 p.m. OK Java 6 TESTS 58 200 43110400 1600
1686234 Sammarize A May 13, 2012, 12:26 p.m. OK Java 6 TESTS 58 230 43315200 1600
1673000 VArtem A May 10, 2012, 3:39 p.m. OK Java 6 TESTS 58 230 45875200 1600
1681522 AlexanderBolshakov A May 11, 2012, 1:17 p.m. OK Java 6 TESTS 58 230 45977600 1600
4137429 mkirsche A July 22, 2013, 8:31 p.m. OK Java 6 TESTS 58 234 2764800 1600
1702322 mashinist A May 18, 2012, 7:26 p.m. OK Java 6 TESTS 58 250 45875200 1600
1682399 otero1991 A May 12, 2012, 1:15 a.m. OK Java 6 TESTS 58 250 45875200 1600
1672785 ArtemKadeev A May 10, 2012, 3:36 p.m. OK Java 6 TESTS 58 250 46080000 1600
3794930 gcd_fuck A May 30, 2013, 3:25 p.m. OK Java 7 TESTS 58 250 7065600 1600
1681062 bidzilya A May 11, 2012, 10:46 a.m. OK Java 7 TESTS 58 250 47513600 1600
1672999 Abra A May 10, 2012, 3:39 p.m. OK Java 7 TESTS 58 270 47513600 1600
1672903 qwerty787788 A May 10, 2012, 3:38 p.m. OK Java 7 TESTS 58 270 47616000 1600
1674089 yarrr A May 10, 2012, 3:51 p.m. OK Java 7 TESTS 58 270 47718400 1600
1673164 yaro A May 10, 2012, 3:40 p.m. OK Java 7 TESTS 58 280 47513600 1600
1672629 mmaxio A May 10, 2012, 3:34 p.m. OK Java 7 TESTS 58 280 47513600 1600
9282403 upsolving A Dec. 27, 2014, 9:12 a.m. OK Java 7 TESTS 58 342 2048000 1600
4245023 santjuan A Aug. 8, 2013, 11:49 p.m. OK Java 7 TESTS 58 468 12185600 1600
6564973 nickbuelich A May 7, 2014, 2:07 a.m. OK Java 7 TESTS 58 530 14438400 1600
14997152 poikniok A Dec. 25, 2015, 3:43 a.m. OK Java 8 TESTS 58 248 0 1600
25017994 ppppppppppppppp A Feb. 25, 2017, 4:41 p.m. OK Java 8 TESTS 58 248 20889600 1600
28305793 Tarun A July 5, 2017, 2:05 p.m. OK Java 8 TESTS 58 278 20684800 1600
58188179 Ahmad A Aug. 2, 2019, 6:06 p.m. OK Java 8 TESTS 58 280 0 1600
14997449 poikniok A Dec. 25, 2015, 4:20 a.m. OK Java 8 TESTS 58 280 0 1600
27927742 Musin A June 20, 2017, 3:15 p.m. OK Java 8 TESTS 58 280 20582400 1600
28278510 Ajudiya_13 A July 4, 2017, 11:13 a.m. OK Java 8 TESTS 58 310 20582400 1600
55732693 Xylenox A June 18, 2019, 11:36 p.m. OK Java 8 TESTS 58 374 5836800 1600
22036028 OmarRadwan A Nov. 4, 2016, 2:11 p.m. OK Java 8 TESTS 58 374 6553600 1600
28476279 tomdmitriev A July 12, 2017, 2:04 p.m. OK Java 8 TESTS 58 374 29286400 1600
1672639 it4.kp A May 10, 2012, 3:34 p.m. OK Mono C# TESTS 58 200 14131200 1600
1686500 yongheng5871 A May 13, 2012, 3:19 p.m. OK Mono C# TESTS 58 230 29491200 1600
1679387 tselofan A May 10, 2012, 6:34 p.m. OK Mono C# TESTS 58 250 29593600 1600
1674277 NKolotey A May 10, 2012, 3:53 p.m. OK Mono C# TESTS 58 270 29593600 1600
1746254 dannsk A May 31, 2012, 5:04 p.m. OK Mono C# TESTS 58 300 41472000 1600
16277311 og.kostya A Feb. 22, 2016, 1:19 p.m. OK MS C# TESTS 58 156 1638400 1600
3933422 tomas.svab A June 21, 2013, 6:41 p.m. OK MS C++ TESTS 58 109 1843200 1600
1685695 vagnard A May 13, 2012, 7:14 a.m. OK MS C++ TESTS 58 130 5427200 1600
1681819 yonjue A May 11, 2012, 2:59 p.m. OK MS C++ TESTS 58 140 2969600 1600
1673671 Jens A May 10, 2012, 3:46 p.m. OK MS C++ TESTS 58 140 2969600 1600
1723424 vjudge1 A May 27, 2012, 6:50 a.m. OK MS C++ TESTS 58 140 2969600 1600
1746216 Witalia A May 31, 2012, 4:42 p.m. OK MS C++ TESTS 58 140 2969600 1600
1675670 antonkov A May 10, 2012, 4:14 p.m. OK MS C++ TESTS 58 140 3072000 1600
1767806 hamed053 A June 6, 2012, 3:06 p.m. OK MS C++ TESTS 58 140 3072000 1600
1714073 maruius A May 24, 2012, 4:58 p.m. OK MS C++ TESTS 58 140 3686400 1600
1944206 vjudge4 A July 27, 2012, 8:53 a.m. OK MS C++ TESTS 58 140 3891200 1600
69635681 2018972116 A Jan. 27, 2020, 6:29 p.m. OK MS C++ 2017 TESTS 58 654 819200 1600
1674785 alexey.shchepin A May 10, 2012, 4 p.m. OK Ocaml TESTS 58 270 5529600 1600
1682392 math94 A May 12, 2012, 1:07 a.m. OK PHP TESTS 58 330 49971200 1600
31481440 Prec A Oct. 18, 2017, 1:24 p.m. OK PyPy 3 TESTS 58 842 40755200 1600
56747129 kopok2 A July 9, 2019, 10:16 a.m. OK PyPy 3 TESTS 58 1496 19968000 1600
17393641 bnuvjudge2 A April 20, 2016, 1:17 a.m. OK Python 2 TESTS 58 560 19865600 1600
1681906 antonkudrin A May 11, 2012, 3:40 p.m. OK Python 2 TESTS 58 590 16793600 1600
1811923 peking2 A June 21, 2012, 5:52 a.m. OK Python 2 TESTS 58 590 16896000 1600
23669864 Ali.Pi A Jan. 9, 2017, 7:29 p.m. OK Python 2 TESTS 58 590 19865600 1600
15914034 not_bot_but_POT A Feb. 9, 2016, 1:37 p.m. OK Python 2 TESTS 58 592 15257600 1600
14759915 felipeblassioli A Dec. 11, 2015, 3:08 p.m. OK Python 2 TESTS 58 592 15257600 1600
35843350 ______u______ A March 2, 2018, 3:10 p.m. OK Python 2 TESTS 58 622 19865600 1600
35843328 ______n______ A March 2, 2018, 3:10 p.m. OK Python 2 TESTS 58 622 19865600 1600
35843132 _____i_____ A March 2, 2018, 3:06 p.m. OK Python 2 TESTS 58 622 19865600 1600
35843127 _____k_____ A March 2, 2018, 3:06 p.m. OK Python 2 TESTS 58 622 19865600 1600
6687550 yugle7 A May 23, 2014, 1:19 p.m. OK Python 3 TESTS 58 592 18636800 1600
57768515 vjudge3 A July 25, 2019, 10:25 p.m. OK Python 3 TESTS 58 622 18329600 1600
41983347 Mk_Python_v1 A Aug. 23, 2018, 3:51 a.m. OK Python 3 TESTS 58 654 18124800 1600
39269897 fcpytago A June 15, 2018, 3:19 p.m. OK Python 3 TESTS 58 748 25702400 1600
57770707 vjudge5 A July 26, 2019, 12:29 a.m. OK Python 3 TESTS 58 810 21299200 1600
57770683 ptflores A July 26, 2019, 12:28 a.m. OK Python 3 TESTS 58 810 21299200 1600
1689670 cemaleker A May 15, 2012, 10:39 p.m. OK Ruby TESTS 58 700 23756800 1600
1705740 AntonDubovik A May 20, 2012, 8:42 a.m. OK Scala TESTS 58 660 50176000 1600
1680668 ymatsux A May 11, 2012, 7:26 a.m. OK Scala TESTS 58 690 51916800 1600
1680652 ymatsux A May 11, 2012, 7:23 a.m. OK Scala TESTS 58 1340 43827200 1600

remove filters

Back to search problems