Codeforces Round 790 (Div. 4)

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
1676 Codeforces Round 790 (Div. 4) FINISHED False 7200 84986063 May 10, 2022, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 30931 ) C Most Similar Words PROGRAMMING brute force greedy implementation implementation math strings

B'You are given n words of equal length m , consisting of lowercase Latin alphabet letters. The i -th word is denoted s_i . In one move you can choose any position in any single word and change the letter at that position to the previous or next letter in alphabetical order. For example: The difference between two words is the minimum number of moves required to make them equal. For example, the difference between "best" and "cost" is 1 + 10 + 0 + 0 = 11 . Find the minimum difference of s_i and s_j such that (i < j) . In other words, find the minimum difference over all possible pairs of the n words. The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains 2 integers n and m ( 2 <= q n <= q 50 , 1 <= q m <= q 8 ) -- the number of strings and their length respectively. Then follows n lines, the i -th of which containing a single string s_i of length m , consisting of lowercase Latin letters. For each test case, print a single integer -- the minimum difference over all possible pairs of the given strings. For the second test case, one can show that the best pair is ("abb","bef"), which has difference equal to 8 , which can be obtained in the following way: change the first character of the first string to 'b ' in one move, change the second character of the second string to 'b ' in 3 moves and change the third character of the second string to 'b ' in 4 moves, thus making in total 1 + 3 + 4 = 8 moves. For the third test case, there is only one possible pair and it can be shown that the minimum amount of moves necessary to make the strings equal is 35 . For the fourth test case, there is a pair of strings which is already equal, so the answer is 0 . '...

Tutorials

