Codeforces Round 1032 (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
2121 Codeforces Round 1032 (Div. 3) FINISHED False 8100 26234723 June 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 14597 ) E Sponsor of Your Problems PROGRAMMING greedy strings

For two integers (a) and (b), we define (f(a, b)) as the number of positions in the decimal representation of the numbers (a) and (b) where their digits are the same. For example, (f(12, 21) = 0), (f(31, 37) = 1), (f(19891, 18981) = 2), (f(54321, 24361) = 3). You are given two integers (l) and (r) of the same length in decimal representation. Consider all integers (l \leq x \leq r). Your task is to find the minimum value of (f(l, x) + f(x, r)). Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. Each test case consists of a single line containing two integers (l) and (r) ((1 \leq l \leq r < 10^9)). It is guaranteed that the numbers (l) and (r) have the same length in decimal representation and do not have leading zeros. For each test case, output the minimum value of (f(l, x) + f(x, r)) among all integer values (l \leq x \leq r). In the first test case, you can choose (x = 1). Then (f(1, 1) + f(1, 1) = 1 + 1 = 2). In the second test case, you can choose (x = 2). Then (f(2, 2) + f(2, 3) = 1 + 0 = 1). In the third test case, you can choose (x = 5). Then (f(4, 5) + f(5, 6) = 0 + 0 = 0). In the fourth test case, you can choose (x = 15). Then (f(15, 15) + f(15, 16) = 2 + 1 = 3). In the fifth test case, you can choose (x = 18). Then (f(17, 18) + f(18, 19) = 1 + 1 = 2). In the sixth test case, you can choose (x = 200). Then (f(199, 200) + f(200, 201) = 0 + 2 = 2). In the seventh test case, you can choose (x = 900). Then (f(899, 900) + f(900, 999) = 0 + 1 = 1). In the eighth test case, you can choose (x = 1992). Then (f(1990, 1992) + f(1992, 2001) = 3 + 0 = 3).

Tutorials

