Codeforces Round 212 (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
362 Codeforces Round 212 (Div. 2) FINISHED False 7200 347380199 Nov. 14, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1787 ) C Insertion Sort PROGRAMMING data structures dp implementation math 2000

B"Petya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Petya has already written the code that implements this algorithm and sorts the given integer zero-indexed array a of size n in the non-decreasing order. Petya uses this algorithm only for sorting of arrays that are permutations of numbers from 0 to n xe2 x80 x89- xe2 x80 x891. He has already chosen the permutation he wants to sort but he first decided to swap some two of its elements. Petya wants to choose these elements in such a way that the number of times the sorting executes function swap, was minimum. Help Petya find out the number of ways in which he can make the swap and fulfill this requirement. It is guaranteed that it's always possible to swap two elements of the input permutation in such a way that the number of swap function calls decreases. The first line contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895000) -- the length of the permutation. The second line contains n different integers from 0 to n xe2 x80 x89- xe2 x80 x891, inclusive -- the actual permutation. Print two integers: the minimum number of times the swap function is executed and the number of such pairs (i, xe2 x80 x89j) that swapping the elements of the input permutation with indexes i and j leads to the minimum number of the executions. In the first sample the appropriate pairs are (0, xe2 x80 x893) and (0, xe2 x80 x894). In the second sample the appropriate pairs are (0, xe2 x80 x894), (1, xe2 x80 x894), (2, xe2 x80 x894) and (3, xe2 x80 x894)."...

Tutorials

