Codeforces Round 533 (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
1105 Codeforces Round 533 (Div. 2) FINISHED False 7200 183837299 Jan. 20, 2019, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10996 ) A Salem and Sticks PROGRAMMING brute force implementation 1100

B"Salem gave you n sticks with integer positive lengths a_1, a_2, ldots, a_n . For every stick, you can change its length to any other positive integer length (that is, either shrink or stretch it). The cost of changing the stick's length from a to b is |a - b| , where |x| means the absolute value of x . A stick length a_i is called almost good for some integer t if |a_i - t| <= 1 . Salem asks you to change the lengths of some sticks (possibly all or none), such that all sticks' lengths are almost good for some positive integer t and the total cost of changing is minimum possible. The value of t is not fixed in advance and you can choose it as any positive integer. As an answer, print the value of t and the minimum cost. If there are multiple optimal choices for t , print any of them. The first line contains a single integer n ( 1 <= n <= 1000 ) -- the number of sticks. The second line contains n integers a_i ( 1 <= a_i <= 100 ) -- the lengths of the sticks. Print the value of t and the minimum possible cost. If there are multiple optimal choices for t , print any of them. In the first example, we can change 1 into 2 and 10 into 4 with cost |1 - 2| + |10 - 4| = 1 + 6 = 7 and the resulting lengths [2, 4, 4] are almost good for t = 3 . In the second example, the sticks lengths are already almost good for t = 2 , so we don't have to do anything. "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49474129 smit.mangukiya A Feb. 4, 2019, 6:32 p.m. OK Clang++17 Diagnostics TESTS 89 46 0 1100
49062203 _Edward A Jan. 27, 2019, 3:58 p.m. OK Clang++17 Diagnostics TESTS 89 46 0 1100
48656518 jeong000307 A Jan. 21, 2019, 3:02 a.m. OK Clang++17 Diagnostics TESTS 89 62 0 1100
55306989 xcodevn A June 8, 2019, 3:06 p.m. OK D TESTS 89 31 0 1100
51814163 chaorenhaha A March 25, 2019, 8:03 a.m. OK FPC TESTS 89 31 0 1100
48852902 binarmo A Jan. 23, 2019, 5:44 p.m. OK FPC TESTS 89 31 0 1100
51814152 chaorenhaha A March 25, 2019, 8:02 a.m. OK FPC TESTS 89 31 0 1100
51814142 chaorenhaha A March 25, 2019, 8:02 a.m. OK FPC TESTS 89 31 102400 1100
49098493 TShT A Jan. 28, 2019, 10:36 a.m. OK FPC TESTS 89 31 409600 1100
48630343 Laer_Virus A Jan. 20, 2019, 1:24 p.m. OK FPC TESTS 89 46 0 1100
48656242 phuleethanh A Jan. 21, 2019, 2:50 a.m. OK FPC TESTS 89 46 102400 1100
52609201 Alfeh A April 11, 2019, 3:15 p.m. OK GNU C11 TESTS 89 31 0 1100
56987548 imran.bd A July 13, 2019, 4:31 p.m. OK GNU C11 TESTS 89 31 0 1100
58035884 ktk54x A July 30, 2019, 6:02 p.m. OK GNU C11 TESTS 89 31 0 1100
61709144 olfa_halila A Oct. 2, 2019, 11:01 a.m. OK GNU C11 TESTS 89 31 0 1100
64350621 vjudge3 A Nov. 6, 2019, 8:12 a.m. OK GNU C11 TESTS 89 31 0 1100
65453299 DevJewel A Nov. 20, 2019, 7:06 p.m. OK GNU C11 TESTS 89 31 0 1100
67022514 yigezhe A Dec. 16, 2019, 1:23 p.m. OK GNU C11 TESTS 89 31 0 1100
68726271 shreyashbapodia A Jan. 13, 2020, 6:01 p.m. OK GNU C11 TESTS 89 31 0 1100
69020119 sohankumarparida A Jan. 18, 2020, 6:13 a.m. OK GNU C11 TESTS 89 31 0 1100
52545853 _one_noob A April 9, 2019, 9:25 p.m. OK GNU C11 TESTS 89 31 0 1100
48643296 kishanTiwari A Jan. 20, 2019, 4:12 p.m. OK GNU C++11 TESTS 89 30 0 1100
67969627 HHHEN A Dec. 30, 2019, 2:32 p.m. OK GNU C++11 TESTS 89 31 0 1100
68200230 gauravrai1207 A Jan. 4, 2020, 3:20 p.m. OK GNU C++11 TESTS 89 31 0 1100
68345774 yyl2015 A Jan. 7, 2020, 7:08 a.m. OK GNU C++11 TESTS 89 31 0 1100
68422738 sri_akshya_18 A Jan. 9, 2020, 12:07 a.m. OK GNU C++11 TESTS 89 31 0 1100
68943526 _Kema_ A Jan. 16, 2020, 3:15 p.m. OK GNU C++11 TESTS 89 31 0 1100
68967726 vjudge4 A Jan. 17, 2020, 5:46 a.m. OK GNU C++11 TESTS 89 31 0 1100
68967799 vjudge5 A Jan. 17, 2020, 5:48 a.m. OK GNU C++11 TESTS 89 31 0 1100
69537941 Ahmad_Albakri A Jan. 25, 2020, 7:44 p.m. OK GNU C++11 TESTS 89 31 0 1100
66546984 OuDaRjA_17o3oo2 A Dec. 9, 2019, 1:34 p.m. OK GNU C++11 TESTS 89 31 0 1100
49300205 luogu_bot5 A Feb. 1, 2019, 2:26 a.m. OK GNU C++14 TESTS 89 15 0 1100
49761231 AndreiS A Feb. 11, 2019, 9:05 a.m. OK GNU C++14 TESTS 89 30 0 1100
58146708 ut005 A Aug. 1, 2019, 10:08 p.m. OK GNU C++14 TESTS 89 30 0 1100
56722966 darklord._.07 A July 8, 2019, 5:50 p.m. OK GNU C++14 TESTS 89 30 0 1100
51380112 vjudge5 A March 16, 2019, 3:50 p.m. OK GNU C++14 TESTS 89 30 0 1100
51287622 tangbinjie A March 14, 2019, 8:15 a.m. OK GNU C++14 TESTS 89 30 0 1100
50758986 tourbillon A March 3, 2019, 6:24 p.m. OK GNU C++14 TESTS 89 30 0 1100
50568125 Rodp63 A Feb. 27, 2019, 2:04 p.m. OK GNU C++14 TESTS 89 30 0 1100
50016076 Abdullah-Buhlaq A Feb. 16, 2019, 5:27 p.m. OK GNU C++14 TESTS 89 30 0 1100
49910613 cherish_lin A Feb. 14, 2019, 1:59 p.m. OK GNU C++14 TESTS 89 30 0 1100
54480589 NaimSS A May 22, 2019, 10:51 a.m. OK GNU C++17 TESTS 89 15 0 1100
48774184 zhhheidi A Jan. 23, 2019, 2:46 a.m. OK GNU C++17 TESTS 89 15 307200 1100
48692677 stfd A Jan. 21, 2019, 6:46 p.m. OK GNU C++17 TESTS 89 15 307200 1100
48782042 abhi_756 A Jan. 23, 2019, 7:13 a.m. OK GNU C++17 TESTS 89 15 307200 1100
69571910 i_m_arin A Jan. 26, 2020, 2:21 p.m. OK GNU C++17 TESTS 89 30 0 1100
51291997 jubaidul.ctg.bd A March 14, 2019, 10:52 a.m. OK GNU C++17 TESTS 89 30 0 1100
51361663 risk_17 A March 16, 2019, 7:36 a.m. OK GNU C++17 TESTS 89 30 0 1100
54963872 karansiwach360 A June 2, 2019, 5:24 a.m. OK GNU C++17 TESTS 89 30 0 1100
56723584 lungualex00 A July 8, 2019, 6:12 p.m. OK GNU C++17 TESTS 89 30 0 1100
57508425 sharrad99 A July 22, 2019, 12:50 p.m. OK GNU C++17 TESTS 89 30 0 1100
48669398 jaeyong0201 A Jan. 21, 2019, 9:53 a.m. OK Go TESTS 89 31 0 1100
49388119 Ziax A Feb. 3, 2019, 8:10 a.m. OK Java 8 TESTS 89 109 0 1100
66236583 ijxjdjd A Dec. 3, 2019, 4:25 p.m. OK Java 8 TESTS 89 109 0 1100
63614710 Vishal_dhanani A Oct. 27, 2019, 6:53 p.m. OK Java 8 TESTS 89 109 0 1100
60046705 YahiaSherif A Sept. 4, 2019, 8:50 p.m. OK Java 8 TESTS 89 109 0 1100
60046681 Hemose A Sept. 4, 2019, 8:49 p.m. OK Java 8 TESTS 89 109 0 1100
56860212 O_E A July 11, 2019, 9:26 p.m. OK Java 8 TESTS 89 109 0 1100
54387637 Vatsal53 A May 19, 2019, 2:16 p.m. OK Java 8 TESTS 89 109 0 1100
49450838 kissscreen A Feb. 4, 2019, 7:04 a.m. OK Java 8 TESTS 89 109 0 1100
49351818 -_-301iq-_- A Feb. 2, 2019, 8:56 a.m. OK Java 8 TESTS 89 109 0 1100
49318715 bulat_khaf31 A Feb. 1, 2019, 11:17 a.m. OK Java 8 TESTS 89 109 0 1100
48680106 Semih_ A Jan. 21, 2019, 12:57 p.m. OK JavaScript TESTS 89 46 1228800 1100
49176944 vjudge3 A Jan. 29, 2019, 9:21 p.m. OK Kotlin TESTS 89 139 0 1100
50045880 glider.g A Feb. 17, 2019, 5:52 a.m. OK Kotlin TESTS 89 140 204800 1100
49287872 n.cardozo A Jan. 31, 2019, 6:19 p.m. OK Kotlin TESTS 89 140 21606400 1100
48675652 sshpark A Jan. 21, 2019, 11:22 a.m. OK Kotlin TESTS 89 155 102400 1100
48668115 Cotheq A Jan. 21, 2019, 9:09 a.m. OK Kotlin TESTS 89 155 102400 1100
48646405 Olegan777 A Jan. 20, 2019, 5:45 p.m. OK Kotlin TESTS 89 155 307200 1100
48639827 vv58 A Jan. 20, 2019, 3:06 p.m. OK Kotlin TESTS 89 186 1331200 1100
49883193 nastya1199 A Feb. 13, 2019, 7:21 p.m. OK Mono C# TESTS 89 46 0 1100
48653967 ken_love_rin A Jan. 21, 2019, 1:10 a.m. OK Mono C# TESTS 89 62 0 1100
54652758 og.kostya A May 26, 2019, 6:30 a.m. OK Mono C# TESTS 89 62 0 1100
48675883 TRR A Jan. 21, 2019, 11:28 a.m. OK Mono C# TESTS 89 62 0 1100
48647899 ykurmangaliyev A Jan. 20, 2019, 6:37 p.m. OK Mono C# TESTS 89 62 3584000 1100
48945165 hunternds A Jan. 25, 2019, 6:41 p.m. OK Mono C# TESTS 89 62 3686400 1100
48921006 Mem A Jan. 25, 2019, 7:51 a.m. OK Mono C# TESTS 89 77 3584000 1100
50651963 sergmel A March 1, 2019, 5:59 p.m. OK Mono C# TESTS 89 77 3686400 1100
49058222 nemars A Jan. 27, 2019, 2:14 p.m. OK Mono C# TESTS 89 77 3788800 1100
56786395 vjudge1 A July 10, 2019, 8:38 a.m. OK MS C++ TESTS 89 31 0 1100
56787026 vjudge1 A July 10, 2019, 8:52 a.m. OK MS C++ TESTS 89 31 0 1100
56792484 vjudge5 A July 10, 2019, 11:11 a.m. OK MS C++ TESTS 89 31 0 1100
56792714 vjudge1 A July 10, 2019, 11:17 a.m. OK MS C++ TESTS 89 31 0 1100
56971938 vjudge4 A July 13, 2019, 10:39 a.m. OK MS C++ TESTS 89 31 0 1100
56972783 vjudge5 A July 13, 2019, 10:59 a.m. OK MS C++ TESTS 89 31 0 1100
58121120 shio A Aug. 1, 2019, 10:47 a.m. OK MS C++ TESTS 89 31 0 1100
59942082 vjudge2 A Sept. 3, 2019, 11:49 a.m. OK MS C++ TESTS 89 31 0 1100
60059447 vjudge5 A Sept. 5, 2019, 6:12 a.m. OK MS C++ TESTS 89 31 0 1100
68982025 vjudge5 A Jan. 17, 2020, 11:07 a.m. OK MS C++ TESTS 89 31 0 1100
58554550 a7madsam A Aug. 11, 2019, 12:14 a.m. OK MS C++ 2017 TESTS 89 31 0 1100
64318328 vjudge2 A Nov. 5, 2019, 2:47 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
52761551 SendThemToHell A April 14, 2019, 9:15 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
52876087 MuxauJl_20 A April 16, 2019, 7:42 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
53881876 HotBoyyy A May 8, 2019, 3:17 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
56715187 lippert A July 8, 2019, 2:22 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
57730451 gleb_shkoda A July 25, 2019, 8:26 a.m. OK MS C++ 2017 TESTS 89 31 0 1100
58338654 Mad112233 A Aug. 5, 2019, 12:26 p.m. OK MS C++ 2017 TESTS 89 31 0 1100
49655122 functionfang A Feb. 9, 2019, 9:30 a.m. OK MS C++ 2017 TESTS 89 31 307200 1100
65667422 MRamanauskas A Nov. 24, 2019, 2:30 p.m. OK MS C++ 2017 TESTS 89 31 614400 1100
48668490 moballack A Jan. 21, 2019, 9:20 a.m. OK Node.js TESTS 89 202 1945600 1100
48676222 dobrihlopez A Jan. 21, 2019, 11:36 a.m. OK PascalABC.NET TESTS 89 187 0 1100
48635601 Ilyanter A Jan. 20, 2019, 1:53 p.m. OK PascalABC.NET TESTS 89 202 0 1100
48627704 rinatisk A Jan. 20, 2019, 1:10 p.m. OK PascalABC.NET TESTS 89 202 0 1100
48631103 l-_-l A Jan. 20, 2019, 1:28 p.m. OK PascalABC.NET TESTS 89 265 0 1100
48846301 shabrov A Jan. 23, 2019, 4:28 p.m. OK PascalABC.NET TESTS 89 311 204800 1100
48684165 ardooo A Jan. 21, 2019, 2:32 p.m. OK PascalABC.NET TESTS 89 311 307200 1100
51338653 mm944 A March 15, 2019, 3:17 p.m. OK PascalABC.NET TESTS 89 312 0 1100
53822983 Houy3 A May 6, 2019, 2:16 p.m. OK PascalABC.NET TESTS 89 342 204800 1100
48630408 rsFalse A Jan. 20, 2019, 1:24 p.m. OK Perl TESTS 89 46 204800 1100
48640590 PavelSmirnov A Jan. 20, 2019, 3:17 p.m. OK PHP TESTS 89 46 512000 1100
48649462 mayakin A Jan. 20, 2019, 7:40 p.m. OK PHP TESTS 89 46 512000 1100
48862495 masonsbro A Jan. 24, 2019, 12:13 a.m. OK PyPy 2 TESTS 89 124 307200 1100
48645439 bertrandovide A Jan. 20, 2019, 5:14 p.m. OK PyPy 2 TESTS 89 124 409600 1100
48648174 wangkan2001 A Jan. 20, 2019, 6:48 p.m. OK PyPy 2 TESTS 89 124 921600 1100
48721457 raven_47 A Jan. 22, 2019, 1:42 p.m. OK PyPy 2 TESTS 89 139 409600 1100
48643123 figdan A Jan. 20, 2019, 4:07 p.m. OK PyPy 2 TESTS 89 140 307200 1100
48721537 raven_47 A Jan. 22, 2019, 1:44 p.m. OK PyPy 2 TESTS 89 140 409600 1100
48691310 c1729 A Jan. 21, 2019, 5:59 p.m. OK PyPy 2 TESTS 89 140 921600 1100
49667860 gatsko A Feb. 9, 2019, 3:18 p.m. OK PyPy 2 TESTS 89 140 1433600 1100
48655763 supachai_pay A Jan. 21, 2019, 2:31 a.m. OK PyPy 2 TESTS 89 187 307200 1100
48667207 SoSooding A Jan. 21, 2019, 8:44 a.m. OK PyPy 2 TESTS 89 217 307200 1100
49105320 D_J_Z A Jan. 28, 2019, 12:54 p.m. OK PyPy 3 TESTS 89 124 204800 1100
48695101 Skybytskyi.Nikita A Jan. 21, 2019, 8:29 p.m. OK PyPy 3 TESTS 89 139 512000 1100
51555289 CodeMaster A March 20, 2019, 4:25 a.m. OK PyPy 3 TESTS 89 140 204800 1100
48641577 twoeight A Jan. 20, 2019, 3:36 p.m. OK PyPy 3 TESTS 89 140 204800 1100
48799088 aisha-nabhani A Jan. 23, 2019, 1:42 p.m. OK PyPy 3 TESTS 89 140 307200 1100
48642309 Lean_Team_Lead A Jan. 20, 2019, 3:51 p.m. OK PyPy 3 TESTS 89 140 307200 1100
48699925 grhkm A Jan. 22, 2019, 2:01 a.m. OK PyPy 3 TESTS 89 140 409600 1100
48646319 k3rnel-pan1c A Jan. 20, 2019, 5:42 p.m. OK PyPy 3 TESTS 89 140 409600 1100
48695157 Skybytskyi.Nikita A Jan. 21, 2019, 8:32 p.m. OK PyPy 3 TESTS 89 140 512000 1100
48695068 Skybytskyi.Nikita A Jan. 21, 2019, 8:28 p.m. OK PyPy 3 TESTS 89 140 512000 1100
50101889 Luxo A Feb. 18, 2019, 3:19 p.m. OK Python 2 TESTS 89 171 0 1100
48941686 guyshe A Jan. 25, 2019, 4:51 p.m. OK Python 2 TESTS 89 171 0 1100
48710866 raj_1999 A Jan. 22, 2019, 8:26 a.m. OK Python 2 TESTS 89 186 0 1100
48766021 ilkerkosaroglu A Jan. 22, 2019, 7:23 p.m. OK Python 2 TESTS 89 187 0 1100
48722958 lprashant94 A Jan. 22, 2019, 2:20 p.m. OK Python 2 TESTS 89 187 0 1100
48648897 OpalDshawn A Jan. 20, 2019, 7:18 p.m. OK Python 2 TESTS 89 187 0 1100
48642444 scambret A Jan. 20, 2019, 3:54 p.m. OK Python 2 TESTS 89 187 0 1100
48639712 nwi A Jan. 20, 2019, 3:04 p.m. OK Python 2 TESTS 89 187 0 1100
54467492 franckmy A May 22, 2019, 1:50 a.m. OK Python 2 TESTS 89 202 0 1100
48692812 WNG A Jan. 21, 2019, 6:50 p.m. OK Python 2 TESTS 89 202 0 1100
48645904 agarus A Jan. 20, 2019, 5:30 p.m. OK Python 3 TESTS 89 108 0 1100
51667700 huangbinapple A March 22, 2019, 6:49 a.m. OK Python 3 TESTS 89 109 0 1100
49886657 ahmad5307 A Feb. 13, 2019, 10:06 p.m. OK Python 3 TESTS 89 109 0 1100
49107185 to_practise A Jan. 28, 2019, 1:35 p.m. OK Python 3 TESTS 89 109 0 1100
48937721 karth2512 A Jan. 25, 2019, 3:01 p.m. OK Python 3 TESTS 89 109 0 1100
68644610 FlyingBag65 A Jan. 12, 2020, 8:39 a.m. OK Python 3 TESTS 89 124 0 1100
61675998 Azzer A Oct. 1, 2019, 8:38 p.m. OK Python 3 TESTS 89 124 0 1100
55502166 tchr A June 12, 2019, 3:40 p.m. OK Python 3 TESTS 89 124 0 1100
51916401 tentacion A March 27, 2019, 10:18 p.m. OK Python 3 TESTS 89 124 0 1100
51321593 rajatgedam A March 15, 2019, 7:21 a.m. OK Python 3 TESTS 89 124 0 1100
49184393 rahdpp A Jan. 30, 2019, 4:54 a.m. OK Ruby TESTS 89 77 102400 1100
49392323 kenchii A Feb. 3, 2019, 10:39 a.m. OK Ruby TESTS 89 93 0 1100
48669577 cielavenir A Jan. 21, 2019, 10:01 a.m. OK Ruby TESTS 89 93 0 1100
48766085 dimon777227 A Jan. 22, 2019, 7:25 p.m. OK Rust TESTS 89 31 0 1100
60660228 jonyrock A Sept. 16, 2019, 4:09 a.m. OK Rust TESTS 89 46 0 1100
60659712 jonyrock A Sept. 16, 2019, 3:42 a.m. OK Rust TESTS 89 46 0 1100
49276513 sigevsky A Jan. 31, 2019, 2:40 p.m. OK Scala TESTS 89 514 39526400 1100

remove filters

Back to search problems