Codeforces Round 816 (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
1715 Codeforces Round 816 (Div. 2) FINISHED False 8100 70817099 Aug. 20, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23597 ) A Crossmarket PROGRAMMING constructive algorithms greedy math

B'Stanley and Megan decided to shop in the "Crossmarket" grocery store, which can be represented as a matrix with n rows and m columns. Stanley and Megan can move to an adjacent cell using 1 unit of power. Two cells are considered adjacent if they share an edge. To speed up the shopping process, Megan brought her portals with her, and she leaves one in each cell she visits (if there is no portal yet). If a person (Stanley or Megan) is in a cell with a portal, that person can use 1 unit of power to teleport to any other cell with a portal, including Megan 's starting cell. They decided to split up: Stanley will go from the upper-left cell (cell with coordinates (1, 1) ) to the lower-right cell (cell with coordinates (n, m) ), whilst Megan needs to get from the lower-left cell (cell with coordinates (n, 1) ) to the upper-right cell (cell with coordinates (1, m) ). What is the minimum total energy needed for them both to do that? Note that they can choose the time they move. Time does not affect energy. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Description of the test cases follows. The only line in the test case contains two integers n and m ( 1 <= n, m <= 10^5 ). For each test case print a single integer on a new line xe2 x80 x93 the answer. In the first test case they can stick to the following plan: The total energy spent is (2 + 6) + (2 + 1 + 2) + (2)= 15 , which is our final answer. '...

Tutorials