Codeforces Round #212 (Div. 2). Tutorial. Part 1.

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
5109746 DimaKrachun C Nov. 14, 2013, 6:01 p.m. OK Delphi TESTS 37 312 100454400 2000
5814230 Misha100896 C Jan. 26, 2014, 5:51 p.m. OK Delphi TESTS 38 545 200601600 2000
5120999 ruban C Nov. 15, 2013, 6:18 p.m. OK Delphi TESTS 38 873 144998400 2000
5105010 vietdoan C Nov. 14, 2013, 4:31 p.m. OK FPC TESTS 37 296 200499200 2000
5127056 Nik_Storm_2010 C Nov. 16, 2013, 5:43 p.m. OK FPC TESTS 38 343 100249600 2000
5118257 Reventon1 C Nov. 15, 2013, 2:57 p.m. OK FPC TESTS 38 358 100249600 2000
5234419 Baonvhse90170 C Nov. 25, 2013, 9:41 a.m. OK FPC TESTS 38 358 200499200 2000
5481152 BenderRodriguez C Dec. 20, 2013, 2:15 p.m. OK FPC TESTS 38 390 100352000 2000
5111191 babameme C Nov. 14, 2013, 7:38 p.m. OK FPC TESTS 37 390 200499200 2000
5105418 bognden100w C Nov. 14, 2013, 4:35 p.m. OK FPC TESTS 37 452 100249600 2000
5481142 BenderRodriguez C Dec. 20, 2013, 2:14 p.m. OK FPC TESTS 38 452 144384000 2000
6056594 chicken_coder C March 17, 2014, 4:30 p.m. OK FPC TESTS 38 577 200908800 2000
6056540 chicken_coder C March 17, 2014, 4:20 p.m. OK FPC TESTS 38 577 200908800 2000
5118175 linuxtar C Nov. 15, 2013, 2:47 p.m. OK GNU C TESTS 38 171 100249600 2000
5111995 mike199250 C Nov. 14, 2013, 9:47 p.m. OK GNU C TESTS 37 171 101580800 2000
5118159 icecode C Nov. 15, 2013, 2:45 p.m. OK GNU C TESTS 38 218 100044800 2000
5106709 ilovecbx C Nov. 14, 2013, 4:51 p.m. OK GNU C TESTS 37 265 100249600 2000
5118546 binom C Nov. 15, 2013, 3:34 p.m. OK GNU C TESTS 38 312 100249600 2000
10506787 vjudge4 C March 28, 2015, 6:37 p.m. OK GNU C TESTS 38 342 100249600 2000
12436654 vjudge3 C Aug. 10, 2015, 10:04 a.m. OK GNU C TESTS 38 342 200499200 2000
5108236 zhaohaoshu C Nov. 14, 2013, 5:15 p.m. OK GNU C TESTS 37 1903 102400 2000
5107654 chemicalX C Nov. 14, 2013, 5:05 p.m. OK GNU C++ TESTS 37 46 0 2000
5163401 Fin_Parnishka C Nov. 19, 2013, 5:32 p.m. OK GNU C++ TESTS 38 46 102400 2000
5149623 Fin_Parnishka C Nov. 19, 2013, 2:18 p.m. OK GNU C++ TESTS 38 46 102400 2000
40989387 ReaLNero1 C July 30, 2018, 10:52 p.m. OK GNU C++ TESTS 38 62 102400 2000
5144845 guille C Nov. 18, 2013, 5:52 p.m. OK GNU C++ TESTS 38 62 102400 2000
5114526 hza C Nov. 15, 2013, 7:32 a.m. OK GNU C++ TESTS 37 78 0 2000
8070178 beyhhhh C Oct. 3, 2014, 3:42 p.m. OK GNU C++ TESTS 38 78 102400 2000
8070192 vjudge5 C Oct. 3, 2014, 3:43 p.m. OK GNU C++ TESTS 38 78 102400 2000
5355418 tourist__2 C Dec. 5, 2013, 3:48 p.m. OK GNU C++ TESTS 38 78 102400 2000
5267168 WhatTheFua C Nov. 27, 2013, 2:10 a.m. OK GNU C++ TESTS 38 78 102400 2000
5205504 iseki.m.aa C Nov. 24, 2013, 3:02 a.m. OK GNU C++0x TESTS 38 187 100556800 2000
5124689 2011330300713 C Nov. 16, 2013, 10:48 a.m. OK GNU C++0x TESTS 38 187 123699200 2000
5205496 iseki.m.aa C Nov. 24, 2013, 3 a.m. OK GNU C++0x TESTS 38 218 201011200 2000
5239253 Zuza C Nov. 25, 2013, 10:41 p.m. OK GNU C++0x TESTS 38 234 0 2000
5338857 marat.snowbear C Dec. 2, 2013, 9:16 p.m. OK GNU C++0x TESTS 38 234 100044800 2000
5112340 iseki.m.aa C Nov. 14, 2013, 11:18 p.m. OK GNU C++0x TESTS 37 234 100454400 2000
5147343 ParisPar C Nov. 19, 2013, 7:19 a.m. OK GNU C++0x TESTS 38 234 100556800 2000
5147329 ParisPar C Nov. 19, 2013, 7:16 a.m. OK GNU C++0x TESTS 38 234 100556800 2000
5109582 Drino C Nov. 14, 2013, 5:57 p.m. OK GNU C++0x TESTS 37 234 201011200 2000
5106213 htc550605125 C Nov. 14, 2013, 4:45 p.m. OK GNU C++0x TESTS 37 249 100556800 2000
19136645 magieNoire C July 14, 2016, 9:28 p.m. OK GNU C11 TESTS 38 233 100454400 2000
10774950 besher C April 19, 2015, 1:55 a.m. OK GNU C++11 TESTS 38 77 1945600 2000
65563904 JCC_ C Nov. 23, 2019, 4:52 a.m. OK GNU C++11 TESTS 38 93 0 2000
17132172 freebsdx C April 2, 2016, 2:48 p.m. OK GNU C++11 TESTS 38 93 2150400 2000
57893574 lopare C July 28, 2019, 12:42 p.m. OK GNU C++11 TESTS 38 108 0 2000
52636406 ONE_DAY_I_WILL C April 12, 2019, 10:19 a.m. OK GNU C++11 TESTS 38 140 100659200 2000
26788337 noor148 C May 1, 2017, 3:46 p.m. OK GNU C++11 TESTS 38 156 102502400 2000
41416442 Lis1_ C Aug. 10, 2018, 3:15 a.m. OK GNU C++11 TESTS 38 171 0 2000
49832218 vjudge1 C Feb. 12, 2019, 2:26 p.m. OK GNU C++11 TESTS 38 171 102400000 2000
26789002 noor148 C May 1, 2017, 4:31 p.m. OK GNU C++11 TESTS 38 171 102502400 2000
68353849 Latens C Jan. 7, 2020, 11:08 a.m. OK GNU C++11 TESTS 38 186 100659200 2000
49838895 vjudge5 C Feb. 12, 2019, 5:25 p.m. OK GNU C++14 TESTS 38 155 200806400 2000
49889109 _c_k_r_ C Feb. 14, 2019, 1:33 a.m. OK GNU C++14 TESTS 38 155 201113600 2000
25351688 ckw1140 C March 9, 2017, 12:54 a.m. OK GNU C++14 TESTS 38 156 52326400 2000
49814041 vjudge4 C Feb. 12, 2019, 4:13 a.m. OK GNU C++14 TESTS 38 156 200908800 2000
23557438 Ali.Pi C Jan. 5, 2017, 3:11 p.m. OK GNU C++14 TESTS 38 171 102297600 2000
49921156 kzvd4729 C Feb. 14, 2019, 6:56 p.m. OK GNU C++14 TESTS 38 186 200601600 2000
49813746 vjudge2 C Feb. 12, 2019, 3:53 a.m. OK GNU C++14 TESTS 38 186 200601600 2000
69980027 Muhammad_Hokimiyon C Feb. 1, 2020, 4:03 p.m. OK GNU C++14 TESTS 38 186 201011200 2000
44834274 CrystronNeedlefiber C Oct. 25, 2018, 10:03 a.m. OK GNU C++14 TESTS 38 187 100454400 2000
26130543 0bps C April 4, 2017, 7:08 p.m. OK GNU C++14 TESTS 38 187 202342400 2000
55859260 ruo C June 21, 2019, 8:42 a.m. OK GNU C++17 TESTS 38 155 0 2000
50310759 vjudge5 C Feb. 22, 2019, 9:17 a.m. OK GNU C++17 TESTS 38 171 0 2000
69920762 300iq C Jan. 31, 2020, 6:21 p.m. OK GNU C++17 TESTS 38 171 100249600 2000
60378085 vjudge1 C Sept. 11, 2019, 7:38 a.m. OK GNU C++17 TESTS 38 202 100454400 2000
60397589 aryanv C Sept. 11, 2019, 3:30 p.m. OK GNU C++17 TESTS 38 202 100454400 2000
68351603 Skybytskyi.Nikita C Jan. 7, 2020, 10:07 a.m. OK GNU C++17 TESTS 38 202 100556800 2000
56391705 LJL36 C July 1, 2019, 12:51 p.m. OK GNU C++17 TESTS 38 249 100454400 2000
65215569 Nazarbek. C Nov. 16, 2019, 6:27 p.m. OK GNU C++17 TESTS 38 249 208793600 2000
49962690 suibaka C Feb. 15, 2019, 7:03 p.m. OK GNU C++17 TESTS 38 296 201011200 2000
49829030 vjudge3 C Feb. 12, 2019, 1:04 p.m. OK GNU C++17 TESTS 38 311 100659200 2000
69895112 RetiredProgrammer C Jan. 31, 2020, 11:29 a.m. OK Java 11 TESTS 38 716 0 2000
5805634 breeze C Jan. 25, 2014, 11:49 a.m. OK Java 6 TESTS 38 467 142233600 2000
5110604 udontknowme C Nov. 14, 2013, 6:44 p.m. OK Java 6 TESTS 37 546 215756800 2000
5108792 humblefool C Nov. 14, 2013, 5:23 p.m. OK Java 6 TESTS 37 561 49356800 2000
5149121 gilesg C Nov. 19, 2013, 12:48 p.m. OK Java 6 TESTS 38 624 49049600 2000
7683063 bnuvjudge C Sept. 4, 2014, 3:30 p.m. OK Java 6 TESTS 38 779 143360000 2000
5122071 mkirsche C Nov. 15, 2013, 11:24 p.m. OK Java 6 TESTS 38 858 49254400 2000
5109465 wackloner C Nov. 14, 2013, 5:54 p.m. OK Java 6 TESTS 37 1731 62259200 2000
5102666 llaki C Nov. 14, 2013, 4:09 p.m. OK Java 6 TESTS 37 1840 216166400 2000
5108108 ballon C Nov. 14, 2013, 5:13 p.m. OK Java 7 TESTS 37 296 0 2000
5105210 uwi C Nov. 14, 2013, 4:33 p.m. OK Java 7 TESTS 37 296 0 2000
5111150 KNIGHT0X300 C Nov. 14, 2013, 7:34 p.m. OK Java 7 TESTS 37 390 142438400 2000
11135256 Sumeet.Varma C May 18, 2015, 1:14 p.m. OK Java 7 TESTS 38 421 138956800 2000
5110160 filo C Nov. 14, 2013, 6:16 p.m. OK Java 7 TESTS 37 421 142233600 2000
5104786 KOHCTAHTIH C Nov. 14, 2013, 4:29 p.m. OK Java 7 TESTS 37 436 142233600 2000
7048635 Xanthic C July 8, 2014, 4:50 p.m. OK Java 7 TESTS 38 467 151654400 2000
5358067 HidenoriS C Dec. 6, 2013, 3:30 a.m. OK Java 7 TESTS 38 468 138854400 2000
5109613 dusty.and.rusty C Nov. 14, 2013, 5:58 p.m. OK Java 7 TESTS 37 483 136396800 2000
5102055 mmaxio C Nov. 14, 2013, 4:04 p.m. OK Java 7 TESTS 37 483 139264000 2000
11682101 Code.coding C June 20, 2015, 1:07 p.m. OK Java 8 TESTS 38 545 138547200 2000
26358616 XYRain C April 14, 2017, 2:06 p.m. OK Java 8 TESTS 38 623 177049600 2000
29863617 maratonando2 C Aug. 29, 2017, 10:45 a.m. OK Java 8 TESTS 38 795 137523200 2000
10362417 stan C March 20, 2015, 3:39 a.m. OK Java 8 TESTS 38 1622 0 2000
9739682 alibaba C Feb. 6, 2015, 7:34 p.m. OK Java 8 TESTS 38 1778 0 2000
5110811 Sourcerer C Nov. 14, 2013, 7 p.m. OK MS C# TESTS 37 608 205312000 2000
5110284 Sourcerer C Nov. 14, 2013, 6:21 p.m. OK MS C# TESTS 37 639 205209600 2000
10131479 azukun C March 3, 2015, 11:06 a.m. OK MS C# TESTS 38 779 207564800 2000
5114993 Guliash C Nov. 15, 2013, 8:35 a.m. OK MS C# TESTS 37 1232 201728000 2000
11171527 pacu C May 20, 2015, 2:23 a.m. OK MS C++ TESTS 38 78 0 2000
5107708 R.Lee C Nov. 14, 2013, 5:06 p.m. OK MS C++ TESTS 37 93 102400 2000
5112626 ZUBAT C Nov. 15, 2013, 12:50 a.m. OK MS C++ TESTS 37 124 100454400 2000
5128901 hataksumo C Nov. 17, 2013, 4:27 a.m. OK MS C++ TESTS 38 140 0 2000
5127261 defaultcoder C Nov. 16, 2013, 6:27 p.m. OK MS C++ TESTS 38 156 100044800 2000
5108274 CtrlAlt C Nov. 14, 2013, 5:15 p.m. OK MS C++ TESTS 37 156 201113600 2000
5146850 zhujsjs C Nov. 19, 2013, 5:21 a.m. OK MS C++ TESTS 38 171 100249600 2000
5103536 pjsdream C Nov. 14, 2013, 4:16 p.m. OK MS C++ TESTS 37 171 150220800 2000
11171530 pacu C May 20, 2015, 2:23 a.m. OK MS C++ TESTS 38 187 0 2000
5110390 AleksanderBalobanov C Nov. 14, 2013, 6:28 p.m. OK MS C++ TESTS 37 202 200908800 2000
5111744 limed C Nov. 14, 2013, 8:54 p.m. OK Scala TESTS 37 1029 175001600 2000

remove filters

Back to search problems