Codeforces Round 386 (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
746 Codeforces Round 386 (Div. 2) FINISHED False 9000 249765899 Dec. 18, 2016, 10:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1741 ) E Numbers Exchange PROGRAMMING greedy implementation math 1800

B"Eugeny has n cards, each of them has exactly one integer written on it. Eugeny wants to exchange some cards with Nikolay so that the number of even integers on his cards would equal the number of odd integers, and that all these numbers would be distinct. Nikolay has m cards, distinct numbers from 1 to m are written on them, one per card. It means that Nikolay has exactly one card with number 1, exactly one card with number 2 and so on. A single exchange is a process in which Eugeny gives one card to Nikolay and takes another one from those Nikolay has. Your task is to find the minimum number of card exchanges and determine which cards Eugeny should exchange. The first line contains two integers n and m (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the number of cards Eugeny has and the number of cards Nikolay has. It is guaranteed that n is even. The second line contains a sequence of n positive integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the numbers on Eugeny's cards. If there is no answer, print -1. Otherwise, in the first line print the minimum number of exchanges. In the second line print n integers -- Eugeny's cards after all the exchanges with Nikolay. The order of cards should coincide with the card's order in the input data. If the i-th card wasn't exchanged then the i-th number should coincide with the number from the input data. Otherwise, it is considered that this card was exchanged, and the i-th number should be equal to the number on the card it was exchanged to. If there are multiple answers, it is allowed to print any of them. "...

Tutorials