Codeforces Round #816 (Div. 2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
169278871 thatUsualGuy A Aug. 21, 2022, 9:07 p.m. OK C# 10 TESTS 12 46 307200
169229301 Remme A Aug. 21, 2022, 11:17 a.m. OK C# 10 TESTS 12 46 409600
169203705 6-_-9 A Aug. 21, 2022, 6:20 a.m. OK C# 10 TESTS 12 62 614400
169340301 cibey A Aug. 22, 2022, 1:51 p.m. OK C# 10 TESTS 12 77 307200
169192436 Galya2 A Aug. 21, 2022, 2:58 a.m. OK C# 10 TESTS 12 109 307200
169203442 6-_-9 A Aug. 21, 2022, 6:16 a.m. OK C# 10 TESTS 12 109 512000
169344553 s41nt A Aug. 22, 2022, 2:33 p.m. OK C# 8 TESTS 12 77 102400
169375440 FatalityNT A Aug. 22, 2022, 9:06 p.m. OK C# 8 TESTS 12 92 512000
169343915 s41nt A Aug. 22, 2022, 2:26 p.m. OK C# 8 TESTS 12 93 614400
169224384 xuruichen A Aug. 21, 2022, 10:26 a.m. OK Clang++17 Diagnostics TESTS 12 46 0
169365831 HuaTsai A Aug. 22, 2022, 6:25 p.m. OK Clang++20 Diagnostics TESTS 12 46 0
169269459 diralik A Aug. 21, 2022, 6:31 p.m. OK Clang++20 Diagnostics TESTS 12 46 0
169189713 sthita_19 A Aug. 21, 2022, 1:59 a.m. OK GNU C11 TESTS 12 15 0
169225443 spncoder A Aug. 21, 2022, 10:37 a.m. OK GNU C11 TESTS 12 15 0
169225513 spncoder A Aug. 21, 2022, 10:37 a.m. OK GNU C11 TESTS 12 15 0
169249103 ivanshubin A Aug. 21, 2022, 2:49 p.m. OK GNU C11 TESTS 12 15 0
169366595 N20070 A Aug. 22, 2022, 6:35 p.m. OK GNU C11 TESTS 12 15 0
169202889 charan_singupuram A Aug. 21, 2022, 6:08 a.m. OK GNU C11 TESTS 12 30 0
169261055 gcet_2024 A Aug. 21, 2022, 4:59 p.m. OK GNU C11 TESTS 12 31 0
169339323 LP_fan A Aug. 22, 2022, 1:42 p.m. OK GNU C11 TESTS 12 31 0
169357491 sabbirahmmad20 A Aug. 22, 2022, 4:52 p.m. OK GNU C11 TESTS 12 31 0
169247829 ananya123 A Aug. 21, 2022, 2:34 p.m. OK GNU C11 TESTS 12 31 0
169288177 Bender2 A Aug. 22, 2022, 1:57 a.m. OK GNU C++14 TESTS 12 0 0
169283537 0x0000 A Aug. 21, 2022, 11:28 p.m. OK GNU C++14 TESTS 12 0 0
169273518 mikeeedanilov A Aug. 21, 2022, 7:26 p.m. OK GNU C++14 TESTS 12 0 0
169269919 Sayed_Riad A Aug. 21, 2022, 6:37 p.m. OK GNU C++14 TESTS 12 0 0
169244276 Tutul_dhar A Aug. 21, 2022, 1:58 p.m. OK GNU C++14 TESTS 12 0 0
169325918 Adamska A Aug. 22, 2022, 11:18 a.m. OK GNU C++14 TESTS 12 0 0
169331313 pallavi-1812 A Aug. 22, 2022, 12:18 p.m. OK GNU C++14 TESTS 12 0 0
169339398 behuymummim A Aug. 22, 2022, 1:42 p.m. OK GNU C++14 TESTS 12 0 0
169354658 dsabolic A Aug. 22, 2022, 4:21 p.m. OK GNU C++14 TESTS 12 0 0
169378780 IPJ A Aug. 22, 2022, 10:36 p.m. OK GNU C++14 TESTS 12 0 0
169336631 Deathspeed A Aug. 22, 2022, 1:13 p.m. OK GNU C++17 TESTS 12 0 0
169342030 Rayhanul_Amin_Tanvir A Aug. 22, 2022, 2:07 p.m. OK GNU C++17 TESTS 12 0 0
169357138 Tranquangminh A Aug. 22, 2022, 4:48 p.m. OK GNU C++17 TESTS 12 0 0
169376676 Bogdan228 A Aug. 22, 2022, 9:35 p.m. OK GNU C++17 TESTS 12 0 0
169388357 manohar_naga A Aug. 23, 2022, 5:19 a.m. OK GNU C++17 TESTS 12 0 0
169328574 Enigma20 A Aug. 22, 2022, 11:48 a.m. OK GNU C++17 TESTS 12 0 0
169318127 zefyrus A Aug. 22, 2022, 9:50 a.m. OK GNU C++17 TESTS 12 0 0
169313996 Momen-G-Ar A Aug. 22, 2022, 9:06 a.m. OK GNU C++17 TESTS 12 0 0
169309814 sajedaswad A Aug. 22, 2022, 8:19 a.m. OK GNU C++17 TESTS 12 0 0
169302106 the_computer_jock A Aug. 22, 2022, 6:40 a.m. OK GNU C++17 TESTS 12 0 0
169319858 ssm_harsh A Aug. 22, 2022, 10:09 a.m. OK GNU C++17 (64) TESTS 12 0 0
169347361 Rick_GT A Aug. 22, 2022, 3:03 p.m. OK GNU C++17 (64) TESTS 12 0 0
169332442 Messywind A Aug. 22, 2022, 12:29 p.m. OK GNU C++17 (64) TESTS 12 0 0
169317135 m0fum0fu A Aug. 22, 2022, 9:39 a.m. OK GNU C++17 (64) TESTS 12 0 0
169307994 cjnwq A Aug. 22, 2022, 7:58 a.m. OK GNU C++17 (64) TESTS 12 0 0
169284469 os-moussao A Aug. 22, 2022, 12:05 a.m. OK GNU C++17 (64) TESTS 12 0 0
169279564 Mac.Rose A Aug. 21, 2022, 9:24 p.m. OK GNU C++17 (64) TESTS 12 0 0
169278084 Xc4l16r3 A Aug. 21, 2022, 8:50 p.m. OK GNU C++17 (64) TESTS 12 0 0
169269258 avtobus A Aug. 21, 2022, 6:28 p.m. OK GNU C++17 (64) TESTS 12 0 0
169264700 anuragkumar06243 A Aug. 21, 2022, 5:38 p.m. OK GNU C++17 (64) TESTS 12 0 0
169359044 ryuxxsmx A Aug. 22, 2022, 5:09 p.m. OK GNU C++20 (64) TESTS 12 0 0
169362232 FBI A Aug. 22, 2022, 5:44 p.m. OK GNU C++20 (64) TESTS 12 0 0
169365586 islam_ahmed A Aug. 22, 2022, 6:22 p.m. OK GNU C++20 (64) TESTS 12 0 0
169374074 MokoSucio A Aug. 22, 2022, 8:37 p.m. OK GNU C++20 (64) TESTS 12 0 0
169374106 mz1 A Aug. 22, 2022, 8:38 p.m. OK GNU C++20 (64) TESTS 12 0 0
169375488 MohamedEssam71 A Aug. 22, 2022, 9:08 p.m. OK GNU C++20 (64) TESTS 12 0 0
169375584 MariamElhdad A Aug. 22, 2022, 9:10 p.m. OK GNU C++20 (64) TESTS 12 0 0
169380523 andreslel A Aug. 22, 2022, 11:39 p.m. OK GNU C++20 (64) TESTS 12 0 0
169386174 Makha A Aug. 23, 2022, 3:40 a.m. OK GNU C++20 (64) TESTS 12 0 0
169386264 AlbusX A Aug. 23, 2022, 3:44 a.m. OK GNU C++20 (64) TESTS 12 0 0
169252990 serhiimazurok A Aug. 21, 2022, 3:30 p.m. OK Go TESTS 12 31 204800
169187709 ywxk A Aug. 21, 2022, 1:10 a.m. OK Go TESTS 12 46 0
169292445 diegoximenes A Aug. 22, 2022, 3:33 a.m. OK Go TESTS 12 46 102400
169192356 qwerty12345qwerty A Aug. 21, 2022, 2:57 a.m. OK Java 11 TESTS 12 155 0
169209212 singhshivsm20001 A Aug. 21, 2022, 7:32 a.m. OK Java 11 TESTS 12 156 0
169230723 zenilharia26 A Aug. 21, 2022, 11:32 a.m. OK Java 11 TESTS 12 170 0
169295320 wantu A Aug. 22, 2022, 4:42 a.m. OK Java 11 TESTS 12 171 0
169329636 doomhammer. A Aug. 22, 2022, 11:59 a.m. OK Java 11 TESTS 12 171 0
169207802 harshiteuro A Aug. 21, 2022, 7:13 a.m. OK Java 11 TESTS 12 171 0
169202714 shahvraj1500 A Aug. 21, 2022, 6:05 a.m. OK Java 11 TESTS 12 171 0
169202211 iamsoumik A Aug. 21, 2022, 5:58 a.m. OK Java 11 TESTS 12 171 0
169194962 Deepak4466 A Aug. 21, 2022, 3:50 a.m. OK Java 11 TESTS 12 171 0
169317848 gaju321 A Aug. 22, 2022, 9:47 a.m. OK Java 11 TESTS 12 186 0
169278045 matzhao A Aug. 21, 2022, 8:49 p.m. OK Java 17 TESTS 12 170 307200
169307454 hgaur01 A Aug. 22, 2022, 7:52 a.m. OK Java 17 TESTS 12 187 204800
169347083 tony4875 A Aug. 22, 2022, 3 p.m. OK Java 17 TESTS 12 202 0
169188213 Mamimi A Aug. 21, 2022, 1:23 a.m. OK Java 17 TESTS 12 202 0
169311506 starskolya A Aug. 22, 2022, 8:40 a.m. OK Java 17 TESTS 12 233 512000
169281378 Ayush_i A Aug. 21, 2022, 10:12 p.m. OK Java 17 TESTS 12 248 716800
169334416 tony4875 A Aug. 22, 2022, 12:50 p.m. OK Java 17 TESTS 12 249 0
169334363 tony4875 A Aug. 22, 2022, 12:50 p.m. OK Java 17 TESTS 12 249 512000
169288554 goalboy A Aug. 22, 2022, 2:05 a.m. OK Java 17 TESTS 12 249 512000
169318535 hritikrommie A Aug. 22, 2022, 9:55 a.m. OK Java 17 TESTS 12 249 716800
169292403 Java_Programmer A Aug. 22, 2022, 3:32 a.m. OK Java 8 TESTS 12 93 0
169208079 rookie19 A Aug. 21, 2022, 7:17 a.m. OK Java 8 TESTS 12 93 0
169249153 Mohamed308 A Aug. 21, 2022, 2:49 p.m. OK Java 8 TESTS 12 108 0
169212850 ak_ankit A Aug. 21, 2022, 8:19 a.m. OK Java 8 TESTS 12 108 0
169341178 akarshanand2810 A Aug. 22, 2022, 2 p.m. OK Java 8 TESTS 12 109 0
169217262 Ariful3671 A Aug. 21, 2022, 9:11 a.m. OK Java 8 TESTS 12 109 0
169210946 waynebruce1704 A Aug. 21, 2022, 7:55 a.m. OK Java 8 TESTS 12 109 0
169193887 devptyagi01 A Aug. 21, 2022, 3:28 a.m. OK Java 8 TESTS 12 109 0
169339844 Sanat04 A Aug. 22, 2022, 1:47 p.m. OK Java 8 TESTS 12 124 0
169311682 Lelouch_12 A Aug. 22, 2022, 8:42 a.m. OK Java 8 TESTS 12 124 0
169292114 junehop A Aug. 22, 2022, 3:26 a.m. OK JavaScript TESTS 12 31 1228800
169240823 gelbelachente A Aug. 21, 2022, 1:22 p.m. OK Kotlin 1.6 TESTS 12 202 0
169222605 MikeInferno A Aug. 21, 2022, 10:06 a.m. OK Kotlin 1.6 TESTS 12 217 0
169234442 deveshmittal19 A Aug. 21, 2022, 12:13 p.m. OK MS C++ 2017 TESTS 12 15 0
169226848 1_shivam A Aug. 21, 2022, 10:52 a.m. OK MS C++ 2017 TESTS 12 15 0
169221086 zsy2022 A Aug. 21, 2022, 9:51 a.m. OK MS C++ 2017 TESTS 12 15 0
169189862 lr567 A Aug. 21, 2022, 2:02 a.m. OK MS C++ 2017 TESTS 12 15 0
169347130 cptahahab A Aug. 22, 2022, 3:01 p.m. OK MS C++ 2017 TESTS 12 30 0
169190841 rttyuii A Aug. 21, 2022, 2:24 a.m. OK MS C++ 2017 TESTS 12 30 0
169236966 BigBlueHedgehog A Aug. 21, 2022, 12:41 p.m. OK MS C++ 2017 TESTS 12 31 0
169314933 PavelBesp A Aug. 22, 2022, 9:16 a.m. OK MS C++ 2017 TESTS 12 31 16076800
169219874 gamekoff A Aug. 21, 2022, 9:38 a.m. OK Node.js TESTS 12 46 102400
169192625 Liberator187 A Aug. 21, 2022, 3:03 a.m. OK PyPy 3 TESTS 12 92 1433600
169282607 hxu10 A Aug. 21, 2022, 10:53 p.m. OK PyPy 3 TESTS 12 92 1740800
169295127 C_M_D_O_ A Aug. 22, 2022, 4:37 a.m. OK PyPy 3 TESTS 12 93 1536000
169349875 maciaas A Aug. 22, 2022, 3:29 p.m. OK PyPy 3 TESTS 12 93 1945600
169227121 binilj04 A Aug. 21, 2022, 10:55 a.m. OK PyPy 3 TESTS 12 124 2662400
169244705 LFcowering A Aug. 21, 2022, 2:03 p.m. OK PyPy 3 TESTS 12 139 2969600
169376788 grawlixes A Aug. 22, 2022, 9:38 p.m. OK PyPy 3 TESTS 12 140 2662400
169300495 htrd A Aug. 22, 2022, 6:15 a.m. OK PyPy 3 TESTS 12 140 2662400
169378562 Prakul_Agrawal A Aug. 22, 2022, 10:30 p.m. OK PyPy 3 TESTS 12 140 2867200
169300886 m_o_o_n_s_h_i_n_e_s A Aug. 22, 2022, 6:22 a.m. OK PyPy 3 TESTS 12 140 2969600
169203406 farrellbyu A Aug. 21, 2022, 6:16 a.m. OK PyPy 3-64 TESTS 12 62 0
169377416 nealzane A Aug. 22, 2022, 9:56 p.m. OK PyPy 3-64 TESTS 12 62 1740800
169189246 InariInDream A Aug. 21, 2022, 1:49 a.m. OK PyPy 3-64 TESTS 12 77 1536000
169192945 Youarenotgood A Aug. 21, 2022, 3:09 a.m. OK PyPy 3-64 TESTS 12 77 1638400
169342900 voicon A Aug. 22, 2022, 2:16 p.m. OK PyPy 3-64 TESTS 12 77 2150400
169262222 govindp47 A Aug. 21, 2022, 5:11 p.m. OK PyPy 3-64 TESTS 12 78 2457600
169381379 quangltfsc0378 A Aug. 23, 2022, 12:10 a.m. OK PyPy 3-64 TESTS 12 93 3481600
169273846 lcod A Aug. 21, 2022, 7:32 p.m. OK PyPy 3-64 TESTS 12 108 3379200
169306813 quangnhan2006 A Aug. 22, 2022, 7:43 a.m. OK PyPy 3-64 TESTS 12 109 3379200
169268047 _terenteva A Aug. 21, 2022, 6:15 p.m. OK PyPy 3-64 TESTS 12 109 3379200
169269887 Parkatark A Aug. 21, 2022, 6:36 p.m. OK Python 3 TESTS 12 31 0
169367579 UTTAM_02 A Aug. 22, 2022, 6:48 p.m. OK Python 3 TESTS 12 46 0
169346361 sagarhasan273 A Aug. 22, 2022, 2:53 p.m. OK Python 3 TESTS 12 46 0
169338911 lekzA A Aug. 22, 2022, 1:37 p.m. OK Python 3 TESTS 12 46 0
169337062 WDITzjt A Aug. 22, 2022, 1:18 p.m. OK Python 3 TESTS 12 46 0
169318119 tisheenatani A Aug. 22, 2022, 9:50 a.m. OK Python 3 TESTS 12 46 0
169317799 ChinaMIFan A Aug. 22, 2022, 9:46 a.m. OK Python 3 TESTS 12 46 0
169306014 gla_191500521 A Aug. 22, 2022, 7:33 a.m. OK Python 3 TESTS 12 46 0
169300366 akshit2343 A Aug. 22, 2022, 6:13 a.m. OK Python 3 TESTS 12 46 0
169261809 Jason7128 A Aug. 21, 2022, 5:07 p.m. OK Python 3 TESTS 12 46 0
169223667 p-a-t A Aug. 21, 2022, 10:17 a.m. OK Rust 2021 TESTS 12 0 0
169295570 Svlad_Cjelli A Aug. 22, 2022, 4:48 a.m. OK Rust 2021 TESTS 12 15 0

remove filters

Back to search problems