Codeforces Round 423 (Div. 2, rated, based on VK Cup Finals)

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
828 Codeforces Round 423 (Div. 2, rated, based on VK Cup Finals) FINISHED False 7200 232031699 July 11, 2017, 4:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5705 ) B Black Square PROGRAMMING implementation 1300

B'Polycarp has a checkered sheet of paper of size n xe2 x80 x89 xc3 x97 xe2 x80 x89m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich 's "Black Square", Polycarp wants to paint minimum possible number of white cells with black so that all black cells form a square. You are to determine the minimum possible number of cells needed to be painted black so that the black cells form a black square with sides parallel to the painting 's sides. All the cells that do not belong to the square should be white. The square 's side should have positive length. The first line contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100) -- the sizes of the sheet. The next n lines contain m letters 'B ' or 'W ' each -- the description of initial cells ' colors. If a letter is 'B ', then the corresponding cell is painted black, otherwise it is painted white. Print the minimum number of cells needed to be painted black so that the black cells form a black square with sides parallel to the painting 's sides. All the cells that do not belong to the square should be white. If it is impossible, print -1. In the first example it is needed to paint 5 cells -- (2, xe2 x80 x892), (2, xe2 x80 x893), (3, xe2 x80 x892), (3, xe2 x80 x893) and (4, xe2 x80 x892). Then there will be a square with side equal to three, and the upper left corner in (2, xe2 x80 x892). In the second example all the cells are painted black and form a rectangle, so it 's impossible to get a square. In the third example all cells are colored white, so it 's sufficient to color any cell black. '...

Tutorials

