Educational Codeforces Round 152 (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
1849 Educational Codeforces Round 152 (Rated for Div. 2) FINISHED False 7200 46711463 July 27, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10949 ) C Binary String Copying PROGRAMMING binary search brute force data structures hashing strings

B"You are given a string s consisting of n characters 0 and/or 1. You make m copies of this string, let the i -th copy be the string t_i . Then you perform exactly one operation on each of the copies: for the i -th copy, you sort its substring [l_i; r_i] (the substring from the l_i -th character to the r_i -th character, both endpoints inclusive). Note that each operation affects only one copy, and each copy is affected by only one operation. Your task is to calculate the number of different strings among t_1, t_2, ldots, t_m . Note that the initial string s should be counted only if at least one of the copies stays the same after the operation. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and m ( 1 <= n, m <= 2 cdot 10^5 ) -- the length of s and the number of copies, respectively. The second line contains n characters 0 and/or 1 -- the string s . Then m lines follow. The i -th of them contains two integers l_i and r_i ( 1 <= l_i <= r_i <= n ) -- the description of the operation applied to the i -th copy. The sum of n over all test cases doesn't exceed 2 cdot 10^5 . The sum of m over all test cases doesn't exceed 2 cdot 10^5 . Print one integer -- the number of different strings among t_1, t_2, ldots, t_m . Consider the first example. Copies below are given in order of the input operations. Underlined substrings are substrings that are sorted: There are three different strings among t_1, t_2, t_3, t_4, t_5 : 000111, 011100 and 101100. Consider the second example: There are three different strings among t_1, t_2, t_3, t_4 : 001111, 010111 and 100111. "...

Tutorials

