Codeforces Round 605 (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
1272 Codeforces Round 605 (Div. 3) FINISHED False 7200 161022263 Dec. 12, 2019, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20990 ) A Three Friends PROGRAMMING brute force greedy math sortings 900

B"Three friends are going to meet each other. Initially, the first friend stays at the position x = a , the second friend stays at the position x = b and the third friend stays at the position x = c on the coordinate axis Ox . In one minute each friend independently from other friends can change the position x by 1 to the left or by 1 to the right (i.e. set x := x - 1 or x := x + 1 ) or even don't change it. Let's introduce the total pairwise distance -- the sum of distances between each pair of friends. Let a' , b' and c' be the final positions of the first, the second and the third friend, correspondingly. Then the total pairwise distance is |a' - b'| + |a' - c'| + |b' - c'| , where |x| is the absolute value of x . Friends are interested in the minimum total pairwise distance they can reach if they will move optimally. Each friend will move no more than once. So, more formally, they want to know the minimum total pairwise distance they can reach after one minute. You have to answer q independent test cases. The first line of the input contains one integer q ( 1 <= q <= 1000 ) -- the number of test cases. The next q lines describe test cases. The i -th test case is given as three integers a, b and c ( 1 <= a, b, c <= 10^9 ) -- initial positions of the first, second and third friend correspondingly. The positions of friends can be equal. For each test case print the answer on it -- the minimum total pairwise distance (the minimum sum of distances between each pair of friends) if friends change their positions optimally. Each friend will move no more than once. So, more formally, you have to find the minimum total pairwise distance they can reach after one minute. "...

Tutorials

