Codeforces Round 611 (Div. 3)

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
1283 Codeforces Round 611 (Div. 3) FINISHED False 7200 154270499 Dec. 28, 2019, 5:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13195 ) C Friends and Gifts PROGRAMMING constructive algorithms data structures math 1500

B"There are n friends who want to give gifts for the New Year to each other. Each friend should give exactly one gift and receive exactly one gift. The friend cannot give the gift to himself. For each friend the value f_i is known: it is either f_i = 0 if the i -th friend doesn't know whom he wants to give the gift to or 1 <= f_i <= n if the i -th friend wants to give the gift to the friend f_i . You want to fill in the unknown values ( f_i = 0 ) in such a way that each friend gives exactly one gift and receives exactly one gift and there is no friend who gives the gift to himself. It is guaranteed that the initial information isn't contradictory. If there are several answers, you can print any. The first line of the input contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of friends. The second line of the input contains n integers f_1, f_2, ... , f_n ( 0 <= f_i <= n , f_i ne i , all f_i ne 0 are distinct), where f_i is the either f_i = 0 if the i -th friend doesn't know whom he wants to give the gift to or 1 <= f_i <= n if the i -th friend wants to give the gift to the friend f_i . It is also guaranteed that there is at least two values f_i = 0 . Print n integers nf_1, nf_2, ... , nf_n , where nf_i should be equal to f_i if f_i ne 0 or the number of friend whom the i -th friend wants to give the gift to. All values nf_i should be distinct, nf_i cannot be equal to i . Each friend gives exactly one gift and receives exactly one gift and there is no friend who gives the gift to himself. If there are several answers, you can print any. "...

Tutorials

