Codeforces Round 676 (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
1421 Codeforces Round 676 (Div. 2) FINISHED False 7200 134340911 Oct. 18, 2020, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4205 ) D Hexagons PROGRAMMING brute force implementation math shortest paths ternary search

B'Lindsey Buckingham told Stevie Nicks "Go your own way". Nicks is now sad and wants to go away as quickly as possible, but she lives in a 2D hexagonal world. Consider a hexagonal tiling of the plane as on the picture below. Nicks wishes to go from the cell marked (0, 0) to a certain cell given by the coordinates. She may go from a hexagon to any of its six neighbors you want, but there is a cost associated with each of them. The costs depend only on the direction in which you travel. Going from (0, 0) to (1, 1) will take the exact same cost as going from (-2, -1) to (-1, 0) . The costs are given in the input in the order c_1 , c_2 , c_3 , c_4 , c_5 , c_6 as in the picture below. Print the smallest cost of a path from the origin which has coordinates (0, 0) to the given cell. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^{4} ). Description of the test cases follows. The first line of each test case contains two integers x and y ( -10^{9} <= x, y <= 10^{9} ) representing the coordinates of the target hexagon. The second line of each test case contains six integers c_1 , c_2 , c_3 , c_4 , c_5 , c_6 ( 1 <= c_1, c_2, c_3, c_4, c_5, c_6 <= 10^{9} ) representing the six costs of the making one step in a particular direction (refer to the picture above to see which edge is for each value). For each testcase output the smallest cost of a path from the origin to the given cell. The picture below shows the solution for the first sample. The cost 18 is reached by taking c_3 3 times and c_2 once, amounting to 5+5+5+3=18 . '...

Tutorials

