Educational Codeforces Round 194 (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
2260 Educational Codeforces Round 194 (Rated for Div. 2) FINISHED False 7200 2388300 Sept. 8, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1951 ) E Cyclic Balance PROGRAMMING constructive algorithms math

Consider a string (t=t_1t_2\ldots t_m) consisting of the characters 0 and 1 . We call the pairs of adjacent characters of the string (t) the pairs (t_1t_2, t_2t_3, \ldots, t_{m-1}t_m), as well as the pair (t_mt_1). The last pair connects the end of the string with its beginning, so exactly (m) pairs are considered in total. If the string consists of only one character, the only pair that is considered is (t_1 t_1). We call a string (t) cyclically balanced if, among its pairs of adjacent characters, the numbers of pairs 00 , 01 , 10 , and 11 are equal. The cost of a binary string is the minimum number of characters that need to be inserted into it so that it becomes cyclically balanced. Characters may be inserted in any positions, including before the first and after the last character of the string. It is not allowed to delete or replace the original characters. You are given a binary string (s) and (q) queries. In each query, indices (l) and (r) are given. Find the cost of the substring (s_l s_{l+1}\ldots s_r). The first line contains two integers (n) and (q) ((1 \le n, q \le 3 \cdot 10^5)) — the length of the string and the number of queries. The second line contains (s) — a sequence of length (n) consisting of the characters 0 and/or 1 . Then follow (q) lines; the (i)-th of them contains two integers (l_i) and (r_i) ((1 \le l_i \le r_i \le n)) — the boundaries of the substring for the corresponding query. Print (q) integers: the (i)-th integer should be equal to the cost of the substring from the (i)-th query.

Tutorials