Codeforces Round #611 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68830305 bemandrei C Jan. 14, 2020, 9:38 p.m. OK Clang++17 Diagnostics TESTS 195 1544 19865600 1500
67990414 clrcldy C Dec. 31, 2019, 4:16 a.m. OK Clang++17 Diagnostics TESTS 195 1621 18841600 1500
67989780 clrcldy C Dec. 31, 2019, 3:31 a.m. OK Clang++17 Diagnostics TESTS 195 1684 18841600 1500
67854730 ruban C Dec. 29, 2019, 5:33 a.m. OK Delphi TESTS 195 109 49049600 1500
67840434 ImanKz C Dec. 28, 2019, 7:25 p.m. OK Delphi TESTS 195 139 4403200 1500
68695523 chaorenhaha C Jan. 13, 2020, 7:47 a.m. OK FPC TESTS 195 623 8294400 1500
67813836 LaSWeeG C Dec. 28, 2019, 5:37 p.m. OK FPC TESTS 195 639 5017600 1500
68695476 chaorenhaha C Jan. 13, 2020, 7:46 a.m. OK FPC TESTS 195 639 16281600 1500
68109904 BBC5555 C Jan. 3, 2020, 9:05 a.m. OK FPC TESTS 195 654 3174400 1500
68869055 UUUnmei C Jan. 15, 2020, 2:32 p.m. OK GNU C11 TESTS 195 702 2457600 1500
68155304 kshiteshkasaraneni C Jan. 4, 2020, 8:44 a.m. OK GNU C11 TESTS 195 702 7987200 1500
68215268 Iizshit C Jan. 4, 2020, 10:24 p.m. OK GNU C11 TESTS 195 717 2355200 1500
67809607 pengin_2000 C Dec. 28, 2019, 5:25 p.m. OK GNU C11 TESTS 195 717 2355200 1500
67833661 Cavetr C Dec. 28, 2019, 6:48 p.m. OK GNU C11 TESTS 195 717 2457600 1500
67831198 Poppolino C Dec. 28, 2019, 6:38 p.m. OK GNU C11 TESTS 195 717 2457600 1500
68226862 lishb C Jan. 5, 2020, 7:31 a.m. OK GNU C11 TESTS 195 717 3174400 1500
67868207 Draxster99 C Dec. 29, 2019, 10:26 a.m. OK GNU C11 TESTS 195 717 4812800 1500
68441894 vjudge4 C Jan. 9, 2020, 11:14 a.m. OK GNU C11 TESTS 195 717 6041600 1500
68105596 Piccacu C Jan. 3, 2020, 6:52 a.m. OK GNU C11 TESTS 195 717 10444800 1500
67834299 Rose__ C Dec. 28, 2019, 6:51 p.m. OK GNU C++11 TESTS 195 46 2662400 1500
68084705 Alan_zhou C Jan. 2, 2020, 3:46 p.m. OK GNU C++11 TESTS 195 61 3686400 1500
67850245 DariusOrz C Dec. 29, 2019, 2:17 a.m. OK GNU C++11 TESTS 195 61 8908800 1500
69295438 wasa855 C Jan. 22, 2020, 12:02 p.m. OK GNU C++11 TESTS 195 62 2969600 1500
68743415 Cure_zero C Jan. 14, 2020, 2:56 a.m. OK GNU C++11 TESTS 195 62 3276800 1500
67962714 yaozilong C Dec. 30, 2019, 12:12 p.m. OK GNU C++11 TESTS 195 62 3379200 1500
67962773 yaozilong C Dec. 30, 2019, 12:13 p.m. OK GNU C++11 TESTS 195 62 3379200 1500
69557316 luogu_bot5 C Jan. 26, 2020, 9:19 a.m. OK GNU C++11 TESTS 195 62 3686400 1500
69217298 cornivores C Jan. 21, 2020, 2:02 a.m. OK GNU C++11 TESTS 195 62 4198400 1500
69226767 Leidaxxb C Jan. 21, 2020, 7:36 a.m. OK GNU C++11 TESTS 195 62 5324800 1500
67932030 Linkus C Dec. 29, 2019, 6:22 p.m. OK GNU C++14 TESTS 195 62 2048000 1500
67931344 epsilon_573 C Dec. 29, 2019, 6:07 p.m. OK GNU C++14 TESTS 195 93 819200 1500
67988817 tmt514 C Dec. 31, 2019, 2:26 a.m. OK GNU C++14 TESTS 195 93 1638400 1500
67999391 EvGen1u5 C Dec. 31, 2019, 9:58 a.m. OK GNU C++14 TESTS 195 93 1638400 1500
68433316 vjudge5 C Jan. 9, 2020, 7:53 a.m. OK GNU C++14 TESTS 195 93 1638400 1500
68551066 kkongas C Jan. 10, 2020, 4:11 p.m. OK GNU C++14 TESTS 195 93 1638400 1500
67819545 Lizzy- C Dec. 28, 2019, 5:54 p.m. OK GNU C++14 TESTS 195 93 1740800 1500
67825388 amir_altakroori C Dec. 28, 2019, 6:15 p.m. OK GNU C++14 TESTS 195 93 1843200 1500
68238124 tichnas C Jan. 5, 2020, 11:46 a.m. OK GNU C++14 TESTS 195 93 1843200 1500
68139282 Sadik_1603075 C Jan. 3, 2020, 8:50 p.m. OK GNU C++14 TESTS 195 93 2048000 1500
68150228 jame0313 C Jan. 4, 2020, 6:35 a.m. OK GNU C++17 TESTS 195 78 3174400 1500
69057076 risk_17 C Jan. 18, 2020, 2:56 p.m. OK GNU C++17 TESTS 195 92 2457600 1500
67815578 darth_coder C Dec. 28, 2019, 5:42 p.m. OK GNU C++17 TESTS 195 93 1024000 1500
67981480 BruteForce C Dec. 30, 2019, 7:32 p.m. OK GNU C++17 TESTS 195 93 1638400 1500
67868210 danilseal C Dec. 29, 2019, 10:26 a.m. OK GNU C++17 TESTS 195 93 1638400 1500
67971815 magisk C Dec. 30, 2019, 3:19 p.m. OK GNU C++17 TESTS 195 93 1740800 1500
68677879 EsmaelSY C Jan. 12, 2020, 7:37 p.m. OK GNU C++17 TESTS 195 93 1843200 1500
67825603 yojka27 C Dec. 28, 2019, 6:16 p.m. OK GNU C++17 TESTS 195 93 1843200 1500
68737886 Pipaoo Huglio C Jan. 13, 2020, 9:29 p.m. OK GNU C++17 TESTS 195 93 1843200 1500
67980308 Anand619 C Dec. 30, 2019, 6:53 p.m. OK GNU C++17 TESTS 195 93 1843200 1500
68044057 Taube C Jan. 1, 2020, 3:38 p.m. OK Go TESTS 195 171 4505600 1500
67835861 godsdice C Dec. 28, 2019, 6:57 p.m. OK Go TESTS 195 186 30208000 1500
67855263 justcode_fk C Dec. 29, 2019, 5:48 a.m. OK Go TESTS 195 733 5324800 1500
67854754 justcode_fk C Dec. 29, 2019, 5:34 a.m. OK Go TESTS 195 764 18739200 1500
68626594 collares C Jan. 11, 2020, 10:29 p.m. OK Haskell TESTS 195 592 75673600 1500
68627401 collares C Jan. 11, 2020, 11:27 p.m. OK Haskell TESTS 195 608 75673600 1500
68627224 collares C Jan. 11, 2020, 11:13 p.m. OK Haskell TESTS 195 623 75673600 1500
68627169 collares C Jan. 11, 2020, 11:10 p.m. OK Haskell TESTS 195 795 75776000 1500
68627186 collares C Jan. 11, 2020, 11:11 p.m. OK Haskell TESTS 195 811 75673600 1500
68160086 liesen C Jan. 4, 2020, 10:30 a.m. OK Haskell TESTS 195 1075 196608000 1500
67986005 MaxHeap C Dec. 30, 2019, 10:45 p.m. OK Java 11 TESTS 195 218 4198400 1500
67822304 avijit_agarwal C Dec. 28, 2019, 6:04 p.m. OK Java 11 TESTS 195 233 2662400 1500
68052253 about C Jan. 1, 2020, 7:33 p.m. OK Java 11 TESTS 195 265 0 1500
67844488 ZxCv C Dec. 28, 2019, 8:49 p.m. OK Java 11 TESTS 195 265 2662400 1500
67854358 oneluckyday C Dec. 29, 2019, 5:21 a.m. OK Java 11 TESTS 195 265 2662400 1500
67848496 nqs_1 C Dec. 29, 2019, 12:04 a.m. OK Java 11 TESTS 195 265 2662400 1500
67820240 ankyy_0103 C Dec. 28, 2019, 5:57 p.m. OK Java 11 TESTS 195 280 1945600 1500
67873340 ragnar7 C Dec. 29, 2019, 12:21 p.m. OK Java 11 TESTS 195 280 11673600 1500
67810103 lightseba C Dec. 28, 2019, 5:26 p.m. OK Java 11 TESTS 195 296 3584000 1500
68173667 kukreja-vlk C Jan. 4, 2020, 12:28 p.m. OK Java 11 TESTS 195 296 8396800 1500
67857308 bluesky111 C Dec. 29, 2019, 6:38 a.m. OK Java 8 TESTS 195 155 2764800 1500
67874681 luchy0120 C Dec. 29, 2019, 12:50 p.m. OK Java 8 TESTS 195 171 0 1500
67843749 Sharon C Dec. 28, 2019, 8:28 p.m. OK Java 8 TESTS 195 171 0 1500
68226499 bwang1008 C Jan. 5, 2020, 7:22 a.m. OK Java 8 TESTS 195 171 3686400 1500
68232942 johnny16 C Jan. 5, 2020, 9:53 a.m. OK Java 8 TESTS 195 171 4608000 1500
68139180 asafiul C Jan. 3, 2020, 8:46 p.m. OK Java 8 TESTS 195 186 2969600 1500
67852009 mufaddalnaya C Dec. 29, 2019, 3:51 a.m. OK Java 8 TESTS 195 186 2969600 1500
67849191 gouh9qn C Dec. 29, 2019, 1:03 a.m. OK Java 8 TESTS 195 186 2969600 1500
67823890 SnowGoose C Dec. 28, 2019, 6:09 p.m. OK Java 8 TESTS 195 186 4608000 1500
67935078 jenil1999 C Dec. 29, 2019, 7:46 p.m. OK Java 8 TESTS 195 186 5939200 1500
68232644 areyousure C Jan. 5, 2020, 9:47 a.m. OK JavaScript TESTS 195 171 31027200 1500
69243338 walborn C Jan. 21, 2020, 12:09 p.m. OK JavaScript TESTS 195 249 38092800 1500
69242403 walborn C Jan. 21, 2020, 11:50 a.m. OK JavaScript TESTS 195 312 55193600 1500
67822992 avm C Dec. 28, 2019, 6:06 p.m. OK Kotlin TESTS 195 171 5734400 1500
67945928 Spheniscine C Dec. 30, 2019, 5:16 a.m. OK Kotlin TESTS 195 218 9318400 1500
68097754 slemus C Jan. 2, 2020, 10:22 p.m. OK Kotlin TESTS 195 311 12902400 1500
67825939 Differum C Dec. 28, 2019, 6:17 p.m. OK Kotlin TESTS 195 358 19046400 1500
67850233 MagentaArtist C Dec. 29, 2019, 2:16 a.m. OK Kotlin TESTS 195 467 27136000 1500
67807336 Kenb C Dec. 28, 2019, 5:20 p.m. OK Kotlin TESTS 195 467 27136000 1500
67816007 cmplx-xyttmt C Dec. 28, 2019, 5:43 p.m. OK Kotlin TESTS 195 482 35020800 1500
67829607 Glushen C Dec. 28, 2019, 6:31 p.m. OK Kotlin TESTS 195 483 31027200 1500
67874890 Darui99 C Dec. 29, 2019, 12:54 p.m. OK Kotlin TESTS 195 1169 17817600 1500
69283459 mban259 C Jan. 22, 2020, 7:04 a.m. OK Mono C# TESTS 195 155 28979200 1500
67820638 riantkb C Dec. 28, 2019, 5:58 p.m. OK Mono C# TESTS 195 155 38912000 1500
69420890 sakapon C Jan. 23, 2020, 2:22 p.m. OK Mono C# TESTS 195 187 46080000 1500
67844953 KarVan44 C Dec. 28, 2019, 9:02 p.m. OK Mono C# TESTS 195 202 38297600 1500
67827408 IlyaCk C Dec. 28, 2019, 6:23 p.m. OK Mono C# TESTS 195 202 38297600 1500
67809378 keymoon C Dec. 28, 2019, 5:24 p.m. OK Mono C# TESTS 195 218 32870400 1500
68258150 Maks95Ivanovo C Jan. 5, 2020, 2:43 p.m. OK Mono C# TESTS 195 390 27033600 1500
67995993 nadilk C Dec. 31, 2019, 8:09 a.m. OK Mono C# TESTS 195 748 48435200 1500
68833153 vjudge3 C Jan. 15, 2020, 12:45 a.m. OK MS C++ TESTS 195 93 2457600 1500
68743166 vjudge4 C Jan. 14, 2020, 2:46 a.m. OK MS C++ TESTS 195 93 2457600 1500
68295818 vjudge2 C Jan. 6, 2020, 2:36 a.m. OK MS C++ TESTS 195 93 3174400 1500
68637604 rures C Jan. 12, 2020, 6:25 a.m. OK MS C++ TESTS 195 93 3379200 1500
69283760 vjudge2 C Jan. 22, 2020, 7:12 a.m. OK MS C++ TESTS 195 93 4300800 1500
68836899 vjudge4 C Jan. 15, 2020, 3:44 a.m. OK MS C++ TESTS 195 93 7987200 1500
68855001 vjudge4 C Jan. 15, 2020, 10:18 a.m. OK MS C++ TESTS 195 108 2969600 1500
68892092 vjudge3 C Jan. 16, 2020, 2:47 a.m. OK MS C++ TESTS 195 109 2662400 1500
68471155 vjudge4 C Jan. 10, 2020, 1:48 a.m. OK MS C++ TESTS 195 156 3993600 1500
68690080 vjudge5 C Jan. 13, 2020, 5:42 a.m. OK MS C++ TESTS 195 187 3174400 1500
69277740 sbwww C Jan. 22, 2020, 3:44 a.m. OK MS C++ 2017 TESTS 195 109 24064000 1500
67817243 IronArt C Dec. 28, 2019, 5:47 p.m. OK MS C++ 2017 TESTS 195 124 1638400 1500
67813703 youx C Dec. 28, 2019, 5:36 p.m. OK MS C++ 2017 TESTS 195 124 2457600 1500
68849603 vjudge1 C Jan. 15, 2020, 8:31 a.m. OK MS C++ 2017 TESTS 195 124 2662400 1500
67828501 ddh C Dec. 28, 2019, 6:27 p.m. OK MS C++ 2017 TESTS 195 124 2662400 1500
67868832 Tangerine C Dec. 29, 2019, 10:40 a.m. OK MS C++ 2017 TESTS 195 124 3174400 1500
68401725 DR.Salieri C Jan. 8, 2020, 1:25 p.m. OK MS C++ 2017 TESTS 195 124 3174400 1500
68852698 vjudge5 C Jan. 15, 2020, 9:34 a.m. OK MS C++ 2017 TESTS 195 124 3379200 1500
67825813 hack2kong C Dec. 28, 2019, 6:17 p.m. OK MS C++ 2017 TESTS 195 124 3379200 1500
67863958 zialy C Dec. 29, 2019, 9:05 a.m. OK MS C++ 2017 TESTS 195 124 3584000 1500
68119305 Mandalorec C Jan. 3, 2020, 12:40 p.m. OK PascalABC.NET TESTS 195 1669 2355200 1500
67848658 evgeny.poloznov C Dec. 29, 2019, 12:18 a.m. OK PHP TESTS 195 108 43724800 1500
67936232 mayakin C Dec. 29, 2019, 8:25 p.m. OK PHP TESTS 195 249 48332800 1500
67872315 Kiral55 C Dec. 29, 2019, 11:58 a.m. OK PHP TESTS 195 764 26931200 1500
67860601 raj1307 C Dec. 29, 2019, 8:02 a.m. OK PyPy 2 TESTS 195 202 19046400 1500
67818952 _kawaii_neko_ C Dec. 28, 2019, 5:52 p.m. OK PyPy 2 TESTS 195 217 16384000 1500
67956037 jolt.tks C Dec. 30, 2019, 9:41 a.m. OK PyPy 2 TESTS 195 218 15667200 1500
67809319 pajenegod C Dec. 28, 2019, 5:24 p.m. OK PyPy 2 TESTS 195 233 19763200 1500
68152258 MVP C Jan. 4, 2020, 7:24 a.m. OK PyPy 2 TESTS 195 249 17100800 1500
67811618 pa.n.ik C Dec. 28, 2019, 5:30 p.m. OK PyPy 2 TESTS 195 249 23040000 1500
68571955 ezboi C Jan. 11, 2020, 2:50 a.m. OK PyPy 2 TESTS 195 327 30822400 1500
67842193 c1729 C Dec. 28, 2019, 7:53 p.m. OK PyPy 2 TESTS 195 421 28160000 1500
67848217 SoSooding C Dec. 28, 2019, 11:41 p.m. OK PyPy 2 TESTS 195 436 18022400 1500
67810246 SoSooding C Dec. 28, 2019, 5:26 p.m. OK PyPy 2 TESTS 195 483 16588800 1500
67814304 Mukundan314 C Dec. 28, 2019, 5:38 p.m. OK PyPy 3 TESTS 195 249 22528000 1500
67816473 FLOP C Dec. 28, 2019, 5:44 p.m. OK PyPy 3 TESTS 195 342 24473600 1500
68968096 ilya67-67 C Jan. 17, 2020, 5:56 a.m. OK PyPy 3 TESTS 195 373 21196800 1500
67834193 le_michael C Dec. 28, 2019, 6:51 p.m. OK PyPy 3 TESTS 195 374 20275200 1500
68972918 bez_ru C Jan. 17, 2020, 7:42 a.m. OK PyPy 3 TESTS 195 374 21094400 1500
68053923 siyy C Jan. 1, 2020, 8:40 p.m. OK PyPy 3 TESTS 195 374 21606400 1500
68079025 Affe C Jan. 2, 2020, 1:41 p.m. OK PyPy 3 TESTS 195 374 25600000 1500
68669581 densvedberg C Jan. 12, 2020, 4:22 p.m. OK PyPy 3 TESTS 195 374 27033600 1500
68682284 Leendertz C Jan. 12, 2020, 11:54 p.m. OK PyPy 3 TESTS 195 374 31846400 1500
68003737 golfbaby C Dec. 31, 2019, 12:09 p.m. OK PyPy 3 TESTS 195 374 31948800 1500
67823153 grayGoose C Dec. 28, 2019, 6:07 p.m. OK Python 2 TESTS 195 451 29593600 1500
67909494 soumyasarkar1998 C Dec. 29, 2019, 3:19 p.m. OK Python 2 TESTS 195 467 23756800 1500
68300683 hooded_sweater C Jan. 6, 2020, 6:22 a.m. OK Python 2 TESTS 195 483 20889600 1500
67819852 nifengfly C Dec. 28, 2019, 5:55 p.m. OK Python 2 TESTS 195 576 27955200 1500
67866933 anonymous0314 C Dec. 29, 2019, 10 a.m. OK Python 2 TESTS 195 577 12800000 1500
67861405 sarthakmanna C Dec. 29, 2019, 8:17 a.m. OK Python 2 TESTS 195 638 20480000 1500
67831830 sarthakmanna C Dec. 28, 2019, 6:41 p.m. OK Python 2 TESTS 195 685 20070400 1500
67832203 sarthakmanna C Dec. 28, 2019, 6:42 p.m. OK Python 2 TESTS 195 748 11059200 1500
67854351 pizza_hut C Dec. 29, 2019, 5:21 a.m. OK Python 2 TESTS 195 1029 11059200 1500
68397501 Jyunpp C Jan. 8, 2020, 11:44 a.m. OK Python 2 TESTS 195 1091 11059200 1500
68010805 zhu_ark C Dec. 31, 2019, 3:40 p.m. OK Python 3 TESTS 195 311 19558400 1500
68061181 Gigachad69 C Jan. 2, 2020, 4:09 a.m. OK Python 3 TESTS 195 342 19456000 1500
67812942 r57shell C Dec. 28, 2019, 5:34 p.m. OK Python 3 TESTS 195 358 23347200 1500
68029349 Cloverr_ C Jan. 1, 2020, 8:12 a.m. OK Python 3 TESTS 195 373 18329600 1500
68049474 Gikinet C Jan. 1, 2020, 6:04 p.m. OK Python 3 TESTS 195 374 27545600 1500
68470363 BobMcDear C Jan. 10, 2020, 12:56 a.m. OK Python 3 TESTS 195 389 15052800 1500
68029504 Cloverr_ C Jan. 1, 2020, 8:19 a.m. OK Python 3 TESTS 195 389 18636800 1500
69210604 BrunoAleixo2000 C Jan. 20, 2020, 7:50 p.m. OK Python 3 TESTS 195 389 28160000 1500
68028962 Cloverr_ C Jan. 1, 2020, 7:57 a.m. OK Python 3 TESTS 195 405 18329600 1500
68163239 Annvv C Jan. 4, 2020, 11:47 a.m. OK Python 3 TESTS 195 405 19456000 1500
67831379 majali C Dec. 28, 2019, 6:39 p.m. OK Ruby TESTS 195 311 30208000 1500
67834567 old_boo C Dec. 28, 2019, 6:52 p.m. OK Ruby TESTS 195 561 51404800 1500
69288417 nemi_zzz C Jan. 22, 2020, 9:12 a.m. OK Ruby TESTS 195 1434 27955200 1500
69226601 sansen C Jan. 21, 2020, 7:32 a.m. OK Rust TESTS 195 78 7577600 1500
68106267 xavier13540 C Jan. 3, 2020, 7:13 a.m. OK Rust TESTS 195 93 6348800 1500
68114572 motoras C Jan. 3, 2020, 10:56 a.m. OK Rust TESTS 195 93 13516800 1500
68122214 motoras C Jan. 3, 2020, 1:45 p.m. OK Rust TESTS 195 109 13516800 1500
68031023 reldan C Jan. 1, 2020, 9:17 a.m. OK Scala TESTS 195 686 14848000 1500

remove filters

Back to search problems