Codeforces Round 1032 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324929229 og.kostya E June 17, 2025, 5:32 p.m. OK C# 13 TESTS 10 124 716800
324983380 lkrh47381 E June 18, 2025, 5:45 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324981890 C_c-c_C E June 18, 2025, 5:30 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324981135 _ryuko E June 18, 2025, 5:23 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324979516 AbhinavSinghVishen E June 18, 2025, 5:06 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324979470 RohithPothuganti E June 18, 2025, 5:05 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324978997 999663 E June 18, 2025, 5 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324976550 shredder69 E June 18, 2025, 4:34 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324976069 surya_majhi E June 18, 2025, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324974530 Mueej E June 18, 2025, 4:10 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324971043 iitiankit E June 18, 2025, 3:31 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324980558 IEC2024044 E June 18, 2025, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324978599 CrazyApple E June 18, 2025, 4:56 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324975468 xiaci E June 18, 2025, 4:21 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324972152 Penguin_02 E June 18, 2025, 3:44 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324971301 theRETROvert E June 18, 2025, 3:34 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324970583 Pramag_IIITD E June 18, 2025, 3:25 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324967006 Laserbeam_77 E June 18, 2025, 2:37 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324958428 Muhammed_Ramadan E June 17, 2025, 11:17 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324954221 georginio E June 17, 2025, 9:14 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324952030 altayeb_132 E June 17, 2025, 8:34 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324985062 berry_10 E June 18, 2025, 6:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324983676 chandangupta00112 E June 18, 2025, 5:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324983571 TheYashB E June 18, 2025, 5:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324982852 i_liek_cheezits E June 18, 2025, 5:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324982439 mt1221292 E June 18, 2025, 5:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324982141 love_gold_ E June 18, 2025, 5:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324981312 RagePhoenix E June 18, 2025, 5:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324981067 CornYumMy E June 18, 2025, 5:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324980918 radhekrishn04 E June 18, 2025, 5:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324978634 Harsh_Chanchlani E June 18, 2025, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
324921015 pspkmahali E June 17, 2025, 4:49 p.m. OK GNU C11 TESTS 10 93 0
324952817 MrWizard_574 E June 17, 2025, 8:47 p.m. OK GNU C11 TESTS 10 108 102400
324920915 tranquyetthang281 E June 17, 2025, 4:49 p.m. OK Go TESTS 10 77 5120000
324976584 akshit669 E June 18, 2025, 4:34 a.m. OK Java 21 TESTS 10 218 716800
324920962 hemant E June 17, 2025, 4:49 p.m. OK Java 21 TESTS 10 233 0
324926175 arjunspundir154 E June 17, 2025, 5:11 p.m. OK Java 21 TESTS 10 233 1740800
324964086 man-ray E June 18, 2025, 1:49 a.m. OK Java 21 TESTS 10 234 1024000
324924323 ash432 E June 17, 2025, 4:59 p.m. OK Java 21 TESTS 10 249 921600
324955767 guharoypragyayan E June 17, 2025, 9:51 p.m. OK Java 21 TESTS 10 264 716800
324942967 Purav_12 E June 17, 2025, 6:36 p.m. OK Java 21 TESTS 10 265 307200
324948854 Divine_Anii E June 17, 2025, 7:46 p.m. OK Java 21 TESTS 10 265 819200
324950762 Hastorius E June 17, 2025, 8:14 p.m. OK Java 21 TESTS 10 265 921600
324975170 Mitul11 E June 18, 2025, 4:18 a.m. OK Java 21 TESTS 10 265 1126400
324941371 tirthgohil1410 E June 17, 2025, 6:21 p.m. OK Java 8 TESTS 10 140 0
324924793 sleempy E June 17, 2025, 5:02 p.m. OK Java 8 TESTS 10 156 0
324983307 Baidiki E June 18, 2025, 5:45 a.m. OK Java 8 TESTS 10 187 0
324946452 kasiru_69 E June 17, 2025, 7:16 p.m. OK Java 8 TESTS 10 187 0
324937569 Sumitsingh7 E June 17, 2025, 5:47 p.m. OK Java 8 TESTS 10 233 6860800
324920954 late_night_order E June 17, 2025, 4:49 p.m. OK Java 8 TESTS 10 249 0
324982589 not_mohith E June 18, 2025, 5:37 a.m. OK Java 8 TESTS 10 265 0
324970470 ishurajora_23 E June 18, 2025, 3:24 a.m. OK Java 8 TESTS 10 265 0
324972985 Dias1177 E June 18, 2025, 3:54 a.m. OK PyPy 3 TESTS 10 280 9728000
324947592 Calculuslove E June 17, 2025, 7:30 p.m. OK PyPy 3 TESTS 10 296 9420800
324973426 Dias1177 E June 18, 2025, 3:59 a.m. OK PyPy 3 TESTS 10 312 9728000
324958979 surajchip2 E June 17, 2025, 11:40 p.m. OK PyPy 3 TESTS 10 328 9625600
324956178 WalrusRamen21 E June 17, 2025, 10:02 p.m. OK PyPy 3 TESTS 10 328 10240000
324922849 radhikapillai25 E June 17, 2025, 4:53 p.m. OK PyPy 3 TESTS 10 358 10035200
324930458 Heko E June 17, 2025, 5:42 p.m. OK PyPy 3 TESTS 10 406 9830400
324943468 DSKroc E June 17, 2025, 6:42 p.m. OK PyPy 3 TESTS 10 1046 10240000
324946154 gardengnome E June 17, 2025, 7:13 p.m. OK PyPy 3-64 TESTS 10 124 4812800
324969270 mvkhanh E June 18, 2025, 3:07 a.m. OK PyPy 3-64 TESTS 10 124 5427200
324938468 347586774 E June 17, 2025, 5:54 p.m. OK PyPy 3-64 TESTS 10 156 5734400
324939335 wallfacer146 E June 17, 2025, 6:02 p.m. OK PyPy 3-64 TESTS 10 156 6451200
324924165 grecil E June 17, 2025, 4:58 p.m. OK PyPy 3-64 TESTS 10 171 4096000
324967357 aam2k6 E June 18, 2025, 2:41 a.m. OK PyPy 3-64 TESTS 10 171 4403200
324948879 LeMih E June 17, 2025, 7:47 p.m. OK PyPy 3-64 TESTS 10 171 5222400
324937815 sushmanth.dampur8780 E June 17, 2025, 5:49 p.m. OK PyPy 3-64 TESTS 10 171 6860800
324929504 OAY71011 E June 17, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 10 171 7475200
324929316 OAY71011 E June 17, 2025, 5:33 p.m. OK PyPy 3-64 TESTS 10 171 7884800
324951870 sh.4teen E June 17, 2025, 8:32 p.m. OK Python 3 TESTS 10 109 307200
324945144 ChatIsThisReal E June 17, 2025, 7 p.m. OK Python 3 TESTS 10 109 307200
324928193 MckyonWee E June 17, 2025, 5:25 p.m. OK Python 3 TESTS 10 109 307200
324984207 luciferstern E June 18, 2025, 5:53 a.m. OK Python 3 TESTS 10 124 307200
324928929 MckyonWee E June 17, 2025, 5:30 p.m. OK Python 3 TESTS 10 124 307200
324922897 MckyonWee E June 17, 2025, 4:53 p.m. OK Python 3 TESTS 10 124 307200
324978882 ___a_s_1_2___ E June 18, 2025, 4:59 a.m. OK Python 3 TESTS 10 140 204800
324976863 svrmalaviya E June 18, 2025, 4:37 a.m. OK Python 3 TESTS 10 140 204800
324975141 kushagra24 E June 18, 2025, 4:18 a.m. OK Python 3 TESTS 10 140 307200
324925100 pranprocodes E June 17, 2025, 5:04 p.m. OK Python 3 TESTS 10 140 307200

remove filters

Back to search problems