Codeforces Round 541 (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
1131 Codeforces Round 541 (Div. 2) FINISHED False 7200 180905999 Feb. 23, 2019, 10:20 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12462 ) A Sea Battle PROGRAMMING math 800

B'In order to make the "Sea Battle" game more interesting, Boris decided to add a new ship type to it. The ship consists of two rectangles. The first rectangle has a width of w_1 and a height of h_1 , while the second rectangle has a width of w_2 and a height of h_2 , where w_1 ge w_2 . In this game, exactly one ship is used, made up of two rectangles. There are no other ships on the field. The rectangles are placed on field in the following way: See the pictures in the notes: the first rectangle is colored red, the second rectangle is colored blue. Formally, let 's introduce a coordinate system. Then, the leftmost bottom cell of the first rectangle has coordinates (1, 1) , the rightmost top cell of the first rectangle has coordinates (w_1, h_1) , the leftmost bottom cell of the second rectangle has coordinates (1, h_1 + 1) and the rightmost top cell of the second rectangle has coordinates (w_2, h_1 + h_2) . After the ship is completely destroyed, all cells neighboring by side or a corner with the ship are marked. Of course, only cells, which don 't belong to the ship are marked. On the pictures in the notes such cells are colored green. Find out how many cells should be marked after the ship is destroyed. The field of the game is infinite in any direction. Four lines contain integers w_1, h_1, w_2 and h_2 ( 1 <= q w_1, h_1, w_2, h_2 <= q 10^8 , w_1 ge w_2 ) -- the width of the first rectangle, the height of the first rectangle, the width of the second rectangle and the height of the second rectangle. You can 't rotate the rectangles. Print exactly one integer -- the number of cells, which should be marked after the ship is destroyed. In the first example the field looks as follows (the first rectangle is red, the second rectangle is blue, green shows the marked squares): In the second example the field looks as: '...

Tutorials

