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 |
---|---|---|---|---|---|---|
1295 | Educational Codeforces Round 81 (Rated for Div. 2) | FINISHED | False | 7200 | 151514699 | Jan. 29, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 9346 ) | B | Infinite Prefixes | PROGRAMMING | math strings | 1700 |
B'You are given string s of length n consisting of 0-s and 1-s. You build an infinite string t as a concatenation of an infinite number of strings s , or t = ssss ... For example, if s = 10010, then t = 100101001010010... Calculate the number of prefixes of t with balance equal to x . The balance of some string q is equal to cnt_{0, q} - cnt_{1, q} , where cnt_{0, q} is the number of occurrences of 0 in q , and cnt_{1, q} is the number of occurrences of 1 in q . The number of such prefixes can be infinite; if it is so, you must say that. A prefix is a string consisting of several first letters of a given string, without any reorders. An empty prefix is also a valid prefix. For example, the string "abcd" has 5 prefixes: empty string, "a", "ab", "abc" and "abcd". The first line contains the single integer T ( 1 <= T <= 100 ) -- the number of test cases. Next 2T lines contain descriptions of test cases -- two lines per test case. The first line contains two integers n and x ( 1 <= n <= 10^5 , -10^9 <= x <= 10^9 ) -- the length of string s and the desired balance, respectively. The second line contains the binary string s ( |s| = n , s_i in { text{0}, text{1} } ). It 's guaranteed that the total sum of n doesn 't exceed 10^5 . Print T integers -- one per test case. For each test case print the number of prefixes or -1 if there is an infinite number of such prefixes. In the first test case, there are 3 good prefixes of t : with length 28 , 30 and 32 . '... |
Educational Codeforces Round 81 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
70335124 | xianglli | B | Feb. 5, 2020, 7:02 a.m. | OK | Clang++17 Diagnostics | TESTS | 145 | 62 | 14745600 | 1700 | |
69823661 | madsanker | B | Jan. 30, 2020, 8:37 a.m. | OK | Clang++17 Diagnostics | TESTS | 145 | 62 | 15257600 | 1700 | |
69856476 | LaSWeeG | B | Jan. 30, 2020, 5:07 p.m. | OK | FPC | TESTS | 145 | 31 | 65228800 | 1700 | |
69784126 | Lycfucking. | B | Jan. 29, 2020, 4:53 p.m. | OK | FPC | TESTS | 145 | 46 | 1024000 | 1700 | |
69856706 | LaSWeeG | B | Jan. 30, 2020, 5:11 p.m. | OK | FPC | TESTS | 145 | 46 | 65228800 | 1700 | |
69795762 | kaiboy | B | Jan. 29, 2020, 8:03 p.m. | OK | GNU C11 | TESTS | 145 | 31 | 102400 | 1700 | |
70108245 | lishb | B | Feb. 3, 2020, 4:20 a.m. | OK | GNU C11 | TESTS | 145 | 31 | 512000 | 1700 | |
69807677 | 1_l | B | Jan. 30, 2020, 2:48 a.m. | OK | GNU C11 | TESTS | 145 | 31 | 512000 | 1700 | |
69809689 | Enthusiasticcitizens | B | Jan. 30, 2020, 3:47 a.m. | OK | GNU C11 | TESTS | 145 | 31 | 512000 | 1700 | |
70104638 | alwaysF | B | Feb. 3, 2020, 2:23 a.m. | OK | GNU C11 | TESTS | 145 | 31 | 512000 | 1700 | |
69783583 | tanmayaaeron | B | Jan. 29, 2020, 4:48 p.m. | OK | GNU C11 | TESTS | 145 | 31 | 921600 | 1700 | |
69776560 | nEo. | B | Jan. 29, 2020, 4:20 p.m. | OK | GNU C11 | TESTS | 145 | 31 | 921600 | 1700 | |
69772265 | rainboy | B | Jan. 29, 2020, 4:06 p.m. | OK | GNU C11 | TESTS | 145 | 46 | 102400 | 1700 | |
69842454 | MaxC9 | B | Jan. 30, 2020, 1:31 p.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
69768803 | albertxwz | B | Jan. 29, 2020, 3:56 p.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
69807490 | fnoi16wjhui | B | Jan. 30, 2020, 2:42 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
69933786 | CTP_314 | B | Feb. 1, 2020, 2:18 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
69884445 | HANGANG | B | Jan. 31, 2020, 7:40 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
69848598 | Lucario387 | B | Jan. 30, 2020, 2:58 p.m. | OK | GNU C++11 | TESTS | 145 | 31 | 0 | 1700 | |
70084894 | kamilos1089 | B | Feb. 2, 2020, 4:36 p.m. | OK | GNU C++11 | TESTS | 145 | 31 | 102400 | 1700 | |
70344401 | Artoriax | B | Feb. 5, 2020, 9:16 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 102400 | 1700 | |
70407546 | diegoximenes | B | Feb. 6, 2020, 3:19 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 102400 | 1700 | |
70196603 | Alan_zhou | B | Feb. 4, 2020, 12:48 a.m. | OK | GNU C++11 | TESTS | 145 | 31 | 102400 | 1700 | |
69808025 | -Klaus- | B | Jan. 30, 2020, 3 a.m. | OK | GNU C++14 | TESTS | 145 | 30 | 1331200 | 1700 | |
69810867 | willingox | B | Jan. 30, 2020, 4:19 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
70013253 | whdsunny | B | Feb. 2, 2020, 7:32 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
70009518 | Jian_Ron | B | Feb. 2, 2020, 6:17 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69979467 | phongan105 | B | Feb. 1, 2020, 3:54 p.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69918092 | enaim | B | Jan. 31, 2020, 5:31 p.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69876875 | yjh2651 | B | Jan. 31, 2020, 4:32 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69875834 | jinli_ | B | Jan. 31, 2020, 3:57 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69819485 | _HonEy | B | Jan. 30, 2020, 7:16 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 102400 | 1700 | |
69815368 | kutengine | B | Jan. 30, 2020, 5:58 a.m. | OK | GNU C++14 | TESTS | 145 | 31 | 204800 | 1700 | |
69884299 | Z_X_Y | B | Jan. 31, 2020, 7:37 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69857453 | lxdtfo | B | Jan. 30, 2020, 5:25 p.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69936936 | haiqilai | B | Feb. 1, 2020, 4:21 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69938221 | jie_jq | B | Feb. 1, 2020, 5:05 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69943454 | StandNotAlone | B | Feb. 1, 2020, 6:52 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69945289 | StandNotAlone | B | Feb. 1, 2020, 7:25 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
70415381 | cycleke | B | Feb. 6, 2020, 6:55 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
70827081 | Yunnn | B | Feb. 12, 2020, 6:51 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
70933099 | pierre5340 | B | Feb. 13, 2020, 5:48 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69935524 | QoooQ | B | Feb. 1, 2020, 3:28 a.m. | OK | GNU C++17 | TESTS | 145 | 31 | 102400 | 1700 | |
69805470 | ktateish | B | Jan. 30, 2020, 1:33 a.m. | OK | Go | TESTS | 145 | 46 | 0 | 1700 | |
69781060 | naipia | B | Jan. 29, 2020, 4:33 p.m. | OK | Go | TESTS | 145 | 46 | 0 | 1700 | |
69837920 | synapse | B | Jan. 30, 2020, 12:21 p.m. | OK | Go | TESTS | 145 | 62 | 4505600 | 1700 | |
70002639 | vjudge3 | B | Feb. 2, 2020, 2:50 a.m. | OK | Go | TESTS | 145 | 327 | 0 | 1700 | |
69808235 | coder_tq | B | Jan. 30, 2020, 3:06 a.m. | OK | Haskell | TESTS | 145 | 62 | 7475200 | 1700 | |
70322064 | lightseba | B | Feb. 5, 2020, 1:07 a.m. | OK | Java 11 | TESTS | 145 | 186 | 0 | 1700 | |
70028800 | yizheng | B | Feb. 2, 2020, 12:12 p.m. | OK | Java 11 | TESTS | 145 | 186 | 0 | 1700 | |
70179767 | lifeiteng | B | Feb. 3, 2020, 7:41 p.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69970152 | mennafadali | B | Feb. 1, 2020, 1:38 p.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69865615 | Kimo_Fathy | B | Jan. 30, 2020, 8:16 p.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69851906 | abhi123valani | B | Jan. 30, 2020, 3:53 p.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69809657 | Anonymous | B | Jan. 30, 2020, 3:46 a.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69787897 | TheSawan | B | Jan. 29, 2020, 5:40 p.m. | OK | Java 11 | TESTS | 145 | 187 | 0 | 1700 | |
69856054 | saiyam_88 | B | Jan. 30, 2020, 4:59 p.m. | OK | Java 11 | TESTS | 145 | 187 | 5632000 | 1700 | |
69862113 | liebert | B | Jan. 30, 2020, 6:53 p.m. | OK | Java 11 | TESTS | 145 | 202 | 0 | 1700 | |
69928165 | salmaelmahy | B | Jan. 31, 2020, 9:36 p.m. | OK | Java 8 | TESTS | 145 | 109 | 0 | 1700 | |
69811147 | Anu1999 | B | Jan. 30, 2020, 4:25 a.m. | OK | Java 8 | TESTS | 145 | 109 | 0 | 1700 | |
70198045 | manu1996 | B | Feb. 4, 2020, 2:13 a.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70447076 | Aman_23_Gupta | B | Feb. 6, 2020, 3:23 p.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70423601 | Kavi.Prajapati | B | Feb. 6, 2020, 9:27 a.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70409411 | Java | B | Feb. 6, 2020, 4:23 a.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70409365 | Java | B | Feb. 6, 2020, 4:22 a.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70148793 | igor_kz | B | Feb. 3, 2020, 12:27 p.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70095109 | parthp7995 | B | Feb. 2, 2020, 7:53 p.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70085591 | OmarRadwan | B | Feb. 2, 2020, 5:04 p.m. | OK | Java 8 | TESTS | 145 | 124 | 0 | 1700 | |
70913394 | walborn | B | Feb. 12, 2020, 6:58 p.m. | OK | JavaScript | TESTS | 145 | 62 | 8499200 | 1700 | |
69827984 | SlavaG | B | Jan. 30, 2020, 9:40 a.m. | OK | Kotlin | TESTS | 145 | 124 | 0 | 1700 | |
69807040 | Spheniscine | B | Jan. 30, 2020, 2:27 a.m. | OK | Kotlin | TESTS | 145 | 124 | 0 | 1700 | |
69912149 | daxindg | B | Jan. 31, 2020, 3:41 p.m. | OK | Kotlin | TESTS | 145 | 171 | 1228800 | 1700 | |
70774366 | sakapon | B | Feb. 11, 2020, 8:19 a.m. | OK | Mono C# | TESTS | 145 | 62 | 4505600 | 1700 | |
70782712 | sakapon | B | Feb. 11, 2020, 11:17 a.m. | OK | Mono C# | TESTS | 145 | 77 | 4505600 | 1700 | |
69776309 | plasma-effect | B | Jan. 29, 2020, 4:19 p.m. | OK | Mono C# | TESTS | 145 | 77 | 5734400 | 1700 | |
69896486 | nadilk | B | Jan. 31, 2020, 11:53 a.m. | OK | Mono C# | TESTS | 145 | 77 | 9932800 | 1700 | |
69845714 | nastya1199 | B | Jan. 30, 2020, 2:17 p.m. | OK | Mono C# | TESTS | 145 | 78 | 10035200 | 1700 | |
69833990 | Yupiteru | B | Jan. 30, 2020, 11:19 a.m. | OK | Mono C# | TESTS | 145 | 78 | 145203200 | 1700 | |
69905900 | artworks | B | Jan. 31, 2020, 2:07 p.m. | OK | Mono C# | TESTS | 145 | 93 | 5836800 | 1700 | |
69826599 | mban259 | B | Jan. 30, 2020, 9:20 a.m. | OK | Mono C# | TESTS | 145 | 93 | 9113600 | 1700 | |
69876870 | zjut201906061221qls | B | Jan. 31, 2020, 4:32 a.m. | OK | MS C++ | TESTS | 145 | 31 | 307200 | 1700 | |
70955630 | vjudge1 | B | Feb. 13, 2020, 12:43 p.m. | OK | MS C++ | TESTS | 145 | 31 | 512000 | 1700 | |
70596513 | vjudge4 | B | Feb. 9, 2020, 12:43 a.m. | OK | MS C++ | TESTS | 145 | 31 | 512000 | 1700 | |
69873429 | xmgzt | B | Jan. 31, 2020, 2:17 a.m. | OK | MS C++ | TESTS | 145 | 31 | 716800 | 1700 | |
69825647 | tarattata1 | B | Jan. 30, 2020, 9:05 a.m. | OK | MS C++ | TESTS | 145 | 31 | 921600 | 1700 | |
69968459 | dymicboy | B | Feb. 1, 2020, 1:16 p.m. | OK | MS C++ | TESTS | 145 | 31 | 921600 | 1700 | |
70578197 | vjudge4 | B | Feb. 8, 2020, 4:24 p.m. | OK | MS C++ | TESTS | 145 | 46 | 512000 | 1700 | |
69831482 | tarattata1 | B | Jan. 30, 2020, 10:36 a.m. | OK | MS C++ | TESTS | 145 | 46 | 921600 | 1700 | |
70163368 | vlados_850 | B | Feb. 3, 2020, 3:51 p.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 307200 | 1700 | |
70111567 | Prokopiy | B | Feb. 3, 2020, 5:45 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 409600 | 1700 | |
69900887 | Hydrogen_zyx | B | Jan. 31, 2020, 1 p.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 409600 | 1700 | |
69809726 | aliupingtao | B | Jan. 30, 2020, 3:48 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 409600 | 1700 | |
69939978 | Laaahu_ | B | Feb. 1, 2020, 5:47 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 512000 | 1700 | |
69800026 | omerb.zeybek | B | Jan. 29, 2020, 9:54 p.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 614400 | 1700 | |
70596756 | vjudge4 | B | Feb. 9, 2020, 12:59 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 716800 | 1700 | |
69828802 | ZORO5 | B | Jan. 30, 2020, 9:52 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 716800 | 1700 | |
69809129 | nn0960488 | B | Jan. 30, 2020, 3:32 a.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 716800 | 1700 | |
70507814 | vjudge3 | B | Feb. 7, 2020, 2:02 p.m. | OK | MS C++ 2017 | TESTS | 145 | 31 | 819200 | 1700 | |
70106707 | Mmcs | B | Feb. 3, 2020, 3:36 a.m. | OK | PascalABC.NET | TESTS | 145 | 326 | 5836800 | 1700 | |
70107029 | Mmcs | B | Feb. 3, 2020, 3:45 a.m. | OK | PascalABC.NET | TESTS | 145 | 327 | 7680000 | 1700 | |
69785413 | shehebe | B | Jan. 29, 2020, 5:06 p.m. | OK | PyPy 2 | TESTS | 145 | 171 | 2355200 | 1700 | |
69785541 | shehebe | B | Jan. 29, 2020, 5:08 p.m. | OK | PyPy 2 | TESTS | 145 | 171 | 7782400 | 1700 | |
69882365 | aaa_bbb_ccc | B | Jan. 31, 2020, 6:51 a.m. | OK | PyPy 2 | TESTS | 145 | 202 | 3584000 | 1700 | |
69891397 | zhangqingqi | B | Jan. 31, 2020, 10:08 a.m. | OK | PyPy 3 | TESTS | 145 | 155 | 5939200 | 1700 | |
70159436 | hebisuman | B | Feb. 3, 2020, 2:51 p.m. | OK | PyPy 3 | TESTS | 145 | 155 | 7372800 | 1700 | |
69949250 | myvegatablehasexplode | B | Feb. 1, 2020, 8:28 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5017600 | 1700 | |
69880494 | Rahul_Anand | B | Jan. 31, 2020, 6:09 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5017600 | 1700 | |
69828218 | bl97nk | B | Jan. 30, 2020, 9:43 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5017600 | 1700 | |
70414620 | _Kkura_ | B | Feb. 6, 2020, 6:39 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5120000 | 1700 | |
69974237 | _Plague_ | B | Feb. 1, 2020, 2:34 p.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5120000 | 1700 | |
69947670 | yreb | B | Feb. 1, 2020, 8:03 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 5120000 | 1700 | |
69819071 | Coki628 | B | Jan. 30, 2020, 7:08 a.m. | OK | PyPy 3 | TESTS | 145 | 156 | 6041600 | 1700 | |
69863242 | LionCheetah | B | Jan. 30, 2020, 7:18 p.m. | OK | PyPy 3 | TESTS | 145 | 170 | 2457600 | 1700 | |
70485835 | ankit_31122019 | B | Feb. 7, 2020, 7:22 a.m. | OK | Python 2 | TESTS | 145 | 233 | 2969600 | 1700 | |
70032864 | fastnoise | B | Feb. 2, 2020, 1:22 p.m. | OK | Python 3 | TESTS | 145 | 140 | 3379200 | 1700 | |
69801933 | TeaSpill | B | Jan. 29, 2020, 11:04 p.m. | OK | Python 3 | TESTS | 145 | 140 | 3584000 | 1700 | |
70273722 | kastuss | B | Feb. 4, 2020, 3:31 p.m. | OK | Python 3 | TESTS | 145 | 155 | 3686400 | 1700 | |
69780218 | rkaiser | B | Jan. 29, 2020, 4:31 p.m. | OK | Python 3 | TESTS | 145 | 155 | 3993600 | 1700 | |
69770687 | shozy | B | Jan. 29, 2020, 4:01 p.m. | OK | Python 3 | TESTS | 145 | 155 | 7372800 | 1700 | |
69800812 | pizdato | B | Jan. 29, 2020, 10:21 p.m. | OK | Python 3 | TESTS | 145 | 156 | 614400 | 1700 | |
70032544 | mkawa2 | B | Feb. 2, 2020, 1:17 p.m. | OK | Python 3 | TESTS | 145 | 156 | 7680000 | 1700 | |
69995828 | Primusa | B | Feb. 1, 2020, 9:35 p.m. | OK | Python 3 | TESTS | 145 | 170 | 512000 | 1700 | |
69782630 | kcaze | B | Jan. 29, 2020, 4:40 p.m. | OK | Python 3 | TESTS | 145 | 170 | 7372800 | 1700 | |
69825432 | octocoder | B | Jan. 30, 2020, 9:02 a.m. | OK | Python 3 | TESTS | 145 | 171 | 512000 | 1700 | |
70511005 | terraformer | B | Feb. 7, 2020, 2:51 p.m. | OK | Rust | TESTS | 145 | 31 | 3174400 | 1700 | |
69978793 | tuna_salad | B | Feb. 1, 2020, 3:44 p.m. | OK | Rust | TESTS | 145 | 46 | 1024000 | 1700 | |
69847631 | Nogard_ | B | Jan. 30, 2020, 2:45 p.m. | OK | Rust | TESTS | 145 | 46 | 1126400 | 1700 | |
70106017 | kobae964 | B | Feb. 3, 2020, 3:13 a.m. | OK | Rust | TESTS | 145 | 46 | 1536000 | 1700 | |
69786940 | sansen | B | Jan. 29, 2020, 5:25 p.m. | OK | Rust | TESTS | 145 | 46 | 5222400 | 1700 |
Back to search problems