Codeforces Round 812 (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
1713 Codeforces Round 812 (Div. 2) FINISHED False 7200 77469863 Aug. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22144 ) A Traveling Salesman Problem PROGRAMMING geometry greedy implementation 800

B'You are living on an infinite plane with the Cartesian coordinate system on it. In one move you can go to any of the four adjacent points (left, right, up, down). More formally, if you are standing at the point (x, y) , you can: There are n boxes on this plane. The i -th box has coordinates (x_i,y_i) . It is guaranteed that the boxes are either on the x -axis or the y -axis. That is, either x_i=0 or y_i=0 . You can collect a box if you and the box are at the same point. Find the minimum number of moves you have to perform to collect all of these boxes if you have to start and finish at the point (0,0) . The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the number of boxes. The i -th line of the following n lines contains two integers x_i and y_i ( -100 <= x_i, y_i <= 100 ) -- the coordinate of the i -th box. It is guaranteed that either x_i=0 or y_i=0 . Do note that the sum of n over all test cases is not bounded. For each test case output a single integer -- the minimum number of moves required. In the first test case, a possible sequence of moves that uses the minimum number of moves required is shown below. In the second test case, a possible sequence of moves that uses the minimum number of moves required is shown below. In the third test case, we can collect all boxes without making any moves. '...

Tutorials

