Codeforces Round 820 (Div. 3)

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
1729 Codeforces Round 820 (Div. 3) FINISHED False 8100 74186663 Sept. 12, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20380 ) C Jumping on Tiles PROGRAMMING constructive algorithms strings

B"Polycarp was given a row of tiles. Each tile contains one lowercase letter of the Latin alphabet. The entire sequence of tiles forms the string s . In other words, you are given a string s consisting of lowercase Latin letters. Initially, Polycarp is on the first tile of the row and wants to get to the last tile by jumping on the tiles. Jumping from i -th tile to j -th tile has a cost equal to |index(s_i) - index(s_j)| , where index(c) is the index of the letter c in the alphabet (for example, index( 'a' )=1 , index( 'b' )=2 , ..., index( 'z' )=26 ) . Polycarp wants to get to the n -th tile for the minimum total cost, but at the same time make maximum number of jumps. In other words, among all possible ways to get to the last tile for the minimum total cost, he will choose the one with the maximum number of jumps. Polycarp can visit each tile at most once. Polycarp asks you to help -- print the sequence of indices of string s on which he should jump. The first line of the input contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. Each test case is given by the string s ( 2 <= |s| <= 2 cdot 10^5 ), where |s| -- is the length of string s . The string s consists of lowercase Latin letters. It is guaranteed that the sum of string lengths s over all test cases does not exceed 2 cdot 10^5 . The answer to each test case consists of two lines. In the first line print two integers cost , m , where cost is the minimum total cost of the path, and m is the maximum number of visited tiles Polycarp can make to get to n -th tiles for the minimum total cost cost (i.e. the number of jumps is m-1 ). In the next line print m different numbers j_1, j_2, ... , j_m ( 1 <= j_i <= |s| ) -- the sequence of indices of the tiles Polycarp will jump on. The first nu"...

Tutorials