Codeforces Round #423 Analysis

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44052607 stoian_andreea B Oct. 9, 2018, 8:10 p.m. OK Clang++17 Diagnostics TESTS 128 62 1024000 1300
28637184 Gassa B July 17, 2017, 11:01 a.m. OK D TESTS 128 15 2969600 1300
28475023 Artem3213212 B July 12, 2017, 1:17 p.m. OK Delphi TESTS 128 30 2560000 1300
28448643 PAG B July 11, 2017, 6:31 p.m. OK Delphi TESTS 128 31 2560000 1300
28436934 ruban B July 11, 2017, 5:13 p.m. OK Delphi TESTS 128 31 2560000 1300
28462328 cxk_jr B July 12, 2017, 5:29 a.m. OK FPC TESTS 128 15 1638400 1300
28776569 oIITiMicT B July 22, 2017, 10:59 a.m. OK FPC TESTS 128 15 1638400 1300
28467776 KagamiharaNadeshiko B July 12, 2017, 8:34 a.m. OK FPC TESTS 128 15 1740800 1300
28470804 Grom9941 B July 12, 2017, 10:33 a.m. OK FPC TESTS 128 15 1740800 1300
35737877 DonaldJTrump B Feb. 26, 2018, 4:05 p.m. OK FPC TESTS 128 15 1740800 1300
28467688 chithong97 B July 12, 2017, 8:31 a.m. OK FPC TESTS 128 15 1740800 1300
31302057 Yeader B Oct. 14, 2017, 10:56 a.m. OK FPC TESTS 128 15 3993600 1300
28447971 Goose_with_comp B July 11, 2017, 6:26 p.m. OK FPC TESTS 128 30 1638400 1300
28443766 Wattonz B July 11, 2017, 5:56 p.m. OK FPC TESTS 128 30 1740800 1300
28437530 tiliguzov B July 11, 2017, 5:16 p.m. OK FPC TESTS 128 30 1740800 1300
30949818 abir1 B Oct. 2, 2017, 5:36 p.m. OK GNU C TESTS 128 15 0 1300
30949290 abir1 B Oct. 2, 2017, 5:14 p.m. OK GNU C TESTS 128 15 0 1300
30895712 MarcosK B Oct. 1, 2017, 1:05 a.m. OK GNU C TESTS 128 15 0 1300
28741514 dloghin B July 21, 2017, 6:26 a.m. OK GNU C TESTS 128 15 1945600 1300
28876928 LCCCC B July 25, 2017, 1:19 p.m. OK GNU C TESTS 128 15 1945600 1300
28826670 SeventeenIsOdd B July 24, 2017, 2:25 p.m. OK GNU C TESTS 128 15 1945600 1300
28825092 mananb31 B July 24, 2017, 1:04 p.m. OK GNU C TESTS 128 15 1945600 1300
28794782 Devasnh B July 23, 2017, 7:35 a.m. OK GNU C TESTS 128 15 1945600 1300
28722414 learner1 B July 20, 2017, 11:01 a.m. OK GNU C TESTS 128 15 1945600 1300
28544437 FromSaffronCity B July 14, 2017, 9:38 a.m. OK GNU C TESTS 128 15 1945600 1300
32500576 vjudge3 B Nov. 20, 2017, 1:15 p.m. OK GNU C++ TESTS 128 15 0 1300
32140417 vjudge2 B Nov. 8, 2017, 1:07 p.m. OK GNU C++ TESTS 128 15 0 1300
31937711 vjudge5 B Nov. 1, 2017, 4:05 a.m. OK GNU C++ TESTS 128 15 0 1300
31855967 vjudge4 B Oct. 29, 2017, 4:55 a.m. OK GNU C++ TESTS 128 15 0 1300
31760428 vjudge4 B Oct. 26, 2017, 4:12 p.m. OK GNU C++ TESTS 128 15 0 1300
31760344 vjudge4 B Oct. 26, 2017, 4:11 p.m. OK GNU C++ TESTS 128 15 0 1300
32523329 vjudge4 B Nov. 21, 2017, 11:25 a.m. OK GNU C++ TESTS 128 15 0 1300
31759668 vjudge1 B Oct. 26, 2017, 4:06 p.m. OK GNU C++ TESTS 128 15 0 1300
31231320 biltharesatyendra B Oct. 12, 2017, 3:18 a.m. OK GNU C++ TESTS 128 15 0 1300
30945418 KNaga_TKTL B Oct. 2, 2017, 2:28 p.m. OK GNU C++ TESTS 128 15 0 1300
30773983 architkshk B Sept. 27, 2017, 10:30 a.m. OK GNU C11 TESTS 128 15 0 1300
34869365 vjudge1 B Feb. 2, 2018, 4:47 p.m. OK GNU C11 TESTS 128 30 1843200 1300
28622960 KtZerostve B July 17, 2017, 1:35 a.m. OK GNU C11 TESTS 128 30 1945600 1300
48044958 vjudge4 B Jan. 7, 2019, 1:09 a.m. OK GNU C11 TESTS 128 31 0 1300
48044922 vjudge3 B Jan. 7, 2019, 1:03 a.m. OK GNU C11 TESTS 128 31 0 1300
59832729 kaiboy B Sept. 1, 2019, 1:06 a.m. OK GNU C11 TESTS 128 31 0 1300
49856846 1297558222 B Feb. 13, 2019, 7:38 a.m. OK GNU C11 TESTS 128 31 0 1300
49758674 wangwenhao B Feb. 11, 2019, 7:48 a.m. OK GNU C11 TESTS 128 31 0 1300
48060481 vjudge4 B Jan. 7, 2019, 2:51 p.m. OK GNU C11 TESTS 128 31 0 1300
48053279 127 B Jan. 7, 2019, 10:40 a.m. OK GNU C11 TESTS 128 31 0 1300
30374650 mset B Sept. 16, 2017, 1:40 a.m. OK GNU C++11 TESTS 128 15 0 1300
32561508 Mihai22e B Nov. 22, 2017, 8:48 p.m. OK GNU C++11 TESTS 128 15 0 1300
32522946 xyry96 B Nov. 21, 2017, 11:12 a.m. OK GNU C++11 TESTS 128 15 0 1300
32359310 dragonfly B Nov. 16, 2017, 3:34 p.m. OK GNU C++11 TESTS 128 15 0 1300
31153992 snipex B Oct. 8, 2017, 8:22 p.m. OK GNU C++11 TESTS 128 15 0 1300
30649136 HeathcliffAC B Sept. 23, 2017, 4:57 p.m. OK GNU C++11 TESTS 128 15 0 1300
30526157 abhiavrondi B Sept. 19, 2017, 6:35 p.m. OK GNU C++11 TESTS 128 15 0 1300
30335040 Linese B Sept. 14, 2017, 5:31 p.m. OK GNU C++11 TESTS 128 15 0 1300
30279298 10142130231 B Sept. 12, 2017, 6:40 a.m. OK GNU C++11 TESTS 128 15 0 1300
30039832 pawelzell B Sept. 3, 2017, 4:48 p.m. OK GNU C++11 TESTS 128 15 0 1300
31043992 endless B Oct. 5, 2017, 6:20 p.m. OK GNU C++14 TESTS 128 15 0 1300
32367833 wjw1340 B Nov. 17, 2017, 1:42 a.m. OK GNU C++14 TESTS 128 15 0 1300
32247599 Igorek16 B Nov. 12, 2017, 3:40 p.m. OK GNU C++14 TESTS 128 15 0 1300
32145023 DebDoDab B Nov. 8, 2017, 7:01 p.m. OK GNU C++14 TESTS 128 15 0 1300
31892739 Fish_Li B Oct. 30, 2017, 12:06 p.m. OK GNU C++14 TESTS 128 15 0 1300
31849549 amit__ B Oct. 28, 2017, 7:49 p.m. OK GNU C++14 TESTS 128 15 0 1300
31166492 Mosquito_ B Oct. 9, 2017, 12:09 p.m. OK GNU C++14 TESTS 128 15 0 1300
31059419 darshankdarji B Oct. 6, 2017, 8:15 a.m. OK GNU C++14 TESTS 128 15 0 1300
31058924 Curtain B Oct. 6, 2017, 7:57 a.m. OK GNU C++14 TESTS 128 15 0 1300
31056514 jaydutt_patel B Oct. 6, 2017, 6:42 a.m. OK GNU C++14 TESTS 128 15 0 1300
35995298 vovamr B March 6, 2018, 2:47 p.m. OK GNU C++17 TESTS 128 15 1945600 1300
35966157 tuantuan B March 5, 2018, 1:08 p.m. OK GNU C++17 TESTS 128 15 2048000 1300
53220310 vjudge5 B April 24, 2019, 11:30 a.m. OK GNU C++17 TESTS 128 30 0 1300
66971004 KekriCoder B Dec. 15, 2019, 1:12 p.m. OK GNU C++17 TESTS 128 31 0 1300
68324707 JustDoIt28 B Jan. 6, 2020, 4:24 p.m. OK GNU C++17 TESTS 128 31 0 1300
68412546 practiceboy B Jan. 8, 2020, 5:34 p.m. OK GNU C++17 TESTS 128 31 0 1300
69220598 vjudge5 B Jan. 21, 2020, 4:20 a.m. OK GNU C++17 TESTS 128 31 0 1300
69223149 vjudge5 B Jan. 21, 2020, 5:51 a.m. OK GNU C++17 TESTS 128 31 0 1300
69273192 LivingTribunal B Jan. 21, 2020, 11:09 p.m. OK GNU C++17 TESTS 128 31 0 1300
66428570 joearshad_ B Dec. 7, 2019, 12:24 a.m. OK GNU C++17 TESTS 128 31 0 1300
34979150 upbeat B Feb. 6, 2018, 6:04 p.m. OK GNU C++17 Diagnostics TESTS 128 935 99840000 1300
28538792 tjsumonster B July 14, 2017, 5:50 a.m. OK Go TESTS 128 31 23040000 1300
28502904 goC B July 13, 2017, 12:58 p.m. OK Go TESTS 128 31 23347200 1300
28439981 Leonardone B July 11, 2017, 5:31 p.m. OK Go TESTS 128 46 23040000 1300
28574088 sl0th B July 15, 2017, 1:08 p.m. OK Haskell TESTS 128 15 44851200 1300
69164219 code_guardians B Jan. 20, 2020, 2:35 a.m. OK Java 11 TESTS 128 202 0 1300
29602605 gone_girl B Aug. 19, 2017, 3:43 p.m. OK Java 8 TESTS 128 109 0 1300
29527797 heyyeyaaeyaaaeyaeyaa B Aug. 17, 2017, 2:01 p.m. OK Java 8 TESTS 128 109 0 1300
28471803 King6997 B July 12, 2017, 11:18 a.m. OK Java 8 TESTS 128 109 20275200 1300
31380228 VerticesEdge B Oct. 16, 2017, 2:23 a.m. OK Java 8 TESTS 128 109 20275200 1300
28472077 King6997 B July 12, 2017, 11:30 a.m. OK Java 8 TESTS 128 109 20275200 1300
28799922 Garuda_1 B July 23, 2017, 11:44 a.m. OK Java 8 TESTS 128 109 20582400 1300
28794290 v1ct0r30 B July 23, 2017, 7:11 a.m. OK Java 8 TESTS 128 109 20582400 1300
28725276 chojh1222 B July 20, 2017, 12:49 p.m. OK Java 8 TESTS 128 109 20582400 1300
29130491 physai B Aug. 2, 2017, 12:52 p.m. OK Java 8 TESTS 128 109 20582400 1300
28873471 coderbond007 B July 25, 2017, 10:57 a.m. OK Java 8 TESTS 128 109 20582400 1300
34232604 lunar.light B Jan. 16, 2018, 8:47 p.m. OK JavaScript TESTS 128 31 6246400 1300
28582850 Vallix B July 15, 2017, 10:20 p.m. OK JavaScript TESTS 128 31 6451200 1300
28450267 NinjaBear B July 11, 2017, 6:42 p.m. OK JavaScript TESTS 128 46 6451200 1300
28484734 vovak B July 12, 2017, 11:24 p.m. OK Kotlin TESTS 128 202 22732800 1300
28471010 TRR B July 12, 2017, 10:41 a.m. OK Mono C# TESTS 128 46 9318400 1300
51657382 nemars B March 21, 2019, 10:45 p.m. OK Mono C# TESTS 128 62 0 1300
30910442 og.kostya B Oct. 1, 2017, 1:45 p.m. OK MS C# TESTS 128 46 204800 1300
28466381 treasuryonly B July 12, 2017, 7:47 a.m. OK MS C# TESTS 128 46 9318400 1300
28465638 artsin666 B July 12, 2017, 7:25 a.m. OK MS C# TESTS 128 46 9318400 1300
28437135 Hsayram B July 11, 2017, 5:14 p.m. OK MS C# TESTS 128 46 9318400 1300
28436435 serrg B July 11, 2017, 5:10 p.m. OK MS C# TESTS 128 46 9318400 1300
28437202 Sorryforpartyrocking B July 11, 2017, 5:14 p.m. OK MS C# TESTS 128 62 9318400 1300
29273022 laham B Aug. 7, 2017, 9:05 p.m. OK MS C# TESTS 128 62 9318400 1300
28553887 Liran B July 14, 2017, 5:03 p.m. OK MS C# TESTS 128 62 9318400 1300
28482776 hloya B July 12, 2017, 8:04 p.m. OK MS C# TESTS 128 62 9318400 1300
28449516 Akarachudra B July 11, 2017, 6:37 p.m. OK MS C# TESTS 128 62 9318400 1300
30252722 vjudge2 B Sept. 10, 2017, 5:38 p.m. OK MS C++ TESTS 128 15 204800 1300
30051978 Egoist_ B Sept. 4, 2017, 11:45 a.m. OK MS C++ TESTS 128 15 204800 1300
30004422 eastblue B Sept. 2, 2017, 9:01 a.m. OK MS C++ TESTS 128 15 204800 1300
30646883 hangedplane B Sept. 23, 2017, 3:37 p.m. OK MS C++ TESTS 128 15 204800 1300
30263008 vjudge4 B Sept. 11, 2017, 9:51 a.m. OK MS C++ TESTS 128 15 204800 1300
28465114 bambbam B July 12, 2017, 7:10 a.m. OK MS C++ TESTS 128 15 1945600 1300
28990982 vjudge3 B July 30, 2017, 12:54 p.m. OK MS C++ TESTS 128 15 1945600 1300
28605762 _Halim_ B July 16, 2017, 3:48 p.m. OK MS C++ TESTS 128 15 1945600 1300
28801955 Tanya_P B July 23, 2017, 1:14 p.m. OK MS C++ TESTS 128 15 2048000 1300
28802147 Tanya_P B July 23, 2017, 1:24 p.m. OK MS C++ TESTS 128 15 2048000 1300
59654732 Still_Theory B Aug. 29, 2019, 9:49 a.m. OK MS C++ 2017 TESTS 128 31 0 1300
57601517 CtrlAlt B July 23, 2019, 4 p.m. OK MS C++ 2017 TESTS 128 31 0 1300
56492420 a7madsam B July 3, 2019, 11:35 p.m. OK MS C++ 2017 TESTS 128 31 0 1300
55666299 raymondyuewang B June 17, 2019, 4:08 a.m. OK MS C++ 2017 TESTS 128 31 0 1300
65521174 vjudge3 B Nov. 22, 2019, 8:24 a.m. OK MS C++ 2017 TESTS 128 31 307200 1300
58530265 vjudge2 B Aug. 10, 2019, 9:09 a.m. OK MS C++ 2017 TESTS 128 46 102400 1300
65902891 qcumber48 B Nov. 28, 2019, 9:34 a.m. OK MS C++ 2017 TESTS 128 46 307200 1300
63987456 Mad112233 B Nov. 1, 2019, 12:11 p.m. OK MS C++ 2017 TESTS 128 46 307200 1300
28438645 Darooha B July 11, 2017, 5:22 p.m. OK Ocaml TESTS 128 15 3891200 1300
28977354 s_p B July 29, 2017, 7:39 p.m. OK Perl TESTS 128 46 2252800 1300
29219381 mayakin B Aug. 5, 2017, 1:13 p.m. OK PHP TESTS 128 31 6041600 1300
28957883 15927491671 B July 28, 2017, 4:21 p.m. OK PHP TESTS 128 31 6041600 1300
28825351 mraron B July 24, 2017, 1:18 p.m. OK PHP TESTS 128 280 6041600 1300
28504858 kfx B July 13, 2017, 2:17 p.m. OK PyPy 2 TESTS 128 78 22425600 1300
29855377 pluristiq B Aug. 28, 2017, 10:49 p.m. OK PyPy 2 TESTS 128 93 204800 1300
28442123 MentalOmega B July 11, 2017, 5:45 p.m. OK PyPy 2 TESTS 128 93 22016000 1300
28439531 ankitaggarwal011 B July 11, 2017, 5:28 p.m. OK PyPy 2 TESTS 128 93 22528000 1300
69062681 vjudge5 B Jan. 18, 2020, 5:13 p.m. OK PyPy 2 TESTS 128 124 0 1300
69072616 fortmax120 B Jan. 18, 2020, 11:39 p.m. OK PyPy 2 TESTS 128 140 0 1300
41338511 aeternalis1 B Aug. 8, 2018, 1:46 p.m. OK PyPy 2 TESTS 128 140 716800 1300
28440772 har_vi B July 11, 2017, 5:36 p.m. OK PyPy 2 TESTS 128 170 23654400 1300
28462347 subhash-saurabh B July 12, 2017, 5:30 a.m. OK PyPy 2 TESTS 128 171 29696000 1300
28436283 Naoki_M B July 11, 2017, 5:09 p.m. OK PyPy 3 TESTS 128 124 24064000 1300
28455053 zygelon B July 11, 2017, 10:16 p.m. OK PyPy 3 TESTS 128 139 23756800 1300
28448276 terpingidrat B July 11, 2017, 6:28 p.m. OK PyPy 3 TESTS 128 139 26214400 1300
63387370 asmans B Oct. 25, 2019, 2:10 p.m. OK PyPy 3 TESTS 128 140 2252800 1300
28961119 rxakinetics B July 28, 2017, 7:40 p.m. OK PyPy 3 TESTS 128 140 26624000 1300
59827545 shall_not_pass B Aug. 31, 2019, 8:19 p.m. OK PyPy 3 TESTS 128 155 0 1300
57366894 tchr B July 20, 2019, 9:29 a.m. OK PyPy 3 TESTS 128 155 0 1300
59395423 kopok2 B Aug. 24, 2019, 10:07 a.m. OK PyPy 3 TESTS 128 155 1536000 1300
69074023 sunnyorrainy B Jan. 19, 2020, 1:27 a.m. OK PyPy 3 TESTS 128 155 1945600 1300
28501909 mattiasm83 B July 13, 2017, 12:22 p.m. OK PyPy 3 TESTS 128 155 25907200 1300
29288467 bluered B Aug. 8, 2017, 3:33 p.m. OK Python 2 TESTS 128 61 4710400 1300
29287889 bluered B Aug. 8, 2017, 3:03 p.m. OK Python 2 TESTS 128 61 4710400 1300
28477303 Ostkaka B July 12, 2017, 2:45 p.m. OK Python 2 TESTS 128 61 4710400 1300
28461341 Arch0n B July 12, 2017, 4:48 a.m. OK Python 2 TESTS 128 61 4710400 1300
28504029 nealzane B July 13, 2017, 1:41 p.m. OK Python 2 TESTS 128 61 5836800 1300
29586125 lawrenceli B Aug. 19, 2017, 2:37 a.m. OK Python 2 TESTS 128 62 0 1300
29861295 ishepard B Aug. 29, 2017, 8:34 a.m. OK Python 2 TESTS 128 62 102400 1300
29294656 bluered B Aug. 8, 2017, 11:01 p.m. OK Python 2 TESTS 128 62 4710400 1300
29287853 bluered B Aug. 8, 2017, 3:01 p.m. OK Python 2 TESTS 128 62 4710400 1300
29271949 helen123 B Aug. 7, 2017, 7:48 p.m. OK Python 2 TESTS 128 62 4710400 1300
29962376 sxx B Sept. 1, 2017, 1:12 a.m. OK Python 3 TESTS 128 62 307200 1300
29093152 omid_gh B Aug. 1, 2017, 8:34 a.m. OK Python 3 TESTS 128 62 4608000 1300
28972102 cgfs10000 B July 29, 2017, 2:11 p.m. OK Python 3 TESTS 128 62 4608000 1300
28882896 -Gration B July 25, 2017, 5:09 p.m. OK Python 3 TESTS 128 62 4608000 1300
28825584 akash05singh97 B July 24, 2017, 1:31 p.m. OK Python 3 TESTS 128 62 4608000 1300
28781017 Arhimason B July 22, 2017, 2:28 p.m. OK Python 3 TESTS 128 62 4608000 1300
28722692 Kapt B July 20, 2017, 11:11 a.m. OK Python 3 TESTS 128 62 4608000 1300
28705522 thelastprime B July 19, 2017, 9:37 p.m. OK Python 3 TESTS 128 62 4608000 1300
28695137 xionix B July 19, 2017, 11:44 a.m. OK Python 3 TESTS 128 62 4608000 1300
28689537 luongquocan B July 19, 2017, 8:06 a.m. OK Python 3 TESTS 128 62 4608000 1300
29642781 Hillmouse B Aug. 21, 2017, noon OK Rust TESTS 128 15 0 1300
29478600 popvoegor1985 B Aug. 15, 2017, 10:17 a.m. OK Rust TESTS 128 15 1638400 1300

remove filters

Back to search problems