Educational Codeforces Round 186 (Rated for 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
2182 Educational Codeforces Round 186 (Rated for Div. 2) FINISHED False 7200 9386723 Dec. 29, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 25141 ) A New Year String PROGRAMMING greedy implementation strings

We will call a string consisting of characters 0 , 2 , 5 , and/or 6 a New Year string if at least one of the two conditions is met: it contains the string 2026 as a continuous substring; it does not contain the string 2025 as a continuous substring. For example, the strings 20252026 , 21026 , 20262026 , 000 are New Year strings. The strings 2025 , 20256 , 20252025 , 000202500020226 are not New Year strings. You are given a string (s). You can perform the following operation any number of times (possibly zero): choose a character in the string (s) and replace it with 0 , 2 , 5 , or 6 (you can choose any one of these four characters). Calculate the minimum number of operations needed to make the string (s) a New Year string. The first line contains one integer (t) ((1 \le t \le 10^4)) — the number of test cases. Each test case consists of two lines: the first line contains one integer (n) ((4 \le n \le 20)) — the number of characters in (s); the second line contains (s) — a sequence of (n) characters 0 , 2 , 5 , and/or 6 . For each test case, output one integer — the minimum number of operations needed to make the string (s) a New Year string. In the second example from the statement, you can replace the (2)-nd character of the string with 2 . Then the string will become 2225 . In the fifth example from the statement, you can replace the (4)-th character with 6 . Then the string will become 20262025 . In the sixth example from the statement, you can replace the (8)-th character with 6 . Then the string will become 202520266 .

Tutorials