Codeforces Round #790 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156832865 hurshedabdullaev C May 11, 2022, 12:57 p.m. OK C# 10 TESTS 6 77 2252800
156827494 duvvurisoujanya C May 11, 2022, 12:03 p.m. OK Clang++17 Diagnostics TESTS 6 109 0
156830498 vjudge5 C May 11, 2022, 12:34 p.m. OK Clang++17 Diagnostics TESTS 6 218 0
156877672 osip999 C May 12, 2022, 2:15 a.m. OK Clang++17 Diagnostics TESTS 6 264 6348800
156856835 PulokSaha C May 11, 2022, 5:42 p.m. OK GNU C11 TESTS 6 0 0
156834535 tangyuanya C May 11, 2022, 1:13 p.m. OK GNU C11 TESTS 6 15 0
156834307 BADHON30 C May 11, 2022, 1:11 p.m. OK GNU C11 TESTS 6 15 0
156855635 PulokSaha C May 11, 2022, 5:27 p.m. OK GNU C11 TESTS 6 15 0
156856871 prosantodass C May 11, 2022, 5:43 p.m. OK GNU C11 TESTS 6 15 0
156861199 joaomarcosth9 C May 11, 2022, 6:39 p.m. OK GNU C11 TESTS 6 15 204800
156878585 l_04 C May 12, 2022, 2:39 a.m. OK GNU C++14 TESTS 6 0 0
156875871 simon_Sun C May 12, 2022, 1:12 a.m. OK GNU C++14 TESTS 6 0 0
156875314 zaochen C May 12, 2022, 12:52 a.m. OK GNU C++14 TESTS 6 0 0
156867969 harshitnahata48 C May 11, 2022, 8:37 p.m. OK GNU C++14 TESTS 6 0 0
156867308 MorningStar_ C May 11, 2022, 8:24 p.m. OK GNU C++14 TESTS 6 0 0
156864975 LoSER_Good_for_Nothing C May 11, 2022, 7:41 p.m. OK GNU C++14 TESTS 6 0 0
156863872 anawdina C May 11, 2022, 7:21 p.m. OK GNU C++14 TESTS 6 0 0
156887378 dapingguo8 C May 12, 2022, 5:49 a.m. OK GNU C++14 TESTS 6 0 0
156887362 hemanthkumarmulka15 C May 12, 2022, 5:49 a.m. OK GNU C++14 TESTS 6 0 0
156881035 cbmango C May 12, 2022, 3:41 a.m. OK GNU C++14 TESTS 6 0 0
156883263 Pranav_g19 C May 12, 2022, 4:31 a.m. OK GNU C++17 TESTS 6 0 0
156879956 code143 C May 12, 2022, 3:15 a.m. OK GNU C++17 TESTS 6 0 0
156878704 devanshu-08 C May 12, 2022, 2:42 a.m. OK GNU C++17 TESTS 6 0 0
156877601 jain_ashish001 C May 12, 2022, 2:13 a.m. OK GNU C++17 TESTS 6 0 0
156886653 n4Make C May 12, 2022, 5:37 a.m. OK GNU C++17 TESTS 6 0 0
156887055 Carrtop C May 12, 2022, 5:44 a.m. OK GNU C++17 TESTS 6 0 0
156887733 ben390 C May 12, 2022, 5:55 a.m. OK GNU C++17 TESTS 6 0 0
156886638 ddlearn C May 12, 2022, 5:36 a.m. OK GNU C++17 TESTS 6 0 0
156886203 SahaRatul C May 12, 2022, 5:28 a.m. OK GNU C++17 TESTS 6 0 0
156885504 Beabled C May 12, 2022, 5:16 a.m. OK GNU C++17 TESTS 6 0 0
156816574 singhkunal01 C May 11, 2022, 10:03 a.m. OK GNU C++17 (64) TESTS 6 0 0
156878932 tonyli00000 C May 12, 2022, 2:48 a.m. OK GNU C++17 (64) TESTS 6 0 0
156858126 Richw818 C May 11, 2022, 5:58 p.m. OK GNU C++17 (64) TESTS 6 0 0
156855537 manish529 C May 11, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 6 0 0
156853333 vjudge3 C May 11, 2022, 4:54 p.m. OK GNU C++17 (64) TESTS 6 0 0
156851321 imnasim3.1415 C May 11, 2022, 4:28 p.m. OK GNU C++17 (64) TESTS 6 0 0
156826236 hellojim C May 11, 2022, 11:50 a.m. OK GNU C++17 (64) TESTS 6 0 0
156826172 mdunggggggg C May 11, 2022, 11:49 a.m. OK GNU C++17 (64) TESTS 6 0 0
156814762 pkroll C May 11, 2022, 9:41 a.m. OK GNU C++17 (64) TESTS 6 0 0
156798957 frieza C May 11, 2022, 8:58 a.m. OK GNU C++17 (64) TESTS 6 0 0
156871992 Esraa_A_Gaber C May 11, 2022, 10:32 p.m. OK GNU C++20 (64) TESTS 6 0 0
156870556 Mena7akim C May 11, 2022, 9:40 p.m. OK GNU C++20 (64) TESTS 6 0 0
156869433 pyslayer C May 11, 2022, 9:10 p.m. OK GNU C++20 (64) TESTS 6 0 0
156866571 JaiderS C May 11, 2022, 8:09 p.m. OK GNU C++20 (64) TESTS 6 0 0
156875098 The_Dark_Lord_ C May 12, 2022, 12:44 a.m. OK GNU C++20 (64) TESTS 6 0 0
156876390 Fear_less C May 12, 2022, 1:32 a.m. OK GNU C++20 (64) TESTS 6 0 0
156879409 jasonray0328 C May 12, 2022, 3:01 a.m. OK GNU C++20 (64) TESTS 6 0 0
156881496 ShlokG C May 12, 2022, 3:52 a.m. OK GNU C++20 (64) TESTS 6 0 0
156883117 AnACPlease C May 12, 2022, 4:27 a.m. OK GNU C++20 (64) TESTS 6 0 0
156885489 rishiarya7373 C May 12, 2022, 5:15 a.m. OK GNU C++20 (64) TESTS 6 0 0
156830091 anmol.mact C May 11, 2022, 12:29 p.m. OK Java 11 TESTS 6 156 0
156792261 amitmandal C May 11, 2022, 7:38 a.m. OK Java 11 TESTS 6 171 0
156873073 MunirKP C May 11, 2022, 11:16 p.m. OK Java 11 TESTS 6 171 0
156852954 suhas5979 C May 11, 2022, 4:49 p.m. OK Java 11 TESTS 6 171 0
156838013 bbishwajit05 C May 11, 2022, 1:49 p.m. OK Java 11 TESTS 6 171 0
156837999 2020B0121084 C May 11, 2022, 1:49 p.m. OK Java 11 TESTS 6 171 0
156830039 velocity_9 C May 11, 2022, 12:29 p.m. OK Java 11 TESTS 6 171 0
156788643 Krishu02 C May 11, 2022, 6:53 a.m. OK Java 11 TESTS 6 171 0
156789336 channicholas01 C May 11, 2022, 7:01 a.m. OK Java 11 TESTS 6 187 0
156885898 shimasima2 C May 12, 2022, 5:23 a.m. OK Java 11 TESTS 6 202 0
156883646 abhi_shri C May 12, 2022, 4:39 a.m. OK Java 8 TESTS 6 93 0
156832556 sharpen C May 11, 2022, 12:54 p.m. OK Java 8 TESTS 6 93 0
156794765 karthikeyan_123 C May 11, 2022, 8:09 a.m. OK Java 8 TESTS 6 108 0
156825445 akshaykumar200042 C May 11, 2022, 11:43 a.m. OK Java 8 TESTS 6 109 0
156816685 Mahip_19 C May 11, 2022, 10:05 a.m. OK Java 8 TESTS 6 109 0
156866938 gblake31 C May 11, 2022, 8:17 p.m. OK Java 8 TESTS 6 124 0
156866522 FirePegasus C May 11, 2022, 8:08 p.m. OK Java 8 TESTS 6 124 0
156856562 AlexRutledge C May 11, 2022, 5:39 p.m. OK Java 8 TESTS 6 124 0
156820078 Ahmed_yehia_hosny C May 11, 2022, 10:43 a.m. OK Java 8 TESTS 6 124 0
156804825 Yeleke C May 11, 2022, 9:27 a.m. OK Java 8 TESTS 6 124 0
156814683 PeredurOmega C May 11, 2022, 9:41 a.m. OK Kotlin 1.4 TESTS 6 124 102400
156832986 hurshedabdullaev C May 11, 2022, 12:58 p.m. OK Mono C# TESTS 6 77 5632000
156851146 Still_Theory C May 11, 2022, 4:25 p.m. OK MS C++ 2017 TESTS 6 0 0
156849126 1_shivam C May 11, 2022, 4:01 p.m. OK MS C++ 2017 TESTS 6 15 0
156838001 CJXX C May 11, 2022, 1:49 p.m. OK MS C++ 2017 TESTS 6 15 0
156834004 lyg3715371537 C May 11, 2022, 1:08 p.m. OK MS C++ 2017 TESTS 6 15 0
156832425 wocalegegoupi C May 11, 2022, 12:52 p.m. OK MS C++ 2017 TESTS 6 15 0
156823296 Superlau C May 11, 2022, 11:20 a.m. OK MS C++ 2017 TESTS 6 15 0
156871640 bsherhj C May 11, 2022, 10:19 p.m. OK MS C++ 2017 TESTS 6 15 0
156799588 XYShaoKang C May 11, 2022, 9:06 a.m. OK Node.js TESTS 6 93 5939200
156848667 51-Pegasai-b C May 11, 2022, 3:55 p.m. OK PHP TESTS 6 296 0
156848966 51-Pegasai-b C May 11, 2022, 3:58 p.m. OK PHP TESTS 6 311 0
156852921 ambs_ C May 11, 2022, 4:48 p.m. OK PyPy 3 TESTS 6 109 2560000
156849311 ShrijitShaswat C May 11, 2022, 4:03 p.m. OK PyPy 3 TESTS 6 124 3276800
156848446 rishabh.g C May 11, 2022, 3:52 p.m. OK PyPy 3 TESTS 6 170 3993600
156883490 quangltfsc0378 C May 12, 2022, 4:36 a.m. OK PyPy 3 TESTS 6 171 3993600
156861667 udayps055 C May 11, 2022, 6:46 p.m. OK PyPy 3 TESTS 6 171 3993600
156854863 manohar2509 C May 11, 2022, 5:16 p.m. OK PyPy 3 TESTS 6 171 3993600
156817667 kojihashimoto C May 11, 2022, 10:16 a.m. OK PyPy 3 TESTS 6 171 3993600
156849251 ShrijitShaswat C May 11, 2022, 4:02 p.m. OK PyPy 3 TESTS 6 171 4300800
156850719 ttorpy C May 11, 2022, 4:20 p.m. OK PyPy 3 TESTS 6 186 4300800
156843904 MrDrogon C May 11, 2022, 2:56 p.m. OK PyPy 3 TESTS 6 202 6144000
156859978 MistaAsh C May 11, 2022, 6:23 p.m. OK PyPy 3-64 TESTS 6 78 4198400
156854892 notTehlka C May 11, 2022, 5:16 p.m. OK PyPy 3-64 TESTS 6 93 3788800
156878863 jloai009 C May 12, 2022, 2:46 a.m. OK PyPy 3-64 TESTS 6 93 4198400
156800976 asdsasd C May 11, 2022, 9:23 a.m. OK PyPy 3-64 TESTS 6 93 4505600
156822703 Invinc3 C May 11, 2022, 11:15 a.m. OK PyPy 3-64 TESTS 6 93 6246400
156818555 chen.mercer C May 11, 2022, 10:26 a.m. OK PyPy 3-64 TESTS 6 108 5324800
156870264 assa_codeforses C May 11, 2022, 9:32 p.m. OK PyPy 3-64 TESTS 6 109 5632000
156849355 ShrijitShaswat C May 11, 2022, 4:03 p.m. OK PyPy 3-64 TESTS 6 124 5632000
156831981 terasa C May 11, 2022, 12:47 p.m. OK PyPy 3-64 TESTS 6 124 6451200
156858713 MashaM C May 11, 2022, 6:05 p.m. OK PyPy 3-64 TESTS 6 124 6656000
156836593 Rudraksh_Arora C May 11, 2022, 1:34 p.m. OK Python 3 TESTS 6 234 0
156828525 reinkarnation C May 11, 2022, 12:14 p.m. OK Python 3 TESTS 6 311 0
156872918 deepaklaksman C May 11, 2022, 11:09 p.m. OK Python 3 TESTS 6 327 0
156822980 gandharv.bakshi C May 11, 2022, 11:17 a.m. OK Python 3 TESTS 6 327 0
156793861 saurav_kalsoor C May 11, 2022, 7:57 a.m. OK Python 3 TESTS 6 342 0
156849392 ShrijitShaswat C May 11, 2022, 4:04 p.m. OK Python 3 TESTS 6 358 0
156795772 codemakerself C May 11, 2022, 8:21 a.m. OK Python 3 TESTS 6 358 0
156884270 fguo7370 C May 12, 2022, 4:51 a.m. OK Python 3 TESTS 6 373 0
156883578 fguo7370 C May 12, 2022, 4:37 a.m. OK Python 3 TESTS 6 374 0
156885771 psycho_pirate C May 12, 2022, 5:20 a.m. OK Python 3 TESTS 6 390 0

remove filters

Back to search problems