Codeforces Round #386 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
23107389 s34vv1nd E Dec. 18, 2016, 2:32 p.m. OK FPC TESTS 19 374 18739200 1800
23202314 ngattaro1 E Dec. 21, 2016, 3:08 p.m. OK FPC TESTS 19 389 5632000 1800
23107293 s34vv1nd E Dec. 18, 2016, 2:28 p.m. OK FPC TESTS 19 389 18739200 1800
23107082 ultoxtung E Dec. 18, 2016, 2:22 p.m. OK FPC TESTS 19 405 6758400 1800
23103979 bzh E Dec. 18, 2016, 1:04 p.m. OK FPC TESTS 19 420 5632000 1800
30289277 changz E Sept. 12, 2017, 2:54 p.m. OK GNU C TESTS 19 124 20889600 1800
23993561 vjudge1 E Jan. 20, 2017, 4:26 p.m. OK GNU C TESTS 19 140 5427200 1800
23215968 jkxjkx1031 E Dec. 22, 2016, 2:04 a.m. OK GNU C TESTS 19 140 9113600 1800
23106102 legitawesome E Dec. 18, 2016, 2 p.m. OK GNU C TESTS 19 171 21913600 1800
23106131 CloudStrife E Dec. 18, 2016, 2 p.m. OK GNU C TESTS 19 171 253132800 1800
23103572 WHzy E Dec. 18, 2016, 1:01 p.m. OK GNU C++ TESTS 19 108 5324800 1800
23106701 Marco_L_T E Dec. 18, 2016, 2:13 p.m. OK GNU C++ TESTS 19 108 5734400 1800
38609283 AuqaKyz E May 25, 2018, 12:47 p.m. OK GNU C++ TESTS 19 109 5017600 1800
23353798 Jhulia.Graziella E Dec. 27, 2016, 6:55 a.m. OK GNU C++ TESTS 19 124 4505600 1800
28689357 vjudge1 E July 19, 2017, 8:01 a.m. OK GNU C++ TESTS 19 124 5324800 1800
26655194 vjudge3 E April 25, 2017, 7:56 a.m. OK GNU C++ TESTS 19 124 5427200 1800
23105987 stefansav E Dec. 18, 2016, 1:57 p.m. OK GNU C++ TESTS 19 124 6656000 1800
24800548 liujianbo E Feb. 19, 2017, 11:23 a.m. OK GNU C++ TESTS 19 124 8806400 1800
23117676 unawareness E Dec. 19, 2016, 1:59 a.m. OK GNU C++ TESTS 19 140 8499200 1800
30666239 vjudge3 E Sept. 24, 2017, 12:52 p.m. OK GNU C++ TESTS 19 140 11673600 1800
56532424 rainboy E July 4, 2019, 8:41 p.m. OK GNU C11 TESTS 19 748 2252800 1800
40982967 ReaLNero1 E July 30, 2018, 6:39 p.m. OK GNU C++11 TESTS 19 77 3174400 1800
55113673 WsSyx E June 5, 2019, 7:38 a.m. OK GNU C++11 TESTS 19 93 9625600 1800
39971907 VAVAvile E July 5, 2018, 3:20 a.m. OK GNU C++11 TESTS 19 93 10649600 1800
38609274 zykzhenshuai E May 25, 2018, 12:46 p.m. OK GNU C++11 TESTS 19 109 5017600 1800
23217825 dotorya E Dec. 22, 2016, 5:30 a.m. OK GNU C++11 TESTS 19 109 8601600 1800
55113692 bojverdict2 E June 5, 2019, 7:38 a.m. OK GNU C++11 TESTS 19 109 9625600 1800
23103131 norshtein E Dec. 18, 2016, 12:58 p.m. OK GNU C++11 TESTS 19 124 5427200 1800
24031192 rab0t E Jan. 22, 2017, 1:24 p.m. OK GNU C++11 TESTS 19 124 8704000 1800
55113714 bojverdict1 E June 5, 2019, 7:39 a.m. OK GNU C++11 TESTS 19 124 9625600 1800
23104973 _42 E Dec. 18, 2016, 1:38 p.m. OK GNU C++11 TESTS 19 124 11059200 1800
23105747 Igorjan94 E Dec. 18, 2016, 1:53 p.m. OK GNU C++14 TESTS 19 108 11161600 1800
23460740 ReaLNero E Dec. 31, 2016, 1:28 a.m. OK GNU C++14 TESTS 19 108 15462400 1800
23108345 iKID.Huy E Dec. 18, 2016, 3:03 p.m. OK GNU C++14 TESTS 19 108 26931200 1800
23116786 Xin-Jie E Dec. 19, 2016, 12:02 a.m. OK GNU C++14 TESTS 19 109 10752000 1800
23117143 lerom E Dec. 19, 2016, 12:55 a.m. OK GNU C++14 TESTS 19 124 3686400 1800
23353938 Ali.Pi E Dec. 27, 2016, 7:03 a.m. OK GNU C++14 TESTS 19 124 4608000 1800
53381803 M_Mohsen E April 26, 2019, 11:35 p.m. OK GNU C++14 TESTS 19 124 7884800 1800
34906757 wladw E Feb. 3, 2018, 7:28 p.m. OK GNU C++14 TESTS 19 124 8089600 1800
23113502 Akylbeek E Dec. 18, 2016, 6:59 p.m. OK GNU C++14 TESTS 19 124 17612800 1800
23363855 return_100 E Dec. 27, 2016, 5:15 p.m. OK GNU C++14 TESTS 19 139 7168000 1800
62877481 yuhta E Oct. 18, 2019, 3:45 p.m. OK GNU C++17 TESTS 19 124 6860800 1800
56434579 hjk1030 E July 2, 2019, 1:33 p.m. OK GNU C++17 TESTS 19 155 9011200 1800
51487541 gtx1080 E March 19, 2019, 2:11 p.m. OK GNU C++17 TESTS 19 170 8192000 1800
55322460 nic6200 E June 9, 2019, 5:49 a.m. OK GNU C++17 TESTS 19 170 15872000 1800
59614926 vjudge1 E Aug. 28, 2019, 12:19 p.m. OK GNU C++17 TESTS 19 171 8192000 1800
63212612 vjudge1 E Oct. 23, 2019, 4:42 a.m. OK GNU C++17 TESTS 19 171 11366400 1800
39816641 mirsaid_mir E July 1, 2018, 8:57 a.m. OK GNU C++17 TESTS 19 186 7577600 1800
46701635 henu_16l_lxl E Dec. 7, 2018, 3:15 a.m. OK GNU C++17 TESTS 19 186 8704000 1800
37631253 psh330327 E April 26, 2018, 10:09 a.m. OK GNU C++17 TESTS 19 186 14233600 1800
43036978 Error_404 E Sept. 18, 2018, 1:59 p.m. OK GNU C++17 TESTS 19 202 7577600 1800
23279762 PugachAG E Dec. 24, 2016, 9:22 p.m. OK Go TESTS 19 810 39219200 1800
23107513 Musin E Dec. 18, 2016, 2:36 p.m. OK Java 8 TESTS 19 187 23859200 1800
60404600 chojh1222 E Sept. 11, 2019, 6:04 p.m. OK Java 8 TESTS 19 234 10752000 1800
23807055 Dekacc E Jan. 14, 2017, 1:36 p.m. OK Java 8 TESTS 19 280 28876800 1800
23109484 amtematem E Dec. 18, 2016, 3:50 p.m. OK Java 8 TESTS 19 280 34201600 1800
27528907 srinu37 E June 2, 2017, 5:22 p.m. OK Java 8 TESTS 19 295 14745600 1800
23109453 amtematem E Dec. 18, 2016, 3:49 p.m. OK Java 8 TESTS 19 295 34508800 1800
56532404 Dukkha E July 4, 2019, 8:41 p.m. OK Java 8 TESTS 19 296 0 1800
60403025 chojh1222 E Sept. 11, 2019, 5:25 p.m. OK Java 8 TESTS 19 311 10956800 1800
23285838 MDL E Dec. 25, 2016, 6:36 a.m. OK Java 8 TESTS 19 311 20684800 1800
25563321 maitony E March 17, 2017, 3:29 a.m. OK Java 8 TESTS 19 326 39424000 1800
28133784 ramil.agger E June 29, 2017, 7:22 a.m. OK Kotlin TESTS 19 342 37273600 1800
68111584 hibatibati E Jan. 3, 2020, 9:45 a.m. OK Mono C# TESTS 19 249 35123200 1800
23113478 og.kostya E Dec. 18, 2016, 6:58 p.m. OK MS C# TESTS 19 139 16486400 1800
23142778 pomjuice E Dec. 19, 2016, 3:54 p.m. OK MS C# TESTS 19 202 46694400 1800
23410387 Taz E Dec. 29, 2016, 10:37 p.m. OK MS C# TESTS 19 545 25292800 1800
23731425 SUDAL E Jan. 12, 2017, 5:56 a.m. OK MS C++ TESTS 19 109 6860800 1800
23117570 AU.Bahosain E Dec. 19, 2016, 1:48 a.m. OK MS C++ TESTS 19 187 10547200 1800
23107840 RubyStone E Dec. 18, 2016, 2:47 p.m. OK MS C++ TESTS 19 202 9523200 1800
23358368 art_star E Dec. 27, 2016, 11:51 a.m. OK MS C++ TESTS 19 218 10547200 1800
23103672 claus_spb E Dec. 18, 2016, 1:02 p.m. OK MS C++ TESTS 19 249 9318400 1800
23939587 vjudge3 E Jan. 19, 2017, 8:05 a.m. OK MS C++ TESTS 19 264 11366400 1800
23210126 nns2009 E Dec. 21, 2016, 8:28 p.m. OK MS C++ TESTS 19 311 15667200 1800
23209907 xarshila_ E Dec. 21, 2016, 8:11 p.m. OK MS C++ TESTS 19 405 7168000 1800
24067614 dklsfjlksdfj E Jan. 23, 2017, 9:25 a.m. OK MS C++ TESTS 19 421 9318400 1800
23153127 april1994 E Dec. 19, 2016, 5:24 p.m. OK MS C++ TESTS 19 421 10547200 1800
63088456 onkrot E Oct. 21, 2019, 5:25 p.m. OK MS C++ 2017 TESTS 19 514 8908800 1800
36450035 mayakin E March 21, 2018, 9:37 a.m. OK PHP TESTS 19 327 34816000 1800
23102928 Ferume E Dec. 18, 2016, 12:57 p.m. OK PyPy 2 TESTS 19 202 45670400 1800
23546184 NicolasK E Jan. 5, 2017, 1:28 a.m. OK PyPy 2 TESTS 19 233 43315200 1800
23113287 har_vi E Dec. 18, 2016, 6:49 p.m. OK PyPy 2 TESTS 19 265 54784000 1800
35103952 yugle7 E Feb. 9, 2018, 7:41 p.m. OK PyPy 3 TESTS 19 623 46387200 1800
23189352 cugel E Dec. 21, 2016, 1:14 a.m. OK PyPy 3 TESTS 19 873 53145600 1800
23108455 L1va E Dec. 18, 2016, 3:08 p.m. OK Python 3 TESTS 19 498 40345600 1800
23105023 uppi E Dec. 18, 2016, 1:39 p.m. OK Python 3 TESTS 19 592 24371200 1800
23106095 Ortsb E Dec. 18, 2016, 2 p.m. OK Python 3 TESTS 19 763 44544000 1800
26906826 ASoboll E May 6, 2017, 5:22 p.m. OK Scala TESTS 19 873 36864000 1800

remove filters

Back to search problems