Codeforces Round #812 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
167299146 TheILICH A Aug. 6, 2022, 4:24 p.m. OK C# 10 TESTS 16 93 3072000 800
167352773 jaypal_verma12 A Aug. 7, 2022, 5:36 a.m. OK Clang++17 Diagnostics TESTS 16 77 0 800
167325387 Yash_Jaiswal A Aug. 6, 2022, 8:31 p.m. OK Clang++17 Diagnostics TESTS 16 77 3174400 800
167326223 Yash_Jaiswal A Aug. 6, 2022, 8:43 p.m. OK Clang++17 Diagnostics TESTS 16 93 0 800
167304685 chip123 A Aug. 6, 2022, 4:34 p.m. OK FPC TESTS 16 15 0 800
167352358 Chetan_2705 A Aug. 7, 2022, 5:31 a.m. OK GNU C11 TESTS 16 15 0 800
167304002 ColdToast_003 A Aug. 6, 2022, 4:33 p.m. OK GNU C11 TESTS 16 15 0 800
167326519 shootoon A Aug. 6, 2022, 8:48 p.m. OK GNU C11 TESTS 16 15 0 800
167332664 LeonGymretzka A Aug. 6, 2022, 10:59 p.m. OK GNU C11 TESTS 16 15 0 800
167321055 zTinus A Aug. 6, 2022, 7:36 p.m. OK GNU C11 TESTS 16 15 0 800
167343319 shaeakh A Aug. 7, 2022, 3:08 a.m. OK GNU C11 TESTS 16 15 0 800
167327133 shootoon A Aug. 6, 2022, 8:58 p.m. OK GNU C11 TESTS 16 30 0 800
167347496 Cloud09 A Aug. 7, 2022, 4:19 a.m. OK GNU C11 TESTS 16 31 0 800
167344215 YiLinG A Aug. 7, 2022, 3:22 a.m. OK GNU C11 TESTS 16 31 0 800
167354668 PARVATHY_V_P A Aug. 7, 2022, 5:57 a.m. OK GNU C11 TESTS 16 31 0 800
167341451 eds1 A Aug. 7, 2022, 2:34 a.m. OK GNU C++14 TESTS 16 0 0 800
167348226 Reisen_ A Aug. 7, 2022, 4:32 a.m. OK GNU C++14 TESTS 16 15 0 800
167348017 oreki123 A Aug. 7, 2022, 4:28 a.m. OK GNU C++14 TESTS 16 15 0 800
167347097 akashranjan4356 A Aug. 7, 2022, 4:12 a.m. OK GNU C++14 TESTS 16 15 0 800
167348470 zhtt0 A Aug. 7, 2022, 4:36 a.m. OK GNU C++14 TESTS 16 15 0 800
167348521 ReyVenom A Aug. 7, 2022, 4:37 a.m. OK GNU C++14 TESTS 16 15 0 800
167349981 hulashkrhk A Aug. 7, 2022, 4:59 a.m. OK GNU C++14 TESTS 16 15 0 800
167350448 Jenish_ A Aug. 7, 2022, 5:06 a.m. OK GNU C++14 TESTS 16 15 0 800
167351182 l3vel A Aug. 7, 2022, 5:15 a.m. OK GNU C++14 TESTS 16 15 0 800
167352316 divashk A Aug. 7, 2022, 5:30 a.m. OK GNU C++14 TESTS 16 15 0 800
167354169 vatsaldp A Aug. 7, 2022, 5:52 a.m. OK GNU C++17 TESTS 16 15 0 800
167354468 yassatamer99 A Aug. 7, 2022, 5:55 a.m. OK GNU C++17 TESTS 16 15 0 800
167354332 vivekteja411 A Aug. 7, 2022, 5:54 a.m. OK GNU C++17 TESTS 16 15 0 800
167354296 devubavaria A Aug. 7, 2022, 5:53 a.m. OK GNU C++17 TESTS 16 15 0 800
167354259 Rahul_Appu A Aug. 7, 2022, 5:53 a.m. OK GNU C++17 TESTS 16 15 0 800
167355143 sreevardhan A Aug. 7, 2022, 6:03 a.m. OK GNU C++17 TESTS 16 15 0 800
167354645 av192 A Aug. 7, 2022, 5:57 a.m. OK GNU C++17 TESTS 16 15 0 800
167354686 asaecs2 A Aug. 7, 2022, 5:57 a.m. OK GNU C++17 TESTS 16 15 0 800
167354908 shivaga A Aug. 7, 2022, 6 a.m. OK GNU C++17 TESTS 16 15 0 800
167354539 vipul_singh A Aug. 7, 2022, 5:56 a.m. OK GNU C++17 TESTS 16 15 0 800
167317281 TawfiQ_s A Aug. 6, 2022, 6:57 p.m. OK GNU C++17 (64) TESTS 16 0 0 800
167313304 MateoCV A Aug. 6, 2022, 6:25 p.m. OK GNU C++17 (64) TESTS 16 0 0 800
167344820 KG26 A Aug. 7, 2022, 3:32 a.m. OK GNU C++17 (64) TESTS 16 0 0 800
167351536 FGN06 A Aug. 7, 2022, 5:20 a.m. OK GNU C++17 (64) TESTS 16 0 7987200 800
167348032 importlogic A Aug. 7, 2022, 4:29 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167349126 Bit_Master_2205 A Aug. 7, 2022, 4:46 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167348852 Batrow A Aug. 7, 2022, 4:42 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167348179 -wicton- A Aug. 7, 2022, 4:31 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167345146 saitejapendram A Aug. 7, 2022, 3:37 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167344961 komeiji_koishi514 A Aug. 7, 2022, 3:34 a.m. OK GNU C++17 (64) TESTS 16 15 0 800
167337496 mhq A Aug. 7, 2022, 1:14 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167338948 LoHhhha A Aug. 7, 2022, 1:47 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167342655 pranav.cse.20001 A Aug. 7, 2022, 2:57 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167345308 Saikat_deb A Aug. 7, 2022, 3:40 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167347577 XBuriza A Aug. 7, 2022, 4:21 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167349043 learner__ A Aug. 7, 2022, 4:45 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167350967 _FireGhost_ A Aug. 7, 2022, 5:12 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167351580 Azkarizqullah A Aug. 7, 2022, 5:20 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167353686 C___ A Aug. 7, 2022, 5:46 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167354200 airths A Aug. 7, 2022, 5:52 a.m. OK GNU C++20 (64) TESTS 16 0 0 800
167351581 __Serendipity A Aug. 7, 2022, 5:20 a.m. OK Java 11 TESTS 16 171 0 800
167345891 akumar1503 A Aug. 7, 2022, 3:49 a.m. OK Java 11 TESTS 16 171 0 800
167323373 AlaaHsiahm02 A Aug. 6, 2022, 8:04 p.m. OK Java 11 TESTS 16 171 0 800
167318457 veerabhadra A Aug. 6, 2022, 7:09 p.m. OK Java 11 TESTS 16 171 0 800
167315633 satyaa_78 A Aug. 6, 2022, 6:42 p.m. OK Java 11 TESTS 16 171 0 800
167314751 g_square A Aug. 6, 2022, 6:34 p.m. OK Java 11 TESTS 16 171 0 800
167330673 djrfrn A Aug. 6, 2022, 10:07 p.m. OK Java 11 TESTS 16 186 0 800
167330314 kyaruru A Aug. 6, 2022, 9:58 p.m. OK Java 11 TESTS 16 186 0 800
167316497 dzhi A Aug. 6, 2022, 6:50 p.m. OK Java 11 TESTS 16 186 0 800
167345016 amitmandal A Aug. 7, 2022, 3:35 a.m. OK Java 11 TESTS 16 187 0 800
167330921 _Astron A Aug. 6, 2022, 10:12 p.m. OK Java 17 TESTS 16 186 512000 800
167352870 sad_truant A Aug. 7, 2022, 5:37 a.m. OK Java 17 TESTS 16 202 512000 800
167317306 bhavesh1914 A Aug. 6, 2022, 6:58 p.m. OK Java 17 TESTS 16 218 819200 800
167318454 Solqr A Aug. 6, 2022, 7:09 p.m. OK Java 17 TESTS 16 233 512000 800
167322688 isPritchin A Aug. 6, 2022, 7:56 p.m. OK Java 17 TESTS 16 233 716800 800
167317315 ranivore A Aug. 6, 2022, 6:58 p.m. OK Java 17 TESTS 16 249 512000 800
167353947 dk.shivam916 A Aug. 7, 2022, 5:49 a.m. OK Java 17 TESTS 16 264 512000 800
167301320 Dukkha A Aug. 6, 2022, 4:29 p.m. OK Java 17 TESTS 16 265 614400 800
167303091 sickmick A Aug. 6, 2022, 4:32 p.m. OK Java 17 TESTS 16 327 1024000 800
167354959 aryaman_571 A Aug. 7, 2022, 6:01 a.m. OK Java 8 TESTS 16 93 0 800
167353250 swaggy_baba A Aug. 7, 2022, 5:40 a.m. OK Java 8 TESTS 16 93 0 800
167334019 Mustafa__ A Aug. 6, 2022, 11:38 p.m. OK Java 8 TESTS 16 93 0 800
167325814 ahmedtawfik A Aug. 6, 2022, 8:38 p.m. OK Java 8 TESTS 16 93 0 800
167322369 CrinklyGolem A Aug. 6, 2022, 7:52 p.m. OK Java 8 TESTS 16 93 0 800
167318020 Kaldaruly A Aug. 6, 2022, 7:04 p.m. OK Java 8 TESTS 16 108 0 800
167339439 handle007 A Aug. 7, 2022, 1:58 a.m. OK Java 8 TESTS 16 109 0 800
167354489 Swaroop369 A Aug. 7, 2022, 5:55 a.m. OK Java 8 TESTS 16 109 0 800
167339466 Koka A Aug. 7, 2022, 1:59 a.m. OK Java 8 TESTS 16 109 0 800
167322101 T_PAVAN_NAGARAJU A Aug. 6, 2022, 7:48 p.m. OK Java 8 TESTS 16 109 0 800
167348235 vineet11 A Aug. 7, 2022, 4:32 a.m. OK MS C++ 2017 TESTS 16 31 0 800
167347967 Matthew0730 A Aug. 7, 2022, 4:28 a.m. OK MS C++ 2017 TESTS 16 31 0 800
167345414 karanvaishnavc A Aug. 7, 2022, 3:41 a.m. OK MS C++ 2017 TESTS 16 31 0 800
167337937 thoanhkhoa2702 A Aug. 7, 2022, 1:24 a.m. OK MS C++ 2017 TESTS 16 31 0 800
167334479 hua_yi_jiu A Aug. 6, 2022, 11:52 p.m. OK MS C++ 2017 TESTS 16 31 0 800
167329659 khrystyna_dol A Aug. 6, 2022, 9:44 p.m. OK MS C++ 2017 TESTS 16 31 0 800
167321965 nitu321 A Aug. 6, 2022, 7:46 p.m. OK MS C++ 2017 TESTS 16 31 0 800
167313755 Tan2K A Aug. 6, 2022, 6:28 p.m. OK MS C++ 2017 TESTS 16 31 0 800
167301215 Nosov_Vovanus2022 A Aug. 6, 2022, 4:29 p.m. OK MS C++ 2017 TESTS 16 31 0 800
167312013 sinner_prashant A Aug. 6, 2022, 6:18 p.m. OK MS C++ 2017 TESTS 16 31 204800 800
167317889 rsFalse A Aug. 6, 2022, 7:03 p.m. OK Perl TESTS 16 62 0 800
167333915 WalrusRamen21 A Aug. 6, 2022, 11:34 p.m. OK PHP TESTS 16 187 409600 800
167324588 1_2_3_4_5_9 A Aug. 6, 2022, 8:20 p.m. OK PyPy 2 TESTS 16 155 6451200 800
167352371 uz2ee A Aug. 7, 2022, 5:31 a.m. OK PyPy 3 TESTS 16 93 2355200 800
167333989 bettyyw A Aug. 6, 2022, 11:37 p.m. OK PyPy 3 TESTS 16 187 3481600 800
167312123 shriom533 A Aug. 6, 2022, 6:19 p.m. OK PyPy 3 TESTS 16 202 3379200 800
167321378 Feet_McYeet A Aug. 6, 2022, 7:40 p.m. OK PyPy 3 TESTS 16 202 3584000 800
167315264 pushsin089 A Aug. 6, 2022, 6:39 p.m. OK PyPy 3 TESTS 16 202 3584000 800
167344154 tarunrao963040 A Aug. 7, 2022, 3:21 a.m. OK PyPy 3 TESTS 16 218 3788800 800
167351521 rajn5181 A Aug. 7, 2022, 5:20 a.m. OK PyPy 3 TESTS 16 218 3891200 800
167324712 namak_kun A Aug. 6, 2022, 8:21 p.m. OK PyPy 3 TESTS 16 218 4198400 800
167316863 dwen A Aug. 6, 2022, 6:53 p.m. OK PyPy 3 TESTS 16 233 3584000 800
167346589 MohammadsadraSedighin A Aug. 7, 2022, 4:03 a.m. OK PyPy 3 TESTS 16 296 3481600 800
167342738 Anti-Neutrino A Aug. 7, 2022, 2:59 a.m. OK PyPy 3-64 TESTS 16 62 1945600 800
167353599 kwin A Aug. 7, 2022, 5:45 a.m. OK PyPy 3-64 TESTS 16 62 2048000 800
167321949 ASawe2.6Main A Aug. 6, 2022, 7:46 p.m. OK PyPy 3-64 TESTS 16 77 1945600 800
167341192 Youarenotgood A Aug. 7, 2022, 2:29 a.m. OK PyPy 3-64 TESTS 16 77 2764800 800
167328666 gesuta A Aug. 6, 2022, 9:25 p.m. OK PyPy 3-64 TESTS 16 77 3379200 800
167338806 staycurious A Aug. 7, 2022, 1:44 a.m. OK PyPy 3-64 TESTS 16 93 3174400 800
167337388 sjNxksbzj A Aug. 7, 2022, 1:11 a.m. OK PyPy 3-64 TESTS 16 93 4915200 800
167328288 a_vantik_a A Aug. 6, 2022, 9:17 p.m. OK PyPy 3-64 TESTS 16 108 3276800 800
167313380 gesuta A Aug. 6, 2022, 6:25 p.m. OK PyPy 3-64 TESTS 16 109 3072000 800
167319535 SangeetaSingh A Aug. 6, 2022, 7:20 p.m. OK PyPy 3-64 TESTS 16 109 3481600 800
167348789 Ahmed.I_SundarSTEM A Aug. 7, 2022, 4:41 a.m. OK Python 3 TESTS 16 46 0 800
167325312 Ashishsancheti_01 A Aug. 6, 2022, 8:30 p.m. OK Python 3 TESTS 16 46 0 800
167324524 elistark A Aug. 6, 2022, 8:19 p.m. OK Python 3 TESTS 16 46 0 800
167352873 20cs3045 A Aug. 7, 2022, 5:37 a.m. OK Python 3 TESTS 16 61 0 800
167316345 eugalt A Aug. 6, 2022, 6:48 p.m. OK Python 3 TESTS 16 61 0 800
167347128 nath01 A Aug. 7, 2022, 4:12 a.m. OK Python 3 TESTS 16 62 0 800
167341821 quangnhan2006 A Aug. 7, 2022, 2:42 a.m. OK Python 3 TESTS 16 62 0 800
167337985 MohaSa A Aug. 7, 2022, 1:25 a.m. OK Python 3 TESTS 16 62 0 800
167325273 _Code_till_death_ A Aug. 6, 2022, 8:30 p.m. OK Python 3 TESTS 16 62 0 800
167325239 Nivas2003 A Aug. 6, 2022, 8:29 p.m. OK Python 3 TESTS 16 62 0 800
167336026 utkarsh A Aug. 7, 2022, 12:35 a.m. OK Ruby 3 TESTS 16 249 204800 800
167337880 MvKaio A Aug. 7, 2022, 1:23 a.m. OK Rust 2021 TESTS 16 15 0 800
167324741 tngyl A Aug. 6, 2022, 8:22 p.m. OK Rust 2021 TESTS 16 15 0 800

remove filters

Back to search problems