Codeforces Round #676 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
95892377 ruban D Oct. 18, 2020, 10:45 a.m. OK Delphi TESTS 41 187 66764800
95897662 babaiserror D Oct. 18, 2020, 11:04 a.m. OK GNU C11 TESTS 41 78 0
95891677 YOK D Oct. 18, 2020, 10:42 a.m. OK GNU C11 TESTS 41 78 0
95895324 ravielze D Oct. 18, 2020, 10:56 a.m. OK GNU C11 TESTS 41 93 0
95942690 siumai D Oct. 19, 2020, 3:32 a.m. OK GNU C11 TESTS 41 93 6144000
95900157 blackbird137 D Oct. 18, 2020, 11:43 a.m. OK GNU C++11 TESTS 41 31 0
95900474 EricQian D Oct. 18, 2020, 11:46 a.m. OK GNU C++11 TESTS 41 31 0
95892612 GNAQ D Oct. 18, 2020, 10:46 a.m. OK GNU C++11 TESTS 41 31 0
95936957 Logey D Oct. 18, 2020, 11:22 p.m. OK GNU C++11 TESTS 41 31 0
95942368 liguanglin D Oct. 19, 2020, 3:23 a.m. OK GNU C++11 TESTS 41 46 0
95938501 chengni D Oct. 19, 2020, 12:51 a.m. OK GNU C++11 TESTS 41 46 0
95938177 2018LZY D Oct. 19, 2020, 12:33 a.m. OK GNU C++11 TESTS 41 46 0
95937954 zj20171 D Oct. 19, 2020, 12:21 a.m. OK GNU C++11 TESTS 41 46 0
95937809 zj20171 D Oct. 19, 2020, 12:13 a.m. OK GNU C++11 TESTS 41 46 0
95945276 1963785534 D Oct. 19, 2020, 4:50 a.m. OK GNU C++11 TESTS 41 46 0
95893468 vickinator D Oct. 18, 2020, 10:49 a.m. OK GNU C++14 TESTS 41 46 0
95887540 xvenom99 D Oct. 18, 2020, 10:26 a.m. OK GNU C++14 TESTS 41 46 0
95943065 scuzt D Oct. 19, 2020, 3:44 a.m. OK GNU C++14 TESTS 41 46 0
95891452 wanshe D Oct. 18, 2020, 10:41 a.m. OK GNU C++14 TESTS 41 46 102400
95892929 krunal9220 D Oct. 18, 2020, 10:47 a.m. OK GNU C++14 TESTS 41 46 204800
95931005 ishan_sharma D Oct. 18, 2020, 7:44 p.m. OK GNU C++14 TESTS 41 61 0
95901631 cool_boy_kunal D Oct. 18, 2020, 11:56 a.m. OK GNU C++14 TESTS 41 61 0
95900348 A_Modern_Desperado D Oct. 18, 2020, 11:45 a.m. OK GNU C++14 TESTS 41 61 0
95921885 Gorgo D Oct. 18, 2020, 4:35 p.m. OK GNU C++14 TESTS 41 61 0
95944748 Rebro D Oct. 19, 2020, 4:36 a.m. OK GNU C++14 TESTS 41 61 0
95909859 Simones D Oct. 18, 2020, 1:44 p.m. OK GNU C++17 TESTS 41 46 0
95935721 Gilgameshx D Oct. 18, 2020, 10:17 p.m. OK GNU C++17 TESTS 41 46 0
95905504 hsez D Oct. 18, 2020, 12:46 p.m. OK GNU C++17 TESTS 41 46 0
95904790 chen_zexing D Oct. 18, 2020, 12:37 p.m. OK GNU C++17 TESTS 41 46 0
95895549 Jonathan_Uy D Oct. 18, 2020, 10:57 a.m. OK GNU C++17 TESTS 41 46 0
95891605 namanbansal013 D Oct. 18, 2020, 10:42 a.m. OK GNU C++17 TESTS 41 46 0
95889027 demonwings D Oct. 18, 2020, 10:32 a.m. OK GNU C++17 TESTS 41 46 0
95919111 Macaron_lin D Oct. 18, 2020, 3:49 p.m. OK GNU C++17 TESTS 41 61 0
95922089 claudiovan D Oct. 18, 2020, 4:39 p.m. OK GNU C++17 TESTS 41 61 0
95926376 sharmajatin741 D Oct. 18, 2020, 5:55 p.m. OK GNU C++17 TESTS 41 61 0
95945159 M0riarty D Oct. 19, 2020, 4:47 a.m. OK GNU C++17 (64) TESTS 41 46 0
95941501 DanielMontes D Oct. 19, 2020, 2:57 a.m. OK GNU C++17 (64) TESTS 41 46 0
95940073 Marckess D Oct. 19, 2020, 2:06 a.m. OK GNU C++17 (64) TESTS 41 46 0
95940025 hello_codeforces D Oct. 19, 2020, 2:04 a.m. OK GNU C++17 (64) TESTS 41 46 0
95939374 Tzak D Oct. 19, 2020, 1:33 a.m. OK GNU C++17 (64) TESTS 41 46 0
95932602 KokiYmgch D Oct. 18, 2020, 8:27 p.m. OK GNU C++17 (64) TESTS 41 46 0
95932228 KokiYmgch D Oct. 18, 2020, 8:16 p.m. OK GNU C++17 (64) TESTS 41 46 0
95935988 ecnerwala D Oct. 18, 2020, 10:30 p.m. OK GNU C++17 (64) TESTS 41 46 0
95947201 The_Ansh_Gupta D Oct. 19, 2020, 5:36 a.m. OK GNU C++17 (64) TESTS 41 46 0
95946386 suzuken_w D Oct. 19, 2020, 5:17 a.m. OK GNU C++17 (64) TESTS 41 46 0
95930002 RockStar_14 D Oct. 18, 2020, 7:18 p.m. OK Java 11 TESTS 41 187 0
95906362 soumit915 D Oct. 18, 2020, 12:58 p.m. OK Java 11 TESTS 41 202 0
95938086 Agnimandur D Oct. 19, 2020, 12:28 a.m. OK Java 11 TESTS 41 217 0
95900806 I_Love_Slim D Oct. 18, 2020, 11:49 a.m. OK Java 11 TESTS 41 218 0
95891876 glider.g D Oct. 18, 2020, 10:43 a.m. OK Java 11 TESTS 41 218 0
95926931 skittles1412 D Oct. 18, 2020, 6:07 p.m. OK Java 11 TESTS 41 218 102400
95888282 Richard727 D Oct. 18, 2020, 10:29 a.m. OK Java 11 TESTS 41 233 0
95892229 pulkit14 D Oct. 18, 2020, 10:45 a.m. OK Java 11 TESTS 41 234 0
95914398 chris_11 D Oct. 18, 2020, 2:43 p.m. OK Java 11 TESTS 41 248 0
95907199 Apfeloxid D Oct. 18, 2020, 1:08 p.m. OK Java 11 TESTS 41 280 0
95897641 ManchesterCityFC D Oct. 18, 2020, 11:04 a.m. OK Java 8 TESTS 41 140 0
95901978 MartyByrde D Oct. 18, 2020, noon OK Java 8 TESTS 41 140 0
95929999 Whiplash99 D Oct. 18, 2020, 7:18 p.m. OK Java 8 TESTS 41 140 0
95940366 ashraybharambe D Oct. 19, 2020, 2:19 a.m. OK Java 8 TESTS 41 140 0
95894154 O_E D Oct. 18, 2020, 10:52 a.m. OK Java 8 TESTS 41 155 0
95929512 flyman3046 D Oct. 18, 2020, 7:05 p.m. OK Java 8 TESTS 41 155 0
95895842 xwchen D Oct. 18, 2020, 10:58 a.m. OK Java 8 TESTS 41 155 0
95894559 godxpunk D Oct. 18, 2020, 10:53 a.m. OK Java 8 TESTS 41 155 0
95931744 Whiplash99 D Oct. 18, 2020, 8:04 p.m. OK Java 8 TESTS 41 155 0
95929951 Whiplash99 D Oct. 18, 2020, 7:16 p.m. OK Java 8 TESTS 41 155 0
95886154 P___ D Oct. 18, 2020, 10:21 a.m. OK MS C++ 2017 TESTS 41 62 0
95886283 youx D Oct. 18, 2020, 10:22 a.m. OK MS C++ 2017 TESTS 41 62 0
95889325 jonitox D Oct. 18, 2020, 10:33 a.m. OK MS C++ 2017 TESTS 41 124 0
95900811 Megalitum D Oct. 18, 2020, 11:49 a.m. OK MS C++ 2017 TESTS 41 140 0
95933746 _insomaniac D Oct. 18, 2020, 9:02 p.m. OK MS C++ 2017 TESTS 41 140 0
95889102 hruif D Oct. 18, 2020, 10:32 a.m. OK MS C++ 2017 TESTS 41 140 0
95894010 t0rtik D Oct. 18, 2020, 10:51 a.m. OK MS C++ 2017 TESTS 41 155 0
95890563 n.a.orlov D Oct. 18, 2020, 10:38 a.m. OK MS C++ 2017 TESTS 41 155 0
95897855 Mbox D Oct. 18, 2020, 11:04 a.m. OK MS C++ 2017 TESTS 41 171 0
95891973 Flighter D Oct. 18, 2020, 10:44 a.m. OK MS C++ 2017 TESTS 41 171 0
95919661 azukun D Oct. 18, 2020, 3:58 p.m. OK .NET Core C# TESTS 41 109 3481600
95887527 R1val D Oct. 18, 2020, 10:26 a.m. OK .NET Core C# TESTS 41 124 3276800
95903413 MyEighthName D Oct. 18, 2020, 12:19 p.m. OK .NET Core C# TESTS 41 171 3891200
95889347 Mukundan314 D Oct. 18, 2020, 10:33 a.m. OK PyPy 2 TESTS 41 248 8396800
95910915 satyamcse D Oct. 18, 2020, 1:57 p.m. OK PyPy 2 TESTS 41 311 7577600
95908547 Mars314 D Oct. 18, 2020, 1:27 p.m. OK PyPy 2 TESTS 41 452 6348800
95904423 manish.17 D Oct. 18, 2020, 12:32 p.m. OK PyPy 3 TESTS 41 265 6144000
95920811 Khan17 D Oct. 18, 2020, 4:17 p.m. OK PyPy 3 TESTS 41 311 8089600
95899709 manhar D Oct. 18, 2020, 11:40 a.m. OK PyPy 3 TESTS 41 342 9830400
95913909 thekushalghosh D Oct. 18, 2020, 2:36 p.m. OK PyPy 3 TESTS 41 358 10035200
95904668 marcus.test D Oct. 18, 2020, 12:35 p.m. OK PyPy 3 TESTS 41 374 9932800
95897520 YashShah D Oct. 18, 2020, 11:04 a.m. OK PyPy 3 TESTS 41 374 9932800
95908927 generic_placeholder_name D Oct. 18, 2020, 1:32 p.m. OK PyPy 3 TESTS 41 374 10035200
95892311 e.m.blagov D Oct. 18, 2020, 10:45 a.m. OK PyPy 3 TESTS 41 389 9728000
95917389 aberent D Oct. 18, 2020, 3:24 p.m. OK PyPy 3 TESTS 41 389 10444800
95886101 TheVan D Oct. 18, 2020, 10:21 a.m. OK PyPy 3 TESTS 41 420 9830400
95908168 SoSooding D Oct. 18, 2020, 1:22 p.m. OK Python 2 TESTS 41 264 204800
95891377 mkawa2 D Oct. 18, 2020, 10:41 a.m. OK Python 3 TESTS 41 218 307200
95893354 sudoSieg D Oct. 18, 2020, 10:49 a.m. OK Python 3 TESTS 41 249 307200
95896769 AdarshSrivastav D Oct. 18, 2020, 11:02 a.m. OK Python 3 TESTS 41 249 921600
95893123 maximpetrov D Oct. 18, 2020, 10:48 a.m. OK Python 3 TESTS 41 264 307200
95901825 qazz625 D Oct. 18, 2020, 11:58 a.m. OK Python 3 TESTS 41 265 307200
95887472 liteburn D Oct. 18, 2020, 10:26 a.m. OK Python 3 TESTS 41 265 307200
95904155 smf D Oct. 18, 2020, 12:29 p.m. OK Python 3 TESTS 41 265 512000
95895911 coderbd D Oct. 18, 2020, 10:59 a.m. OK Python 3 TESTS 41 280 307200
95892182 AtodNevs D Oct. 18, 2020, 10:44 a.m. OK Python 3 TESTS 41 280 307200
95909057 Lithosphere D Oct. 18, 2020, 1:34 p.m. OK Python 3 TESTS 41 311 307200
95887842 simanman D Oct. 18, 2020, 10:27 a.m. OK Ruby TESTS 41 623 307200
95910859 o2c D Oct. 18, 2020, 1:56 p.m. OK Rust TESTS 41 46 1536000
95909964 o2c D Oct. 18, 2020, 1:45 p.m. OK Rust TESTS 41 46 1536000
95892459 kobae964 D Oct. 18, 2020, 10:45 a.m. OK Rust TESTS 41 93 1228800
95894866 zheland D Oct. 18, 2020, 10:54 a.m. OK Rust TESTS 41 186 0
95887706 pandrei D Oct. 18, 2020, 10:27 a.m. OK Rust TESTS 41 1638 0

remove filters

Back to search problems