Educational Codeforces Round 186 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
355829366 ya_hossein A Dec. 30, 2025, 4:56 a.m. OK C# 13 TESTS 8 78 1126400
355946727 Amirhossein90 A Dec. 31, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355943359 youiaOO A Dec. 31, 2025, 5:12 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355941560 pranabmishra2602 A Dec. 31, 2025, 4:40 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355941117 _Rafferty_ A Dec. 31, 2025, 4:32 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355940181 jimmysit0 A Dec. 31, 2025, 4:12 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355933832 Summer_night A Dec. 31, 2025, 1:51 a.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355924348 desiaarjav A Dec. 30, 2025, 9:05 p.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355923987 Mohammed_Hamed8 A Dec. 30, 2025, 8:58 p.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355922711 CrabMaster A Dec. 30, 2025, 8:34 p.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355921202 NOAH01 A Dec. 30, 2025, 8:08 p.m. OK C++17 (GCC 7-32) TESTS 8 31 0
355913102 Harsh_maheriya A Dec. 30, 2025, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 8 15 0
355946449 Madhur_20 A Dec. 31, 2025, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355943750 rndmcoderr A Dec. 31, 2025, 5:18 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355941829 Believer_112 A Dec. 31, 2025, 4:46 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355941545 MO_WILDE A Dec. 31, 2025, 4:40 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355939681 sujoyy19 A Dec. 31, 2025, 4:01 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355939286 manojK07 A Dec. 31, 2025, 3:52 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355933308 _Manual_ A Dec. 31, 2025, 1:33 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355932760 SpinVoid A Dec. 31, 2025, 1:17 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355932278 Ismael101038 A Dec. 31, 2025, 1:02 a.m. OK C++20 (GCC 13-64) TESTS 8 31 0
355940839 dhane_4651 A Dec. 31, 2025, 4:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 0
355918721 .sir. A Dec. 30, 2025, 7:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 0
355865245 shreyfg A Dec. 30, 2025, 11:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 0
355856008 Arceus. A Dec. 30, 2025, 9:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 0
355826376 fggyongheng A Dec. 30, 2025, 4:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 0
355891700 lucas6h A Dec. 30, 2025, 3:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 102400
355847677 Het_exec A Dec. 30, 2025, 8:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 15 102400
355946982 Wael_Zaiback A Dec. 31, 2025, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 31 0
355945423 jkpromax A Dec. 31, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 31 0
355943395 Aditya_Kaushik_ A Dec. 31, 2025, 5:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 8 31 0
355882009 ayushXXX A Dec. 30, 2025, 1:58 p.m. OK GNU C11 TESTS 8 46 0
355797375 Prity106 A Dec. 29, 2025, 6:24 p.m. OK GNU C11 TESTS 8 46 0
355940830 SHAHRIAR_MAHI A Dec. 31, 2025, 4:27 a.m. OK GNU C11 TESTS 8 62 0
355893697 shield137 A Dec. 30, 2025, 3:41 p.m. OK GNU C11 TESTS 8 62 0
355887694 24je0160 A Dec. 30, 2025, 2:48 p.m. OK GNU C11 TESTS 8 62 0
355858727 KL2400031478 A Dec. 30, 2025, 10:24 a.m. OK GNU C11 TESTS 8 62 0
355842850 Coderhacks16 A Dec. 30, 2025, 7:53 a.m. OK GNU C11 TESTS 8 62 0
355802580 Unfathomable_01 A Dec. 29, 2025, 7:21 p.m. OK GNU C11 TESTS 8 62 102400
355922100 ShenDev A Dec. 30, 2025, 8:23 p.m. OK GNU C11 TESTS 8 62 307200
355937396 Cessdav A Dec. 31, 2025, 3:14 a.m. OK GNU C11 TESTS 8 78 0
355822579 Haven_ A Dec. 30, 2025, 2:48 a.m. OK Go TESTS 8 31 512000
355853182 Leeeee A Dec. 30, 2025, 9:30 a.m. OK Go TESTS 8 46 204800
355852668 glebsamsonov A Dec. 30, 2025, 9:25 a.m. OK Go TESTS 8 46 204800
355837763 leo_18_2022 A Dec. 30, 2025, 7:04 a.m. OK Go TESTS 8 46 512000
355818482 daoqi A Dec. 30, 2025, 12:58 a.m. OK Go TESTS 8 46 512000
355924973 mohanys A Dec. 30, 2025, 9:19 p.m. OK Go TESTS 8 140 1536000
355838983 disha00 A Dec. 30, 2025, 7:16 a.m. OK Java 21 TESTS 8 187 409600
355823117 ak_vishwakarma_1 A Dec. 30, 2025, 2:59 a.m. OK Java 21 TESTS 8 203 409600
355941322 omlolgfg A Dec. 31, 2025, 4:35 a.m. OK Java 21 TESTS 8 203 1433600
355795032 priyank_4_sure A Dec. 29, 2025, 6:03 p.m. OK Java 21 TESTS 8 218 0
355829692 divyanshnm A Dec. 30, 2025, 5:02 a.m. OK Java 21 TESTS 8 218 512000
355933865 NanDemo A Dec. 31, 2025, 1:52 a.m. OK Java 21 TESTS 8 218 614400
355900848 amit_roy A Dec. 30, 2025, 4:40 p.m. OK Java 21 TESTS 8 218 614400
355900708 priyaroy3370 A Dec. 30, 2025, 4:39 p.m. OK Java 21 TESTS 8 218 614400
355789002 paras16 A Dec. 29, 2025, 5:10 p.m. OK Java 21 TESTS 8 218 614400
355842160 __Aviral__ A Dec. 30, 2025, 7:46 a.m. OK Java 21 TESTS 8 234 409600
355846467 arnaw34 A Dec. 30, 2025, 8:26 a.m. OK Java 8 TESTS 8 93 0
355934904 25505a0502 A Dec. 31, 2025, 2:21 a.m. OK Java 8 TESTS 8 109 0
355934472 24501a05k4 A Dec. 31, 2025, 2:12 a.m. OK Java 8 TESTS 8 109 0
355944856 newaz420 A Dec. 31, 2025, 5:37 a.m. OK Java 8 TESTS 8 140 0
355859432 kidus72 A Dec. 30, 2025, 10:31 a.m. OK Java 8 TESTS 8 140 0
355798448 golions A Dec. 29, 2025, 6:35 p.m. OK Java 8 TESTS 8 140 0
355803632 Pranav_45 A Dec. 29, 2025, 7:34 p.m. OK Java 8 TESTS 8 140 39014400
355825057 chengzijun_de_xiatian A Dec. 30, 2025, 3:37 a.m. OK Java 8 TESTS 8 156 0
355913602 Romeo_05 A Dec. 30, 2025, 6:30 p.m. OK Java 8 TESTS 8 187 0
355866399 Prittam_01 A Dec. 30, 2025, 11:34 a.m. OK Java 8 TESTS 8 187 0
355942933 tirth9960 A Dec. 31, 2025, 5:06 a.m. OK Kotlin 1.7 TESTS 8 312 4812800
355867323 DmitriyT A Dec. 30, 2025, 11:42 a.m. OK Kotlin 2.2 TESTS 8 171 0
355942063 Raahul_404 A Dec. 31, 2025, 4:51 a.m. OK PyPy 3 TESTS 8 125 4915200
355936983 Ayyylmao A Dec. 31, 2025, 3:07 a.m. OK PyPy 3 TESTS 8 218 7065600
355856921 AsianCoder01 A Dec. 30, 2025, 10:07 a.m. OK PyPy 3 TESTS 8 250 6656000
355800825 bhargavgannavarapu2006 A Dec. 29, 2025, 7:02 p.m. OK PyPy 3 TESTS 8 250 6656000
355816099 lightningskipper A Dec. 29, 2025, 11:41 p.m. OK PyPy 3 TESTS 8 250 6963200
355794209 kushjain_2312 A Dec. 29, 2025, 5:56 p.m. OK PyPy 3 TESTS 8 250 7577600
355915132 soliditydeveloper A Dec. 30, 2025, 6:46 p.m. OK PyPy 3 TESTS 8 250 7680000
355811079 szpu_ark A Dec. 29, 2025, 9:38 p.m. OK PyPy 3 TESTS 8 250 8601600
355881457 Alina_Red A Dec. 30, 2025, 1:53 p.m. OK PyPy 3 TESTS 8 265 6963200
355791296 _kingpin_ A Dec. 29, 2025, 5:28 p.m. OK PyPy 3 TESTS 8 265 7372800
355792365 aa_despa A Dec. 29, 2025, 5:38 p.m. OK PyPy 3-64 TESTS 8 78 1945600
355838262 gardengnome A Dec. 30, 2025, 7:09 a.m. OK PyPy 3-64 TESTS 8 78 2867200
355797820 AKIDNAR A Dec. 29, 2025, 6:29 p.m. OK PyPy 3-64 TESTS 8 78 3584000
355812802 sanctus A Dec. 29, 2025, 10:18 p.m. OK PyPy 3-64 TESTS 8 78 3686400
355840294 Azusa A Dec. 30, 2025, 7:29 a.m. OK PyPy 3-64 TESTS 8 93 3276800
355913677 jvatsal0709 A Dec. 30, 2025, 6:30 p.m. OK PyPy 3-64 TESTS 8 93 3481600
355838177 OAY71011 A Dec. 30, 2025, 7:08 a.m. OK PyPy 3-64 TESTS 8 93 3584000
355807664 OmarMoBadr A Dec. 29, 2025, 8:32 p.m. OK PyPy 3-64 TESTS 8 93 3584000
355859884 eeyoowan A Dec. 30, 2025, 10:35 a.m. OK PyPy 3-64 TESTS 8 93 4096000
355808416 alexwice A Dec. 29, 2025, 8:45 p.m. OK PyPy 3-64 TESTS 8 93 4198400
355865258 VSS303311Ashalina_Butt A Dec. 30, 2025, 11:23 a.m. OK Python 3 TESTS 8 62 0
355916648 rezoeris A Dec. 30, 2025, 7:03 p.m. OK Python 3 TESTS 8 62 204800
355842036 Azusa A Dec. 30, 2025, 7:45 a.m. OK Python 3 TESTS 8 62 1228800
355926665 Daniiiiiil A Dec. 30, 2025, 9:58 p.m. OK Python 3 TESTS 8 78 0
355906699 samriddhi2705 A Dec. 30, 2025, 5:30 p.m. OK Python 3 TESTS 8 78 0
355898218 eihyy A Dec. 30, 2025, 4:18 p.m. OK Python 3 TESTS 8 78 0
355895001 Harish1011 A Dec. 30, 2025, 3:52 p.m. OK Python 3 TESTS 8 78 0
355886255 dinesh-kumar-e A Dec. 30, 2025, 2:35 p.m. OK Python 3 TESTS 8 78 0
355828972 vishalkumar366311 A Dec. 30, 2025, 4:50 a.m. OK Python 3 TESTS 8 78 0
355813118 tejasvini A Dec. 29, 2025, 10:25 p.m. OK Python 3 TESTS 8 78 0
355940672 Spheniscine A Dec. 31, 2025, 4:23 a.m. OK Rust 2021 TESTS 8 31 102400
355928362 satylogin A Dec. 30, 2025, 10:42 p.m. OK Rust 2021 TESTS 8 46 0
355925598 pharaok A Dec. 30, 2025, 9:33 p.m. OK Rust 2021 TESTS 8 46 102400
355936746 hirose2020 A Dec. 31, 2025, 3:01 a.m. OK Rust 2024 TESTS 8 31 0
355912750 m397 A Dec. 30, 2025, 6:22 p.m. OK Rust 2024 TESTS 8 46 0
355888896 hhuukhang A Dec. 30, 2025, 2:59 p.m. OK Rust 2024 TESTS 8 46 0
355820303 chreh A Dec. 30, 2025, 2 a.m. OK Rust 2024 TESTS 8 46 0

remove filters

Back to search problems