156529

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
389983513 yuki_Ishijo E Sept. 9, 2026, 1:26 a.m. OK C# 13 TESTS 26 578 9830400
390062874 wydqwq E Sept. 9, 2026, 10:35 a.m. OK C++17 (GCC 7-32) TESTS 26 187 16076800
389975809 mustafaforce99 E Sept. 8, 2026, 9:01 p.m. OK C++17 (GCC 7-32) TESTS 26 203 0
390061062 JPMM E Sept. 9, 2026, 10:12 a.m. OK C++17 (GCC 7-32) TESTS 26 203 102400
389989045 Gu_ren E Sept. 9, 2026, 3:45 a.m. OK C++17 (GCC 7-32) TESTS 26 203 102400
389960382 ZycK E Sept. 8, 2026, 5:27 p.m. OK C++17 (GCC 7-32) TESTS 26 203 819200
390156896 duongquanghai08 E Sept. 10, 2026, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 26 203 3686400
389987749 zeb6666 E Sept. 9, 2026, 3:19 a.m. OK C++17 (GCC 7-32) TESTS 26 203 3686400
390118168 Nighttlm E Sept. 9, 2026, 3:37 p.m. OK C++17 (GCC 7-32) TESTS 26 203 6041600
390096841 Sekrio E Sept. 9, 2026, 2:01 p.m. OK C++17 (GCC 7-32) TESTS 26 218 0
390076590 bingnb E Sept. 9, 2026, 12:57 p.m. OK C++17 (GCC 7-32) TESTS 26 218 0
389986854 q1uple E Sept. 9, 2026, 2:58 a.m. OK C++20 (GCC 13-64) TESTS 26 78 12288000
390161769 hoanghieudts1 E Sept. 10, 2026, 4:42 a.m. OK C++20 (GCC 13-64) TESTS 26 156 2048000
390000855 Dominator_of_IITJ E Sept. 9, 2026, 6:57 a.m. OK C++20 (GCC 13-64) TESTS 26 171 819200
390069031 bbsiak E Sept. 9, 2026, 11:45 a.m. OK C++20 (GCC 13-64) TESTS 26 171 1945600
389990700 Alasco E Sept. 9, 2026, 4:17 a.m. OK C++20 (GCC 13-64) TESTS 26 171 1945600
389998544 Husanboy E Sept. 9, 2026, 6:27 a.m. OK C++20 (GCC 13-64) TESTS 26 171 3174400
389982400 yizhilenkuchao E Sept. 9, 2026, 12:52 a.m. OK C++20 (GCC 13-64) TESTS 26 171 4915200
390004992 shiinfinite E Sept. 9, 2026, 7:52 a.m. OK C++20 (GCC 13-64) TESTS 26 171 6758400
390161424 hoanghieudts1 E Sept. 10, 2026, 4:35 a.m. OK C++20 (GCC 13-64) TESTS 26 171 6860800
390138500 neel__18 E Sept. 9, 2026, 6:48 p.m. OK C++20 (GCC 13-64) TESTS 26 187 102400
390080090 Eskler E Sept. 9, 2026, 1:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 78 12595200
390078806 Eskler E Sept. 9, 2026, 1:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 78 12595200
390078413 Eskler E Sept. 9, 2026, 1:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 78 12595200
390148670 limamcheikh E Sept. 9, 2026, 10:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 78 44748800
389983586 zyn1919810 E Sept. 9, 2026, 1:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 93 7475200
390077938 Eskler E Sept. 9, 2026, 1:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 93 7782400
389986429 LittleFoxFairy E Sept. 9, 2026, 2:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 93 11059200
390079799 Eskler E Sept. 9, 2026, 1:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 109 12595200
389972705 sbannak E Sept. 8, 2026, 7:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 156 102400
390150263 Alvaro_Quispe E Sept. 9, 2026, 11:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 156 921600
390000251 jeffrey.paulouse E Sept. 9, 2026, 6:49 a.m. OK GNU C11 TESTS 26 78 6451200
389974789 KAVTHI3125 E Sept. 8, 2026, 8:39 p.m. OK Go TESTS 26 375 11468800
390069621 Colthep E Sept. 9, 2026, 11:52 a.m. OK Java 21 TESTS 26 343 2662400
390005539 _Mahesh E Sept. 9, 2026, 8 a.m. OK Java 21 TESTS 26 468 9728000
389966799 shivansh_123 E Sept. 8, 2026, 6:29 p.m. OK Java 21 TESTS 26 546 41676800
390160289 WardellCurry E Sept. 10, 2026, 4:14 a.m. OK Java 21 TESTS 26 562 1945600
389966649 just_coder.18 E Sept. 8, 2026, 6:28 p.m. OK Java 21 TESTS 26 562 41676800
390066936 ironman263 E Sept. 9, 2026, 11:23 a.m. OK Java 21 TESTS 26 1484 2150400
390131531 saihanish E Sept. 9, 2026, 5:37 p.m. OK Java 8 TESTS 26 328 7782400
390119061 preethi.24mei10043 E Sept. 9, 2026, 3:46 p.m. OK Java 8 TESTS 26 328 7782400
390007190 Sahasra1226 E Sept. 9, 2026, 8:22 a.m. OK Java 8 TESTS 26 328 7782400
390071286 kembu E Sept. 9, 2026, 12:09 p.m. OK Java 8 TESTS 26 343 8089600
390118955 Roub E Sept. 9, 2026, 3:45 p.m. OK PyPy 3-64 TESTS 26 328 14950400
389971783 alexenkovova E Sept. 8, 2026, 7:41 p.m. OK PyPy 3-64 TESTS 26 375 82124800
390062756 joyz09 E Sept. 9, 2026, 10:34 a.m. OK PyPy 3-64 TESTS 26 406 14438400
389990733 swervel E Sept. 9, 2026, 4:17 a.m. OK PyPy 3-64 TESTS 26 406 21708800
390147653 ytfish E Sept. 9, 2026, 9:49 p.m. OK PyPy 3-64 TESTS 26 421 24064000
390147524 ytfish E Sept. 9, 2026, 9:45 p.m. OK PyPy 3-64 TESTS 26 453 25292800
389977776 OAY71011 E Sept. 8, 2026, 9:53 p.m. OK PyPy 3-64 TESTS 26 453 26214400
389976277 fakeman55555 E Sept. 8, 2026, 9:13 p.m. OK PyPy 3-64 TESTS 26 500 25907200
390065734 Polynomu E Sept. 9, 2026, 11:10 a.m. OK PyPy 3-64 TESTS 26 625 31846400
390083481 isa773 E Sept. 9, 2026, 1:36 p.m. OK PyPy 3-64 TESTS 26 703 122265600
390058992 code.demon E Sept. 9, 2026, 9:46 a.m. OK Python 3 TESTS 26 671 81408000
389965041 Faizyab E Sept. 8, 2026, 6:11 p.m. OK Python 3 TESTS 26 671 86528000
389999052 gooonn E Sept. 9, 2026, 6:34 a.m. OK Python 3 TESTS 26 687 82329600
389992915 yashmittal2430 E Sept. 9, 2026, 4:57 a.m. OK Python 3 TESTS 26 828 83251200
389986506 lowestx9 E Sept. 9, 2026, 2:50 a.m. OK Python 3 TESTS 26 843 82124800
390063054 lalchand_mondalcse1234 E Sept. 9, 2026, 10:38 a.m. OK Python 3 TESTS 26 1312 58675200
389975486 abhishekraj0029 E Sept. 8, 2026, 8:53 p.m. OK Python 3 TESTS 26 1671 46592000
389961505 Solalyth E Sept. 8, 2026, 5:37 p.m. OK Rust 2024 TESTS 26 156 29696000

remove filters

Back to search problems