Codeforces Round #541 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
59776252 Ghozlan A Aug. 30, 2019, 11:23 p.m. OK Clang++17 Diagnostics TESTS 22 46 0 800
51067587 vjudge5 A March 9, 2019, 6:29 a.m. OK Clang++17 Diagnostics TESTS 22 46 0 800
53960701 moluren A May 10, 2019, 2 p.m. OK Clang++17 Diagnostics TESTS 22 46 0 800
50686872 Namatullah A March 2, 2019, 2:03 p.m. OK Clang++17 Diagnostics TESTS 22 717 0 800
50383001 ruban A Feb. 23, 2019, 12:07 p.m. OK Delphi TESTS 22 31 27852800 800
58520295 ghosthunterk A Aug. 10, 2019, 4:05 a.m. OK FPC TESTS 22 30 0 800
51074575 aytal.d A March 9, 2019, 8:57 a.m. OK FPC TESTS 22 31 0 800
57182916 HoangVu123 A July 17, 2019, 7:50 a.m. OK FPC TESTS 22 31 0 800
50684872 katyaabram A March 2, 2019, 1:13 p.m. OK FPC TESTS 22 31 0 800
57585533 LaSWeeG A July 23, 2019, 10:28 a.m. OK FPC TESTS 22 31 0 800
50487486 gydgem A Feb. 25, 2019, 12:10 p.m. OK FPC TESTS 22 31 0 800
50918621 panteleevda A March 7, 2019, 7:53 a.m. OK FPC TESTS 22 31 0 800
50420153 vinhlikeit A Feb. 24, 2019, 8:37 a.m. OK FPC TESTS 22 31 0 800
50401584 Emily50 A Feb. 23, 2019, 6:28 p.m. OK GNU C11 TESTS 22 15 0 800
53662342 vjudge1 A May 2, 2019, 8:27 a.m. OK GNU C11 TESTS 22 15 0 800
53978297 tuhin107494 A May 11, 2019, 5:42 a.m. OK GNU C11 TESTS 22 15 0 800
54996376 miracle_pbc A June 3, 2019, 12:18 a.m. OK GNU C11 TESTS 22 15 0 800
63407899 mjhzr1 A Oct. 25, 2019, 9:29 p.m. OK GNU C11 TESTS 22 15 0 800
50736821 ishank1010 A March 3, 2019, 1:17 p.m. OK GNU C11 TESTS 22 15 0 800
50901486 HassanRagab A March 6, 2019, 5:40 p.m. OK GNU C11 TESTS 22 15 0 800
58184276 _____Sky___ A Aug. 2, 2019, 4:28 p.m. OK GNU C11 TESTS 22 30 0 800
63959524 yigezhe A Nov. 1, 2019, 4:19 a.m. OK GNU C11 TESTS 22 30 0 800
65296387 vjudge1 A Nov. 18, 2019, 11:40 a.m. OK GNU C11 TESTS 22 30 0 800
54408157 KobetheGOAT A May 20, 2019, 7:52 a.m. OK GNU C++11 TESTS 22 15 0 800
54509796 luogu_bot4 A May 23, 2019, 6:28 a.m. OK GNU C++11 TESTS 22 15 0 800
57084712 hms1523 A July 15, 2019, 8:22 a.m. OK GNU C++11 TESTS 22 15 0 800
57581676 Steven_Meng A July 23, 2019, 9:05 a.m. OK GNU C++11 TESTS 22 15 0 800
61395248 pbihao A Sept. 28, 2019, 1:38 a.m. OK GNU C++11 TESTS 22 15 0 800
62325343 kazirafi71 A Oct. 10, 2019, 6:14 p.m. OK GNU C++11 TESTS 22 15 0 800
65577735 vjudge1 A Nov. 23, 2019, 9:58 a.m. OK GNU C++11 TESTS 22 15 0 800
66224503 vjudge4 A Dec. 3, 2019, 12:04 p.m. OK GNU C++11 TESTS 22 15 0 800
69220621 luogu_bot5 A Jan. 21, 2020, 4:21 a.m. OK GNU C++11 TESTS 22 15 0 800
69245675 luogu_bot4 A Jan. 21, 2020, 12:50 p.m. OK GNU C++11 TESTS 22 15 0 800
66462587 ivatopuria A Dec. 7, 2019, 3:20 p.m. OK GNU C++14 TESTS 22 15 0 800
69573998 baher_code_forces A Jan. 26, 2020, 2:58 p.m. OK GNU C++14 TESTS 22 15 0 800
69488630 Abhishek0101 A Jan. 24, 2020, 8:57 p.m. OK GNU C++14 TESTS 22 15 0 800
68993765 Jigar_Z A Jan. 17, 2020, 4:22 p.m. OK GNU C++14 TESTS 22 15 0 800
68029695 olphe A Jan. 1, 2020, 8:27 a.m. OK GNU C++14 TESTS 22 15 0 800
67664397 desai10 A Dec. 26, 2019, 5:12 p.m. OK GNU C++14 TESTS 22 15 0 800
66568697 deogu A Dec. 10, 2019, 2:02 a.m. OK GNU C++14 TESTS 22 15 0 800
66394826 MeGaGOd A Dec. 6, 2019, 10:24 a.m. OK GNU C++14 TESTS 22 15 0 800
66227066 minoum A Dec. 3, 2019, 1 p.m. OK GNU C++14 TESTS 22 15 0 800
66018153 AnVaRsKI A Nov. 30, 2019, 6:19 a.m. OK GNU C++14 TESTS 22 15 0 800
65346895 fahimcp495 A Nov. 19, 2019, 12:54 p.m. OK GNU C++17 TESTS 22 15 0 800
66423379 pochti_ceasar A Dec. 6, 2019, 7:57 p.m. OK GNU C++17 TESTS 22 15 0 800
66476950 Bismut A Dec. 7, 2019, 9:31 p.m. OK GNU C++17 TESTS 22 15 0 800
66981327 sanchotik A Dec. 15, 2019, 4:30 p.m. OK GNU C++17 TESTS 22 15 0 800
67250440 sewa.bulgakov A Dec. 19, 2019, 6:51 p.m. OK GNU C++17 TESTS 22 15 0 800
67410346 gaki A Dec. 22, 2019, 8:05 a.m. OK GNU C++17 TESTS 22 15 0 800
68134326 Iron_man_3000love A Jan. 3, 2020, 6:11 p.m. OK GNU C++17 TESTS 22 15 0 800
68322230 sanyam.ss99 A Jan. 6, 2020, 3:24 p.m. OK GNU C++17 TESTS 22 15 0 800
68322576 animesh.ab99 A Jan. 6, 2020, 3:32 p.m. OK GNU C++17 TESTS 22 15 0 800
69185012 jrishabh_720 A Jan. 20, 2020, 11:39 a.m. OK GNU C++17 TESTS 22 15 0 800
50763705 zloylos A March 3, 2019, 9:27 p.m. OK Go TESTS 22 30 0 800
52017406 windy A March 30, 2019, 11:11 a.m. OK Go TESTS 22 31 0 800
50461390 PavelSmirnov A Feb. 24, 2019, 5:55 p.m. OK Go TESTS 22 31 0 800
50461317 PavelSmirnov A Feb. 24, 2019, 5:50 p.m. OK Go TESTS 22 31 0 800
50817867 rofefod A March 5, 2019, 12:18 p.m. OK Haskell TESTS 22 31 102400 800
52651464 jedikni A April 12, 2019, 4:49 p.m. OK Haskell TESTS 22 46 102400 800
68389136 o33202919 A Jan. 8, 2020, 7:44 a.m. OK Java 11 TESTS 22 202 0 800
59495418 ijxjdjd A Aug. 25, 2019, 9:46 p.m. OK Java 8 TESTS 22 108 0 800
53256951 continued258 A April 24, 2019, 5:07 p.m. OK Java 8 TESTS 22 108 0 800
50585274 Harbin A Feb. 28, 2019, 2:53 a.m. OK Java 8 TESTS 22 108 0 800
50579413 TheCodeFather A Feb. 27, 2019, 8:04 p.m. OK Java 8 TESTS 22 108 0 800
50469073 sweiss A Feb. 24, 2019, 10:10 p.m. OK Java 8 TESTS 22 108 0 800
50433413 pingie050 A Feb. 24, 2019, 3:21 p.m. OK Java 8 TESTS 22 108 0 800
68228969 Kavi.Prajapati A Jan. 5, 2020, 8:24 a.m. OK Java 8 TESTS 22 109 0 800
67031000 mubir A Dec. 16, 2019, 3:50 p.m. OK Java 8 TESTS 22 109 0 800
58085352 BerserkVl A July 31, 2019, 3:21 p.m. OK Java 8 TESTS 22 109 0 800
57914244 vvenkai A July 28, 2019, 11:31 p.m. OK Java 8 TESTS 22 109 0 800
50573686 VladSabre A Feb. 27, 2019, 4:49 p.m. OK JavaScript TESTS 22 31 0 800
65509438 Spheniscine A Nov. 22, 2019, 2:24 a.m. OK Kotlin TESTS 22 109 0 800
50476564 Killer45 A Feb. 25, 2019, 6:22 a.m. OK Kotlin TESTS 22 109 0 800
50412731 I.A.K.O.V A Feb. 24, 2019, 4:14 a.m. OK Kotlin TESTS 22 109 0 800
50408418 Quaternion A Feb. 23, 2019, 11:09 p.m. OK Kotlin TESTS 22 124 102400 800
50878372 ondrej.konecny A March 6, 2019, 7:46 a.m. OK Kotlin TESTS 22 140 102400 800
50759591 AlexTemp A March 3, 2019, 6:38 p.m. OK Mono C# TESTS 22 46 0 800
54989950 Ruban_Denic A June 2, 2019, 6:02 p.m. OK Mono C# TESTS 22 46 0 800
54819472 camypaper A May 30, 2019, 12:31 a.m. OK Mono C# TESTS 22 46 0 800
53681814 buklyakey A May 2, 2019, 7:50 p.m. OK Mono C# TESTS 22 46 0 800
52445823 GusztavSzmolik A April 7, 2019, 7:58 a.m. OK Mono C# TESTS 22 46 0 800
50639215 bobo_bobo A March 1, 2019, 1:11 p.m. OK Mono C# TESTS 22 46 0 800
50601183 lewasupaman SaurumanS LapsleyJuno A Feb. 28, 2019, 12:46 p.m. OK Mono C# TESTS 22 46 0 800
50591311 Ziddo A Feb. 28, 2019, 7:37 a.m. OK Mono C# TESTS 22 46 0 800
50570680 Kalamona A Feb. 27, 2019, 3:15 p.m. OK Mono C# TESTS 22 46 0 800
50507278 nemars A Feb. 25, 2019, 8:37 p.m. OK Mono C# TESTS 22 46 0 800
53306972 vjudge4 A April 26, 2019, 3:44 a.m. OK MS C++ TESTS 22 15 0 800
51970149 EnderXiao A March 29, 2019, noon OK MS C++ TESTS 22 15 0 800
65480394 vjudge2 A Nov. 21, 2019, 11:29 a.m. OK MS C++ TESTS 22 15 0 800
50629819 vmor951 A March 1, 2019, 8:28 a.m. OK MS C++ TESTS 22 15 0 800
65614388 vjudge3 A Nov. 24, 2019, 2:23 a.m. OK MS C++ TESTS 22 30 0 800
58171754 vjudge2 A Aug. 2, 2019, 11:37 a.m. OK MS C++ TESTS 22 30 0 800
65572655 vjudge3 A Nov. 23, 2019, 8:22 a.m. OK MS C++ TESTS 22 30 0 800
65263530 vjudge4 A Nov. 17, 2019, 3:52 p.m. OK MS C++ TESTS 22 30 0 800
65524486 vjudge4 A Nov. 22, 2019, 9:47 a.m. OK MS C++ TESTS 22 30 0 800
65620658 vjudge2 A Nov. 24, 2019, 6:05 a.m. OK MS C++ TESTS 22 30 0 800
52471558 max2000turbo2 A April 7, 2019, 6:55 p.m. OK MS C++ 2017 TESTS 22 15 0 800
50635368 mech A March 1, 2019, 11:32 a.m. OK MS C++ 2017 TESTS 22 15 0 800
50558023 greatwym A Feb. 27, 2019, 9:11 a.m. OK MS C++ 2017 TESTS 22 15 0 800
51331132 MRamanauskas A March 15, 2019, 12:12 p.m. OK MS C++ 2017 TESTS 22 30 0 800
51617384 Onlykarting A March 21, 2019, 12:57 p.m. OK MS C++ 2017 TESTS 22 30 0 800
52551574 parisa.mqdm A April 10, 2019, 4:59 a.m. OK MS C++ 2017 TESTS 22 30 0 800
53861107 Mr.semicolon A May 7, 2019, 8:22 p.m. OK MS C++ 2017 TESTS 22 30 0 800
55203970 ctrlc-ctrlv A June 6, 2019, 11:47 a.m. OK MS C++ 2017 TESTS 22 30 0 800
57941408 yorky A July 29, 2019, 12:42 p.m. OK MS C++ 2017 TESTS 22 30 0 800
66473384 Tangerine A Dec. 7, 2019, 7:25 p.m. OK MS C++ 2017 TESTS 22 30 0 800
50503141 htrapole A Feb. 25, 2019, 6:13 p.m. OK Node.js TESTS 22 171 409600 800
50383829 jakutis A Feb. 23, 2019, 12:10 p.m. OK Ocaml TESTS 22 31 0 800
50497558 Stanislav666 A Feb. 25, 2019, 3:48 p.m. OK PascalABC.NET TESTS 22 171 0 800
50893603 fanos A March 6, 2019, 2:07 p.m. OK PascalABC.NET TESTS 22 171 0 800
50604802 sbairammariabs A Feb. 28, 2019, 2:08 p.m. OK PascalABC.NET TESTS 22 171 0 800
50604603 sbairammariabs A Feb. 28, 2019, 2:04 p.m. OK PascalABC.NET TESTS 22 186 0 800
60308420 koptev A Sept. 9, 2019, 2:49 p.m. OK PascalABC.NET TESTS 22 186 0 800
68680006 Nidavellir A Jan. 12, 2020, 9:04 p.m. OK PascalABC.NET TESTS 22 295 102400 800
67681608 02041505Zaharova A Dec. 27, 2019, 6:42 a.m. OK PascalABC.NET TESTS 22 296 307200 800
67684593 02041505surina A Dec. 27, 2019, 8:16 a.m. OK PascalABC.NET TESTS 22 296 409600 800
67684425 02041505Kokidko A Dec. 27, 2019, 8:11 a.m. OK PascalABC.NET TESTS 22 296 409600 800
67684788 02041505Tofan A Dec. 27, 2019, 8:21 a.m. OK PascalABC.NET TESTS 22 311 409600 800
50398219 mayakin A Feb. 23, 2019, 4:55 p.m. OK PHP TESTS 22 31 409600 800
50672061 SoSooding A March 2, 2019, 7:31 a.m. OK PyPy 2 TESTS 22 109 0 800
50410060 masonsbro A Feb. 24, 2019, 1:31 a.m. OK PyPy 2 TESTS 22 109 0 800
50492347 GuybrushThreepwood A Feb. 25, 2019, 1:48 p.m. OK PyPy 2 TESTS 22 124 0 800
54636954 chaudhary_19 A May 25, 2019, 5:33 p.m. OK PyPy 2 TESTS 22 124 307200 800
52789135 shehebe A April 15, 2019, 4:17 p.m. OK PyPy 2 TESTS 22 155 1228800 800
50388890 gatsko A Feb. 23, 2019, 1:18 p.m. OK PyPy 2 TESTS 22 155 1945600 800
54728676 raj1307 A May 27, 2019, 9:08 p.m. OK PyPy 2 TESTS 22 186 307200 800
68095063 palliative A Jan. 2, 2020, 8:12 p.m. OK PyPy 3 TESTS 22 124 0 800
60734136 denis.nasyrov A Sept. 17, 2019, 4:49 p.m. OK PyPy 3 TESTS 22 124 0 800
60641291 Yordan_Iliev A Sept. 15, 2019, 3:30 p.m. OK PyPy 3 TESTS 22 124 0 800
54743015 Edge11 A May 28, 2019, 9:01 a.m. OK PyPy 3 TESTS 22 124 0 800
54636903 Aidos A May 25, 2019, 5:31 p.m. OK PyPy 3 TESTS 22 124 0 800
54392715 Suto82 A May 19, 2019, 5:30 p.m. OK PyPy 3 TESTS 22 124 0 800
54221630 vjudge1 A May 16, 2019, 3:43 a.m. OK PyPy 3 TESTS 22 124 0 800
52271712 Zhenya15072003 A April 3, 2019, 1:21 p.m. OK PyPy 3 TESTS 22 124 0 800
56815893 rasaviharhouse A July 10, 2019, 7:07 p.m. OK PyPy 3 TESTS 22 124 0 800
68418079 tadashi99 A Jan. 8, 2020, 7:57 p.m. OK PyPy 3 TESTS 22 124 0 800
50548594 franckmy A Feb. 27, 2019, 1:08 a.m. OK Python 2 TESTS 22 170 0 800
50498595 prateek_ch A Feb. 25, 2019, 4:12 p.m. OK Python 2 TESTS 22 171 0 800
55670064 shubhankarsharma00 A June 17, 2019, 6:59 a.m. OK Python 2 TESTS 22 171 0 800
52682221 kaif_7 A April 13, 2019, 1:02 p.m. OK Python 2 TESTS 22 171 0 800
50546699 ryanr1230 A Feb. 26, 2019, 10:07 p.m. OK Python 2 TESTS 22 171 0 800
50532836 adi28galaxyak A Feb. 26, 2019, 2:21 p.m. OK Python 2 TESTS 22 171 0 800
50510737 nealzane A Feb. 26, 2019, 12:06 a.m. OK Python 2 TESTS 22 171 0 800
50424361 b8810850 A Feb. 24, 2019, 10:44 a.m. OK Python 2 TESTS 22 171 0 800
50392854 bhuwanchandra.it A Feb. 23, 2019, 2:36 p.m. OK Python 2 TESTS 22 171 0 800
50391909 bhuwanchandra.it A Feb. 23, 2019, 2:15 p.m. OK Python 2 TESTS 22 171 0 800
53018381 sonhuytranpython2 A April 19, 2019, 3:17 p.m. OK Python 3 TESTS 22 93 0 800
51947031 sajjad_firouze A March 28, 2019, 5:28 p.m. OK Python 3 TESTS 22 93 0 800
50683941 tanish36 A March 2, 2019, 12:48 p.m. OK Python 3 TESTS 22 93 0 800
50632453 _swarna A March 1, 2019, 9:52 a.m. OK Python 3 TESTS 22 93 0 800
50575983 tristancooper A Feb. 27, 2019, 6:06 p.m. OK Python 3 TESTS 22 93 0 800
50500309 dolphingarlic A Feb. 25, 2019, 4:57 p.m. OK Python 3 TESTS 22 93 0 800
50404452 i_am_ashnpy A Feb. 23, 2019, 7:50 p.m. OK Python 3 TESTS 22 93 0 800
50420949 Ouech A Feb. 24, 2019, 9:02 a.m. OK Python 3 TESTS 22 93 0 800
50422980 h8191 A Feb. 24, 2019, 10:02 a.m. OK Python 3 TESTS 22 93 0 800
50468665 haydent A Feb. 24, 2019, 9:44 p.m. OK Python 3 TESTS 22 93 0 800
59523415 fshuto A Aug. 26, 2019, 12:38 p.m. OK Ruby TESTS 22 61 0 800
65416935 megachuhancer A Nov. 20, 2019, 7:19 a.m. OK Ruby TESTS 22 93 0 800
50689825 ikarus13 A March 2, 2019, 3:09 p.m. OK Rust TESTS 22 31 0 800
50819304 NickLatkovich A March 5, 2019, 12:52 p.m. OK Rust TESTS 22 31 0 800
50972463 kafun A March 7, 2019, 4:55 p.m. OK Rust TESTS 22 31 0 800

remove filters

Back to search problems