Codeforces Round #605 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66823905 NF_Erturk A Dec. 14, 2019, 8:18 a.m. OK Clang++17 Diagnostics TESTS 4 46 0 900
69027190 541907010414 A Jan. 18, 2020, 7:26 a.m. OK Clang++17 Diagnostics TESTS 4 46 0 900
66832730 arthur_08 A Dec. 14, 2019, 10:49 a.m. OK Clang++17 Diagnostics TESTS 4 46 0 900
67205882 Dariush_M A Dec. 19, 2019, 12:25 p.m. OK Clang++17 Diagnostics TESTS 4 61 0 900
67769346 J01435K A Dec. 28, 2019, 6:02 a.m. OK Clang++17 Diagnostics TESTS 4 61 0 900
67380782 Wastrez A Dec. 21, 2019, 4:19 p.m. OK Delphi TESTS 4 30 0 900
67580596 DyniD akshita_jindal A Dec. 25, 2019, 5:50 a.m. OK GNU C11 TESTS 4 15 0 900
69014096 vjudge2 A Jan. 18, 2020, 4:45 a.m. OK GNU C11 TESTS 4 15 0 900
68963850 Heisenberg_41 A Jan. 17, 2020, 3:25 a.m. OK GNU C11 TESTS 4 15 0 900
68415380 Mrg_41 A Jan. 8, 2020, 6:39 p.m. OK GNU C11 TESTS 4 15 0 900
67793582 kshiteshkasaraneni A Dec. 28, 2019, 3:36 p.m. OK GNU C11 TESTS 4 15 0 900
67785689 saumensd A Dec. 28, 2019, 12:40 p.m. OK GNU C11 TESTS 4 15 0 900
67785315 Dhruv2506 A Dec. 28, 2019, 12:31 p.m. OK GNU C11 TESTS 4 15 0 900
69659428 vp7070573 A Jan. 28, 2020, 8:49 a.m. OK GNU C11 TESTS 4 15 0 900
69255293 return_z A Jan. 21, 2020, 3:28 p.m. OK GNU C11 TESTS 4 15 0 900
69224359 vjudge1 A Jan. 21, 2020, 6:27 a.m. OK GNU C11 TESTS 4 15 0 900
69565218 vjudge5 A Jan. 26, 2020, 12:10 p.m. OK GNU C++11 TESTS 4 15 0 900
69476375 Muntaha A Jan. 24, 2020, 4:18 p.m. OK GNU C++11 TESTS 4 15 0 900
69481453 Rohan_mittal A Jan. 24, 2020, 5:54 p.m. OK GNU C++11 TESTS 4 15 0 900
69550893 xxqiam A Jan. 26, 2020, 6:23 a.m. OK GNU C++11 TESTS 4 15 0 900
69882805 Kemmis A Jan. 31, 2020, 7:01 a.m. OK GNU C++11 TESTS 4 15 0 900
69837509 flafi A Jan. 30, 2020, 12:14 p.m. OK GNU C++11 TESTS 4 15 0 900
69814574 arafatsuunny360 A Jan. 30, 2020, 5:42 a.m. OK GNU C++11 TESTS 4 15 0 900
69807082 longxiaokong A Jan. 30, 2020, 2:29 a.m. OK GNU C++11 TESTS 4 15 0 900
69603249 vjudge4 A Jan. 27, 2020, 8:41 a.m. OK GNU C++11 TESTS 4 15 0 900
69565300 vjudge1 A Jan. 26, 2020, 12:12 p.m. OK GNU C++11 TESTS 4 15 0 900
66726696 NSei A Dec. 12, 2019, 4:15 p.m. OK GNU C++14 TESTS 4 0 0 900
69932865 haizhe A Feb. 1, 2020, 1:33 a.m. OK GNU C++14 TESTS 4 15 0 900
69867511 siletWorker A Jan. 30, 2020, 9:13 p.m. OK GNU C++14 TESTS 4 15 0 900
69883832 durano A Jan. 31, 2020, 7:25 a.m. OK GNU C++14 TESTS 4 15 0 900
69886164 ngvan1612 A Jan. 31, 2020, 8:17 a.m. OK GNU C++14 TESTS 4 15 0 900
69804832 Timer_011 A Jan. 30, 2020, 1:05 a.m. OK GNU C++14 TESTS 4 15 0 900
69831820 yousseflagtab A Jan. 30, 2020, 10:43 a.m. OK GNU C++14 TESTS 4 15 0 900
69849243 tsiwant A Jan. 30, 2020, 3:08 p.m. OK GNU C++14 TESTS 4 15 0 900
69851991 Dpcoder_007 A Jan. 30, 2020, 3:54 p.m. OK GNU C++14 TESTS 4 15 0 900
69852703 rafinrabbi A Jan. 30, 2020, 4:06 p.m. OK GNU C++14 TESTS 4 15 0 900
66975886 talant110726 A Dec. 15, 2019, 2:41 p.m. OK GNU C++17 TESTS 4 0 0 900
69276471 NusratPrity A Jan. 22, 2020, 2:34 a.m. OK GNU C++17 TESTS 4 0 0 900
67945987 personnon A Dec. 30, 2019, 5:18 a.m. OK GNU C++17 TESTS 4 0 0 900
69943135 V3n0mBiceps A Feb. 1, 2020, 6:46 a.m. OK GNU C++17 TESTS 4 15 0 900
69929683 Charizard01 A Jan. 31, 2020, 10:41 p.m. OK GNU C++17 TESTS 4 15 0 900
69916782 Vrikodara A Jan. 31, 2020, 5:06 p.m. OK GNU C++17 TESTS 4 15 0 900
69911319 Ahsan_Lasa A Jan. 31, 2020, 3:27 p.m. OK GNU C++17 TESTS 4 15 0 900
69899414 DDDoimate A Jan. 31, 2020, 12:38 p.m. OK GNU C++17 TESTS 4 15 0 900
69898536 kgcurry59 A Jan. 31, 2020, 12:25 p.m. OK GNU C++17 TESTS 4 15 0 900
69894773 STL_CC A Jan. 31, 2020, 11:23 a.m. OK GNU C++17 TESTS 4 15 0 900
66729540 njkevlani A Dec. 12, 2019, 5:03 p.m. OK Go TESTS 4 15 0 900
68365254 ktateish A Jan. 7, 2020, 3:42 p.m. OK Go TESTS 4 30 0 900
66830832 pain_nagato A Dec. 14, 2019, 10:08 a.m. OK Go TESTS 4 30 0 900
66811213 sighduck A Dec. 14, 2019, 2:38 a.m. OK Go TESTS 4 30 0 900
67255162 Kaper A Dec. 19, 2019, 9:28 p.m. OK Go TESTS 4 124 0 900
66793885 Laurens A Dec. 13, 2019, 4:17 p.m. OK Haskell TESTS 4 31 102400 900
67065174 ankyy_0103 A Dec. 17, 2019, 10:49 a.m. OK Java 11 TESTS 4 155 0 900
66794528 serafimkoo A Dec. 13, 2019, 4:32 p.m. OK Java 11 TESTS 4 155 0 900
67035919 nik77kez A Dec. 16, 2019, 5:23 p.m. OK Java 11 TESTS 4 170 0 900
67477468 MaxHeap A Dec. 23, 2019, 2:49 p.m. OK Java 11 TESTS 4 171 0 900
66991316 Anonymous A Dec. 15, 2019, 8:36 p.m. OK Java 11 TESTS 4 171 0 900
67186351 Tarun27 A Dec. 19, 2019, 4:56 a.m. OK Java 11 TESTS 4 186 0 900
66870747 vmg152 A Dec. 14, 2019, 1:39 p.m. OK Java 11 TESTS 4 186 0 900
67967768 doroshenkoeng A Dec. 30, 2019, 1:55 p.m. OK Java 11 TESTS 4 187 0 900
68091222 Ayushdongre04 A Jan. 2, 2020, 6:14 p.m. OK Java 11 TESTS 4 202 0 900
67316174 kukreja-vlk A Dec. 21, 2019, 6:07 a.m. OK Java 11 TESTS 4 202 0 900
69288757 pbabu_puram A Jan. 22, 2020, 9:19 a.m. OK Java 8 TESTS 4 93 0 900
68590628 Modi_sarkar A Jan. 11, 2020, 12:33 p.m. OK Java 8 TESTS 4 93 0 900
68437536 Bhavya_Arora A Jan. 9, 2020, 9:33 a.m. OK Java 8 TESTS 4 93 0 900
67983586 nopre A Dec. 30, 2019, 8:43 p.m. OK Java 8 TESTS 4 93 0 900
67956805 thisbeit A Dec. 30, 2019, 9:58 a.m. OK Java 8 TESTS 4 93 0 900
67038037 trillionaire A Dec. 16, 2019, 6:06 p.m. OK Java 8 TESTS 4 93 0 900
67036469 LightYagami674 A Dec. 16, 2019, 5:33 p.m. OK Java 8 TESTS 4 93 0 900
67015694 procrastinate7 A Dec. 16, 2019, 11:25 a.m. OK Java 8 TESTS 4 93 0 900
66800030 flyingpurplepeopleeater A Dec. 13, 2019, 6:24 p.m. OK Java 8 TESTS 4 93 0 900
66740146 icpc_loser A Dec. 12, 2019, 8:17 p.m. OK Java 8 TESTS 4 93 0 900
69285634 Nobita_Noobie A Jan. 22, 2020, 8:02 a.m. OK JavaScript TESTS 4 31 1228800 900
69671181 formalist A Jan. 28, 2020, 1:03 p.m. OK Kotlin TESTS 4 108 0 900
68221886 I.A.K.O.V A Jan. 5, 2020, 5:17 a.m. OK Kotlin TESTS 4 108 0 900
66763497 shenqi16 A Dec. 13, 2019, 7:25 a.m. OK Kotlin TESTS 4 124 0 900
68427633 Rainyday_and_Raindrop A Jan. 9, 2020, 4:53 a.m. OK Kotlin TESTS 4 140 0 900
69918488 h__h A Jan. 31, 2020, 5:38 p.m. OK Kotlin TESTS 4 140 0 900
66717643 ec24 A Dec. 12, 2019, 3:18 p.m. OK Kotlin TESTS 4 155 204800 900
66745673 Spheniscine A Dec. 13, 2019, 1:57 a.m. OK Kotlin TESTS 4 156 512000 900
67288465 stepanovep A Dec. 20, 2019, 2:55 p.m. OK Kotlin TESTS 4 170 614400 900
68155504 abdurauf1997 A Jan. 4, 2020, 8:48 a.m. OK Kotlin TESTS 4 171 0 900
68456993 david_varela A Jan. 9, 2020, 4:37 p.m. OK Kotlin TESTS 4 171 1228800 900
66784307 ansergeyg A Dec. 13, 2019, 1:07 p.m. OK Mono C# TESTS 4 30 307200 900
66783060 ansergeyg A Dec. 13, 2019, 12:42 p.m. OK Mono C# TESTS 4 31 307200 900
66782675 ansergeyg A Dec. 13, 2019, 12:35 p.m. OK Mono C# TESTS 4 46 307200 900
66781380 ansergeyg A Dec. 13, 2019, 12:08 p.m. OK Mono C# TESTS 4 46 307200 900
69551632 m1_k3 A Jan. 26, 2020, 6:46 a.m. OK Mono C# TESTS 4 46 307200 900
68101697 marucas76 A Jan. 3, 2020, 3:44 a.m. OK Mono C# TESTS 4 46 307200 900
66820500 DiMaG2188 A Dec. 14, 2019, 7:16 a.m. OK Mono C# TESTS 4 46 307200 900
66792125 sevimlikedicik A Dec. 13, 2019, 3:39 p.m. OK Mono C# TESTS 4 46 307200 900
66783399 ansergeyg A Dec. 13, 2019, 12:48 p.m. OK Mono C# TESTS 4 46 307200 900
66783045 ansergeyg A Dec. 13, 2019, 12:41 p.m. OK Mono C# TESTS 4 46 307200 900
69277794 vjudge3 A Jan. 22, 2020, 3:47 a.m. OK MS C++ TESTS 4 0 0 900
69162771 vjudge5 A Jan. 20, 2020, 1:31 a.m. OK MS C++ TESTS 4 15 0 900
69091594 vjudge1 A Jan. 19, 2020, 10:22 a.m. OK MS C++ TESTS 4 15 0 900
69074608 vjudge3 A Jan. 19, 2020, 2 a.m. OK MS C++ TESTS 4 15 0 900
69015029 vjudge3 A Jan. 18, 2020, 5:02 a.m. OK MS C++ TESTS 4 15 0 900
69012454 vjudge1 A Jan. 18, 2020, 4:14 a.m. OK MS C++ TESTS 4 15 0 900
69012284 vjudge2 A Jan. 18, 2020, 4:11 a.m. OK MS C++ TESTS 4 15 0 900
69707854 vjudge1 A Jan. 29, 2020, 5:38 a.m. OK MS C++ TESTS 4 15 0 900
69335198 vjudge3 A Jan. 22, 2020, 3:21 p.m. OK MS C++ TESTS 4 15 0 900
69218001 seh631638554 A Jan. 21, 2020, 2:34 a.m. OK MS C++ TESTS 4 15 0 900
69281172 sbwww A Jan. 22, 2020, 6 a.m. OK MS C++ 2017 TESTS 4 15 0 900
69853392 vjudge5 A Jan. 30, 2020, 4:17 p.m. OK MS C++ 2017 TESTS 4 15 0 900
69813233 vjudge1 A Jan. 30, 2020, 5:13 a.m. OK MS C++ 2017 TESTS 4 15 0 900
69391454 vjudge1 A Jan. 23, 2020, 3:57 a.m. OK MS C++ 2017 TESTS 4 15 0 900
68838983 vjudge2 A Jan. 15, 2020, 4:54 a.m. OK MS C++ 2017 TESTS 4 15 0 900
68706767 ab1110 A Jan. 13, 2020, 11:36 a.m. OK MS C++ 2017 TESTS 4 15 0 900
68571024 529886336 A Jan. 11, 2020, 2:16 a.m. OK MS C++ 2017 TESTS 4 15 0 900
67637101 registuv A Dec. 26, 2019, 7:34 a.m. OK MS C++ 2017 TESTS 4 15 0 900
67605953 leon.tyumen A Dec. 25, 2019, 1:34 p.m. OK MS C++ 2017 TESTS 4 15 0 900
67601720 ZA139 A Dec. 25, 2019, 12:10 p.m. OK MS C++ 2017 TESTS 4 15 0 900
66789689 TitanRoyal A Dec. 13, 2019, 2:50 p.m. OK Node.js TESTS 4 202 3379200 900
66788090 Tomasz43 A Dec. 13, 2019, 2:20 p.m. OK Node.js TESTS 4 217 3993600 900
67790527 Nidavellir arcturus5340 A Dec. 28, 2019, 2:29 p.m. OK PascalABC.NET TESTS 4 311 102400 900
67790437 Nidavellir arcturus5340 A Dec. 28, 2019, 2:26 p.m. OK PascalABC.NET TESTS 4 327 102400 900
66805039 eng.tarek.ibrahem A Dec. 13, 2019, 8:33 p.m. OK Perl TESTS 4 30 0 900
68033912 mayakin A Jan. 1, 2020, 10:56 a.m. OK PHP TESTS 4 31 0 900
67941191 pengyuhe A Dec. 30, 2019, 1:01 a.m. OK PyPy 2 TESTS 4 155 204800 900
66791631 McYaraliSisman A Dec. 13, 2019, 3:29 p.m. OK PyPy 2 TESTS 4 155 409600 900
66735838 11fingers A Dec. 12, 2019, 6:48 p.m. OK PyPy 2 TESTS 4 171 204800 900
67425250 fortmax120 A Dec. 22, 2019, 1:11 p.m. OK PyPy 2 TESTS 4 171 1126400 900
66746976 aaa_bbb_ccc A Dec. 13, 2019, 3:17 a.m. OK PyPy 2 TESTS 4 171 2560000 900
68008212 raj1307 A Dec. 31, 2019, 2:20 p.m. OK PyPy 2 TESTS 4 171 2662400 900
67566629 wolffd A Dec. 24, 2019, 7:37 p.m. OK PyPy 2 TESTS 4 187 3481600 900
69263831 densvedberg A Jan. 21, 2020, 5:56 p.m. OK PyPy 3 TESTS 4 139 2150400 900
66795026 arp106 A Dec. 13, 2019, 4:43 p.m. OK PyPy 3 TESTS 4 139 2969600 900
68021028 ben1989 A Dec. 31, 2019, 11:02 p.m. OK PyPy 3 TESTS 4 156 1945600 900
68469554 mitribunskiy A Jan. 9, 2020, 11:49 p.m. OK PyPy 3 TESTS 4 170 1843200 900
67059280 Mr.Inconsistent A Dec. 17, 2019, 8:22 a.m. OK PyPy 3 TESTS 4 171 1945600 900
68989378 CryUnderRain A Jan. 17, 2020, 1:38 p.m. OK PyPy 3 TESTS 4 171 2252800 900
68663561 Mathematician2000 A Jan. 12, 2020, 2:24 p.m. OK PyPy 3 TESTS 4 186 2355200 900
67456960 xxekichsiht A Dec. 23, 2019, 7:21 a.m. OK PyPy 3 TESTS 4 186 2355200 900
68108638 ninadc A Jan. 3, 2020, 8:30 a.m. OK PyPy 3 TESTS 4 186 2457600 900
66749661 shekhar_kumar1 A Dec. 13, 2019, 5:15 a.m. OK PyPy 3 TESTS 4 186 2560000 900
67678580 _deep_m_ A Dec. 27, 2019, 4:44 a.m. OK Python 2 TESTS 4 155 0 900
67150033 elistark A Dec. 18, 2019, 10:23 a.m. OK Python 2 TESTS 4 155 0 900
69399272 bsr011 A Jan. 23, 2020, 7:45 a.m. OK Python 2 TESTS 4 171 0 900
67044967 elistark A Dec. 16, 2019, 9:23 p.m. OK Python 2 TESTS 4 171 0 900
67112684 elistark A Dec. 17, 2019, 4:56 p.m. OK Python 2 TESTS 4 186 0 900
66775273 karthik.pasupulatei A Dec. 13, 2019, 9:45 a.m. OK Python 3 TESTS 4 92 0 900
68656712 cs1g A Jan. 12, 2020, 12:27 p.m. OK Python 3 TESTS 4 93 0 900
67020852 vignesh_152 A Dec. 16, 2019, 12:55 p.m. OK Python 3 TESTS 4 93 0 900
67050804 BlackBear A Dec. 17, 2019, 3:53 a.m. OK Python 3 TESTS 4 93 102400 900
66971788 sruthi_1729 A Dec. 15, 2019, 1:25 p.m. OK Python 3 TESTS 4 93 204800 900
66817454 I__D__ A Dec. 14, 2019, 6:19 a.m. OK Python 3 TESTS 4 93 204800 900
66743986 orailly A Dec. 12, 2019, 11:53 p.m. OK Python 3 TESTS 4 93 204800 900
66729950 Gavor A Dec. 12, 2019, 5:10 p.m. OK Python 3 TESTS 4 93 204800 900
69663481 navidnouri1992 A Jan. 28, 2020, 10:23 a.m. OK Python 3 TESTS 4 93 307200 900
68864066 jokerking A Jan. 15, 2020, 1:01 p.m. OK Python 3 TESTS 4 93 307200 900
67005699 nemi_zzz A Dec. 16, 2019, 7:50 a.m. OK Ruby TESTS 4 109 0 900
67412685 myduomilia A Dec. 22, 2019, 8:52 a.m. OK Rust TESTS 4 31 0 900
67412550 myduomilia A Dec. 22, 2019, 8:50 a.m. OK Rust TESTS 4 46 0 900

remove filters

Back to search problems