118752

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
215987132 Alfafox C July 27, 2023, 5:02 p.m. OK C# 10 TESTS 10 311 27648000
216035509 ravinem1 C July 28, 2023, 3:30 a.m. OK C# 8 TESTS 10 374 31539200
216036758 Grey_track C July 28, 2023, 3:47 a.m. OK GNU C++14 TESTS 10 124 7987200
215987350 Locat C July 27, 2023, 5:03 p.m. OK GNU C++14 TESTS 10 140 5836800
216029096 Taro2022 C July 28, 2023, 2:08 a.m. OK GNU C++14 TESTS 10 140 8908800
216033479 codeforces_pupil C July 28, 2023, 3:03 a.m. OK GNU C++14 TESTS 10 155 7475200
216031350 Weaving_Songs C July 28, 2023, 2:37 a.m. OK GNU C++14 TESTS 10 155 7475200
216033966 vipul_singh C July 28, 2023, 3:09 a.m. OK GNU C++14 TESTS 10 155 7577600
216032491 yuzou C July 28, 2023, 2:51 a.m. OK GNU C++14 TESTS 10 155 7577600
216000439 dat C July 27, 2023, 6:43 p.m. OK GNU C++14 TESTS 10 155 7577600
215988395 shiye0803 C July 27, 2023, 5:09 p.m. OK GNU C++14 TESTS 10 155 7577600
216029824 Taro2022 C July 28, 2023, 2:18 a.m. OK GNU C++14 TESTS 10 155 8908800
215987786 Vania_Javadi C July 27, 2023, 5:06 p.m. OK GNU C++17 TESTS 10 109 5427200
215987722 geniusNabina C July 27, 2023, 5:05 p.m. OK GNU C++17 TESTS 10 109 5427200
215991176 CSHwang C July 27, 2023, 5:27 p.m. OK GNU C++17 TESTS 10 124 5017600
216031872 5-3 C July 28, 2023, 2:43 a.m. OK GNU C++17 TESTS 10 140 3788800
215984113 naisheelpatel C July 27, 2023, 4:46 p.m. OK GNU C++17 TESTS 10 140 3788800
216039973 wsfwb C July 28, 2023, 4:28 a.m. OK GNU C++17 TESTS 10 140 7577600
216001723 r1kvay C July 27, 2023, 6:57 p.m. OK GNU C++17 TESTS 10 140 8089600
216044425 nordanov C July 28, 2023, 5:27 a.m. OK GNU C++17 TESTS 10 155 7475200
216036626 Lu_men C July 28, 2023, 3:45 a.m. OK GNU C++17 TESTS 10 155 7475200
216034792 W921106840130 C July 28, 2023, 3:20 a.m. OK GNU C++17 TESTS 10 155 7475200
215982451 BraveAnt C July 27, 2023, 4:39 p.m. OK GNU C++17 (64) TESTS 10 109 7065600
216013119 enslaved C July 27, 2023, 9:17 p.m. OK GNU C++17 (64) TESTS 10 109 10956800
216036653 liuhao24 C July 28, 2023, 3:45 a.m. OK GNU C++17 (64) TESTS 10 124 6963200
216045832 banxiaodou C July 28, 2023, 5:45 a.m. OK GNU C++17 (64) TESTS 10 155 10137600
216027298 Kinuru C July 28, 2023, 1:43 a.m. OK GNU C++17 (64) TESTS 10 155 14438400
216034490 Sy_03 C July 28, 2023, 3:17 a.m. OK GNU C++17 (64) TESTS 10 156 10137600
216033673 dancemonkey C July 28, 2023, 3:05 a.m. OK GNU C++17 (64) TESTS 10 170 9318400
216047047 Alfa C July 28, 2023, 5:59 a.m. OK GNU C++17 (64) TESTS 10 171 10137600
216044244 gqf123 C July 28, 2023, 5:25 a.m. OK GNU C++17 (64) TESTS 10 171 10137600
216046108 ShirosakiMieru C July 28, 2023, 5:48 a.m. OK GNU C++17 (64) TESTS 10 171 10240000
216036104 baile C July 28, 2023, 3:38 a.m. OK GNU C++20 (64) TESTS 10 78 3686400
216035934 liuhua666 C July 28, 2023, 3:36 a.m. OK GNU C++20 (64) TESTS 10 78 3686400
216026032 willwin4sure C July 28, 2023, 1:26 a.m. OK GNU C++20 (64) TESTS 10 78 3686400
215986041 ContronThePanda C July 27, 2023, 4:55 p.m. OK GNU C++20 (64) TESTS 10 78 5324800
216037292 kkkzj C July 28, 2023, 3:53 a.m. OK GNU C++20 (64) TESTS 10 78 6963200
216015799 Vi_neet_to_prevail C July 27, 2023, 10:01 p.m. OK GNU C++20 (64) TESTS 10 78 6963200
216034094 shiny_sur_co C July 28, 2023, 3:11 a.m. OK GNU C++20 (64) TESTS 10 78 7065600
216036031 like3212 C July 28, 2023, 3:37 a.m. OK GNU C++20 (64) TESTS 10 93 5017600
216004916 riverwalk7 C July 27, 2023, 7:31 p.m. OK GNU C++20 (64) TESTS 10 93 6553600
216037526 sai_kamal C July 28, 2023, 3:56 a.m. OK GNU C++20 (64) TESTS 10 93 10137600
216028144 cck111 C July 28, 2023, 1:55 a.m. OK Go TESTS 10 218 18124800
215992454 dzhi C July 27, 2023, 5:36 p.m. OK Java 11 TESTS 10 373 18432000
216034400 hzEnv C July 28, 2023, 3:15 a.m. OK Java 11 TESTS 10 390 4300800
216034886 hzEnv C July 28, 2023, 3:22 a.m. OK Java 11 TESTS 10 436 4198400
216012096 kushwaha_vi C July 27, 2023, 9:01 p.m. OK Java 11 TESTS 10 452 13004800
216009999 henrychenOutlook C July 27, 2023, 8:32 p.m. OK Java 11 TESTS 10 483 33280000
216000151 believe18 C July 27, 2023, 6:40 p.m. OK Java 11 TESTS 10 499 14438400
215985312 serndipty_ C July 27, 2023, 4:52 p.m. OK Java 11 TESTS 10 499 14438400
216029579 karamkontar C July 28, 2023, 2:15 a.m. OK Java 11 TESTS 10 530 14028800
216034339 InfinitePath C July 28, 2023, 3:15 a.m. OK Java 11 TESTS 10 716 80793600
216037966 qwerty12345qwerty C July 28, 2023, 4:01 a.m. OK Java 11 TESTS 10 779 11673600
216028605 fightingxjz C July 28, 2023, 2:01 a.m. OK Java 17 TESTS 10 467 12492800
216034836 hzEnv C July 28, 2023, 3:21 a.m. OK Java 17 TESTS 10 482 14643200
216030556 fightingxjz C July 28, 2023, 2:28 a.m. OK Java 17 TESTS 10 483 12800000
216034364 hzEnv C July 28, 2023, 3:15 a.m. OK Java 17 TESTS 10 483 14643200
216035644 rdhakar246 C July 28, 2023, 3:32 a.m. OK Java 17 TESTS 10 560 16691200
216022659 songminsang C July 28, 2023, 12:31 a.m. OK Java 17 TESTS 10 577 14438400
216018676 mcrash12 C July 27, 2023, 10:59 p.m. OK Java 17 TESTS 10 592 26931200
216023106 miminguci C July 28, 2023, 12:39 a.m. OK Java 17 TESTS 10 639 36454400
216044677 hzEnv C July 28, 2023, 5:30 a.m. OK Java 8 TESTS 10 296 2048000
216036216 hzEnv C July 28, 2023, 3:39 a.m. OK Java 8 TESTS 10 296 2048000
216035977 hzEnv C July 28, 2023, 3:36 a.m. OK Java 8 TESTS 10 311 2048000
216034863 hzEnv C July 28, 2023, 3:21 a.m. OK Java 8 TESTS 10 311 2048000
216034416 hzEnv C July 28, 2023, 3:16 a.m. OK Java 8 TESTS 10 312 2048000
216037437 hzEnv C July 28, 2023, 3:55 a.m. OK Java 8 TESTS 10 326 2048000
216037931 priyaroy3370 C July 28, 2023, 4:01 a.m. OK Java 8 TESTS 10 327 24166400
216029469 priyaroy3370 C July 28, 2023, 2:13 a.m. OK Java 8 TESTS 10 343 24166400
216046433 amit_roy C July 28, 2023, 5:52 a.m. OK Java 8 TESTS 10 701 16793600
216003633 mohamedhassan_c C July 27, 2023, 7:17 p.m. OK Java 8 TESTS 10 764 141619200
216039412 fanhuaxingyu C July 28, 2023, 4:20 a.m. OK MS C++ 2017 TESTS 10 374 8908800
215988810 DonSilvio C July 27, 2023, 5:12 p.m. OK MS C++ 2017 TESTS 10 436 8192000
216000325 tatianyi C July 27, 2023, 6:42 p.m. OK MS C++ 2017 TESTS 10 499 21504000
216002797 tatianyi C July 27, 2023, 7:08 p.m. OK MS C++ 2017 TESTS 10 561 21504000
215997641 Yash_Nandwana C July 27, 2023, 6:18 p.m. OK PyPy 3 TESTS 10 327 20377600
215986563 Naughty_Tactician C July 27, 2023, 4:58 p.m. OK PyPy 3 TESTS 10 592 26521600
216040761 grente C July 28, 2023, 4:40 a.m. OK PyPy 3 TESTS 10 1699 18227200
216013979 pglutz C July 27, 2023, 9:31 p.m. OK PyPy 3-64 TESTS 10 202 22732800
216009951 Cooked_Marsh C July 27, 2023, 8:31 p.m. OK PyPy 3-64 TESTS 10 218 22630400
216027359 mikeac C July 28, 2023, 1:44 a.m. OK PyPy 3-64 TESTS 10 218 24268800
216006710 RobinFromTheHood C July 27, 2023, 7:52 p.m. OK PyPy 3-64 TESTS 10 218 26931200
215986337 Leeisateam C July 27, 2023, 4:56 p.m. OK PyPy 3-64 TESTS 10 233 23244800
215992516 flygon C July 27, 2023, 5:37 p.m. OK PyPy 3-64 TESTS 10 234 22937600
215986408 Leeisateam C July 27, 2023, 4:57 p.m. OK PyPy 3-64 TESTS 10 249 23142400
216044110 MistaFlash C July 28, 2023, 5:23 a.m. OK PyPy 3-64 TESTS 10 249 25497600
216004625 gardengnome C July 27, 2023, 7:28 p.m. OK PyPy 3-64 TESTS 10 249 27443200
215988787 injust C July 27, 2023, 5:12 p.m. OK PyPy 3-64 TESTS 10 264 26828800
215987064 iron_nicko C July 27, 2023, 5:02 p.m. OK Python 3 TESTS 10 499 34713600
215986968 NothingButW C July 27, 2023, 5 p.m. OK Python 3 TESTS 10 499 34713600
216011232 IngaleAnkur10 C July 27, 2023, 8:49 p.m. OK Python 3 TESTS 10 576 32972800
216006957 alexpods C July 27, 2023, 7:55 p.m. OK Python 3 TESTS 10 576 63488000
216010990 IngaleAnkur10 C July 27, 2023, 8:46 p.m. OK Python 3 TESTS 10 577 32972800
215996855 laala C July 27, 2023, 6:11 p.m. OK Python 3 TESTS 10 577 32972800
216035251 sami02jain C July 28, 2023, 3:27 a.m. OK Python 3 TESTS 10 623 41267200
215996833 BananaHead C July 27, 2023, 6:11 p.m. OK Python 3 TESTS 10 639 41574400
215983810 iron_nicko C July 27, 2023, 4:45 p.m. OK Python 3 TESTS 10 748 39424000
216012727 elana C July 27, 2023, 9:11 p.m. OK Python 3 TESTS 10 794 36044800
216031568 khollbach C July 28, 2023, 2:39 a.m. OK Rust 2021 TESTS 10 171 15667200

remove filters

Back to search problems