Codeforces Round #820 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
171990601 singhkrishnajsr143 C Sept. 13, 2022, 4:50 a.m. OK C# 10 TESTS 7 623 10752000
171981006 bluemegane C Sept. 13, 2022, 1:34 a.m. OK C# 8 TESTS 7 265 27648000
171960744 lordpika C Sept. 12, 2022, 6:35 p.m. OK Clang++17 Diagnostics TESTS 4 389 16179200
171976690 gxlois C Sept. 12, 2022, 11:22 p.m. OK GNU C11 TESTS 7 31 4915200
171955820 chethan58 C Sept. 12, 2022, 5:51 p.m. OK GNU C11 TESTS 4 451 1945600
171947886 guptaaman200229 C Sept. 12, 2022, 5:02 p.m. OK GNU C++14 TESTS 4 15 1433600
171962496 deevesh_1 C Sept. 12, 2022, 6:53 p.m. OK GNU C++14 TESTS 4 15 1433600
171957483 IBAIB C Sept. 12, 2022, 6:05 p.m. OK GNU C++14 TESTS 4 15 2764800
171947330 Owaiter C Sept. 12, 2022, 4:59 p.m. OK GNU C++14 TESTS 4 15 2969600
171954693 afanehkareem C Sept. 12, 2022, 5:41 p.m. OK GNU C++14 TESTS 4 30 1433600
171956410 afanehkareem C Sept. 12, 2022, 5:55 p.m. OK GNU C++14 TESTS 4 30 2560000
171951909 niter C Sept. 12, 2022, 5:21 p.m. OK GNU C++14 TESTS 4 30 2560000
171960417 Heisenburg-120 C Sept. 12, 2022, 6:31 p.m. OK GNU C++14 TESTS 4 30 2969600
171953305 nikhilwalia23 C Sept. 12, 2022, 5:31 p.m. OK GNU C++14 TESTS 4 30 3993600
171957904 ayushnautiyal1110 C Sept. 12, 2022, 6:08 p.m. OK GNU C++14 TESTS 4 30 4096000
171952314 vijay__ C Sept. 12, 2022, 5:24 p.m. OK GNU C++17 TESTS 4 15 1331200
171950198 Serendipity__ C Sept. 12, 2022, 5:12 p.m. OK GNU C++17 TESTS 4 15 1433600
171954666 praveen4948 C Sept. 12, 2022, 5:41 p.m. OK GNU C++17 TESTS 4 15 1433600
171957760 Rama_i_am C Sept. 12, 2022, 6:07 p.m. OK GNU C++17 TESTS 4 15 1843200
171951948 UNKNOWN_LGM C Sept. 12, 2022, 5:22 p.m. OK GNU C++17 TESTS 4 15 1945600
171962696 sumit7 C Sept. 12, 2022, 6:55 p.m. OK GNU C++17 TESTS 4 15 1945600
171962567 imthevengeance C Sept. 12, 2022, 6:54 p.m. OK GNU C++17 TESTS 4 15 2457600
171954618 diobrando97 C Sept. 12, 2022, 5:41 p.m. OK GNU C++17 TESTS 4 15 2969600
171955527 Marceantasy C Sept. 12, 2022, 5:49 p.m. OK GNU C++17 TESTS 4 15 2969600
171961147 Ab.Mahin C Sept. 12, 2022, 6:39 p.m. OK GNU C++17 TESTS 4 15 2969600
171959945 JohanWOW C Sept. 12, 2022, 6:27 p.m. OK GNU C++17 (64) TESTS 4 15 1433600
171945923 yaoveil C Sept. 12, 2022, 4:54 p.m. OK GNU C++17 (64) TESTS 4 15 1843200
171953124 SaadOoN C Sept. 12, 2022, 5:30 p.m. OK GNU C++17 (64) TESTS 4 15 1843200
171956380 hemanshu02 C Sept. 12, 2022, 5:55 p.m. OK GNU C++17 (64) TESTS 4 30 819200
171958000 shity_handle C Sept. 12, 2022, 6:09 p.m. OK GNU C++17 (64) TESTS 4 30 2457600
171958200 shity_handle C Sept. 12, 2022, 6:11 p.m. OK GNU C++17 (64) TESTS 4 30 2560000
171945100 MaGnsi0 C Sept. 12, 2022, 4:52 p.m. OK GNU C++17 (64) TESTS 4 30 2764800
171956723 of_a7 C Sept. 12, 2022, 5:58 p.m. OK GNU C++17 (64) TESTS 4 30 2867200
171980578 yaoveil C Sept. 13, 2022, 1:23 a.m. OK GNU C++17 (64) TESTS 7 30 3481600
171995356 hbnd_jaw1 C Sept. 13, 2022, 5:58 a.m. OK GNU C++17 (64) TESTS 7 30 3584000
171948115 GG_Panda C Sept. 12, 2022, 5:03 p.m. OK GNU C++20 (64) TESTS 4 0 4710400
171954707 MayaZayn C Sept. 12, 2022, 5:42 p.m. OK GNU C++20 (64) TESTS 4 15 1228800
171960379 Steven-_-AbuAlkhair C Sept. 12, 2022, 6:31 p.m. OK GNU C++20 (64) TESTS 4 15 1331200
171950528 omarel21sakka C Sept. 12, 2022, 5:14 p.m. OK GNU C++20 (64) TESTS 4 15 1331200
171966402 Dazai_kun C Sept. 12, 2022, 7:39 p.m. OK GNU C++20 (64) TESTS 7 15 1536000
171946824 HusseinSaad C Sept. 12, 2022, 4:58 p.m. OK GNU C++20 (64) TESTS 4 15 1843200
171956053 Azalea05 C Sept. 12, 2022, 5:53 p.m. OK GNU C++20 (64) TESTS 4 15 1945600
171956027 kia7 C Sept. 12, 2022, 5:53 p.m. OK GNU C++20 (64) TESTS 4 15 1945600
171946538 shawkyebrahim C Sept. 12, 2022, 4:56 p.m. OK GNU C++20 (64) TESTS 4 15 2150400
171963021 Ahmed-yaser C Sept. 12, 2022, 6:59 p.m. OK GNU C++20 (64) TESTS 4 15 2252800
171960587 koqo C Sept. 12, 2022, 6:33 p.m. OK Go TESTS 4 31 4915200
171960246 I_love_Shristi_B C Sept. 12, 2022, 6:30 p.m. OK Go TESTS 4 31 8601600
171945275 Almacho C Sept. 12, 2022, 4:52 p.m. OK Java 11 TESTS 4 218 307200
171950886 __Serendipity C Sept. 12, 2022, 5:15 p.m. OK Java 11 TESTS 4 233 0
171959760 Wolfy01 C Sept. 12, 2022, 6:25 p.m. OK Java 11 TESTS 4 249 921600
171959727 wolfy_thee_wolf C Sept. 12, 2022, 6:25 p.m. OK Java 11 TESTS 4 249 921600
171951166 adnan84 C Sept. 12, 2022, 5:17 p.m. OK Java 11 TESTS 4 249 2355200
171954304 minibin C Sept. 12, 2022, 5:38 p.m. OK Java 11 TESTS 4 264 512000
171951185 uros C Sept. 12, 2022, 5:17 p.m. OK Java 11 TESTS 4 264 1843200
171954592 meteoLdrago C Sept. 12, 2022, 5:41 p.m. OK Java 11 TESTS 4 264 5222400
171954809 minibin C Sept. 12, 2022, 5:42 p.m. OK Java 11 TESTS 4 265 102400
171995039 vijender_8601 C Sept. 13, 2022, 5:54 a.m. OK Java 11 TESTS 7 265 1024000
171974527 LeetCodeforces_Null C Sept. 12, 2022, 10:13 p.m. OK Java 17 TESTS 7 233 3891200
171952369 garuda5611 C Sept. 12, 2022, 5:25 p.m. OK Java 17 TESTS 4 592 4505600
171987443 vasanthgk02 C Sept. 13, 2022, 3:57 a.m. OK Java 17 TESTS 7 858 3584000
171979128 _wjy C Sept. 13, 2022, 12:44 a.m. OK Java 17 TESTS 7 998 6963200
171949807 govindrajput C Sept. 12, 2022, 5:10 p.m. OK Java 8 TESTS 4 124 0
171948214 DylanSmith C Sept. 12, 2022, 5:03 p.m. OK Java 8 TESTS 4 140 2457600
171969081 SparkX C Sept. 12, 2022, 8:18 p.m. OK Java 8 TESTS 7 186 2252800
171976686 kasyu C Sept. 12, 2022, 11:22 p.m. OK Java 8 TESTS 7 202 1740800
171984002 chaiku C Sept. 13, 2022, 2:44 a.m. OK Java 8 TESTS 7 202 4608000
171949899 r3hab.rs C Sept. 12, 2022, 5:10 p.m. OK Java 8 TESTS 4 217 3379200
171969192 akarshanand2810 C Sept. 12, 2022, 8:20 p.m. OK Java 8 TESTS 7 218 2252800
171985680 poopoop C Sept. 13, 2022, 3:19 a.m. OK Java 8 TESTS 7 280 6451200
171960601 waynebruce1704 C Sept. 12, 2022, 6:34 p.m. OK Java 8 TESTS 4 436 0
171989126 KING-STAR C Sept. 13, 2022, 4:25 a.m. OK Java 8 TESTS 7 764 3379200
171984042 6ziv C Sept. 13, 2022, 2:45 a.m. OK MS C++ 2017 TESTS 7 78 2048000
171949311 quickbreak C Sept. 12, 2022, 5:08 p.m. OK MS C++ 2017 TESTS 4 78 3174400
171946434 quickbreak C Sept. 12, 2022, 4:56 p.m. OK MS C++ 2017 TESTS 4 78 3174400
171946042 KinnGiFe C Sept. 12, 2022, 4:55 p.m. OK MS C++ 2017 TESTS 4 93 2048000
171954984 abhivarma209 C Sept. 12, 2022, 5:44 p.m. OK MS C++ 2017 TESTS 4 93 2560000
171993194 rn7s2 C Sept. 13, 2022, 5:29 a.m. OK MS C++ 2017 TESTS 7 140 1843200
171958224 conqueror_of_tourist C Sept. 12, 2022, 6:11 p.m. OK PyPy 3 TESTS 4 326 20787200
171958483 conqueror_of_tourist C Sept. 12, 2022, 6:13 p.m. OK PyPy 3 TESTS 4 327 21913600
171954723 sami02jain C Sept. 12, 2022, 5:42 p.m. OK PyPy 3 TESTS 4 467 21913600
171979900 Liberator187 C Sept. 13, 2022, 1:05 a.m. OK PyPy 3 TESTS 7 467 28979200
171987440 shikamarubyte C Sept. 13, 2022, 3:57 a.m. OK PyPy 3 TESTS 7 561 28569600
171958150 conqueror_of_tourist C Sept. 12, 2022, 6:10 p.m. OK PyPy 3 TESTS 4 561 32051200
171969557 rajbunsha C Sept. 12, 2022, 8:27 p.m. OK PyPy 3 TESTS 7 623 27545600
171978615 kelagnir C Sept. 13, 2022, 12:29 a.m. OK PyPy 3 TESTS 7 685 58163200
171960719 u1602016 C Sept. 12, 2022, 6:35 p.m. OK PyPy 3 TESTS 4 779 32051200
171957805 conqueror_of_tourist C Sept. 12, 2022, 6:07 p.m. OK PyPy 3 TESTS 4 811 43110400
171953401 AD18 C Sept. 12, 2022, 5:32 p.m. OK PyPy 3-64 TESTS 4 140 12185600
171978532 omar.gawdat C Sept. 13, 2022, 12:27 a.m. OK PyPy 3-64 TESTS 7 202 27852800
171978054 omar.gawdat C Sept. 13, 2022, 12:13 a.m. OK PyPy 3-64 TESTS 7 218 28364800
171977919 omar.gawdat C Sept. 13, 2022, 12:09 a.m. OK PyPy 3-64 TESTS 7 218 29491200
171990930 USYDLDH C Sept. 13, 2022, 4:55 a.m. OK PyPy 3-64 TESTS 7 248 22425600
171993744 sdt4936 C Sept. 13, 2022, 5:36 a.m. OK PyPy 3-64 TESTS 7 249 19763200
171967989 bokunopicolo C Sept. 12, 2022, 8:01 p.m. OK PyPy 3-64 TESTS 7 264 19046400
171973442 mrdhnv C Sept. 12, 2022, 9:45 p.m. OK PyPy 3-64 TESTS 7 265 18944000
171984956 Nan-Do C Sept. 13, 2022, 3:04 a.m. OK PyPy 3-64 TESTS 7 311 19353600
171953560 biglunchdude C Sept. 12, 2022, 5:33 p.m. OK PyPy 3-64 TESTS 4 311 39628800
171958432 R.Ayush777 C Sept. 12, 2022, 6:13 p.m. OK Python 3 TESTS 4 202 6656000
171948662 carlfre C Sept. 12, 2022, 5:05 p.m. OK Python 3 TESTS 4 233 10137600
171954363 Krishna_Ugale C Sept. 12, 2022, 5:39 p.m. OK Python 3 TESTS 4 234 6348800
171960254 osource C Sept. 12, 2022, 6:30 p.m. OK Python 3 TESTS 4 264 5427200
171950971 skatejoe1 C Sept. 12, 2022, 5:16 p.m. OK Python 3 TESTS 4 264 12800000
171959218 osource C Sept. 12, 2022, 6:20 p.m. OK Python 3 TESTS 4 280 8294400
171972774 21bec036 C Sept. 12, 2022, 9:30 p.m. OK Python 3 TESTS 7 280 18944000
171956592 kirsh_kkm C Sept. 12, 2022, 5:57 p.m. OK Python 3 TESTS 4 295 5734400
171988270 NS3081992 C Sept. 13, 2022, 4:12 a.m. OK Python 3 TESTS 7 311 21196800
171963500 Rahulsust C Sept. 12, 2022, 7:04 p.m. OK Python 3 TESTS 4 327 14848000
171960869 Hyrulia C Sept. 12, 2022, 6:36 p.m. OK Rust 2021 TESTS 4 140 7884800
171968927 wrick C Sept. 12, 2022, 8:16 p.m. OK Scala TESTS 7 701 22425600

remove filters

Back to search problems