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.
Problems
B'Everyone was happy coding, until suddenly a power shortage happened and the best competitive programming site went down. Fortunately, a system administrator bought some new equipment recently, including some UPSs. Thus there are some servers that are still online, but we need all of them to be working in order to keep the round rated. Imagine the servers being a binary string s of length n . If the i -th server is online, then s_i = 1 , and s_i = 0 otherwise. A system administrator can do the following operation called electricity spread, that consists of the following phases: We call a binary string s of length n rated if we can turn on all servers (i.e. make s_i = 1 for 1 <= i <= n ) using the electricity spread operation any number of times (possibly, 0 ). Your task is to find the number of rated strings of length n modulo m . The first and only line contains two integers n and m ( 1 <= n <= 5000 , 10 <= m <= 10^9 ) -- the length of the string and the required module. Print a single integer -- the number of rated binary strings of length n . Since this number can be large, print it modulo m . In the first example, the only rated string is 11. So the answer is 1 . In the second example, the rated strings are: In the third sample, the rated strings are: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
179813482 |
rainboy |
F |
Nov. 6, 2022, 6:41 p.m. |
OK |
GNU C11 |
TESTS |
23 |
124 |
102400 |
|
|
179844740 |
lequangtrung123 |
F |
Nov. 7, 2022, 3:47 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
93 |
102400 |
|
|
179645960 |
gzw2005 |
F |
Nov. 6, 2022, 5 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
156 |
102400 |
|
|
179624013 |
liympanda |
F |
Nov. 6, 2022, 4:32 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
248 |
208588800 |
|
|
179617241 |
emptyhope |
F |
Nov. 6, 2022, 4:03 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
265 |
200908800 |
|
|
179842466 |
czyer |
F |
Nov. 7, 2022, 3:04 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
265 |
201216000 |
|
|
179814421 |
Potassium |
F |
Nov. 6, 2022, 6:51 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
280 |
204800 |
|
|
179628097 |
liuhengxi |
F |
Nov. 6, 2022, 4:47 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
280 |
100454400 |
|
|
179627248 |
qtpk |
F |
Nov. 6, 2022, 4:42 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
296 |
301260800 |
|
|
179628534 |
LZDQ |
F |
Nov. 6, 2022, 4:49 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
327 |
100454400 |
|
|
179863494 |
dottle |
F |
Nov. 7, 2022, 4:06 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
327 |
401715200 |
|
|
179639732 |
applese |
F |
Nov. 6, 2022, 4:59 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
93 |
102400 |
|
|
179633100 |
trainwithoutpain |
F |
Nov. 6, 2022, 4:56 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
109 |
102297600 |
|
|
179616278 |
shadowatyy |
F |
Nov. 6, 2022, 4 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
124 |
204800 |
|
|
179684059 |
cheissmart |
F |
Nov. 6, 2022, 5:22 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
124 |
100454400 |
|
|
179622124 |
RDDCCD |
F |
Nov. 6, 2022, 4:24 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
140 |
0 |
|
|
179620562 |
alireza_kaviani |
F |
Nov. 6, 2022, 4:18 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
140 |
307200 |
|
|
179614224 |
tokusakurai |
F |
Nov. 6, 2022, 3:52 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
171 |
102400 |
|
|
179684030 |
lby_orz |
F |
Nov. 6, 2022, 5:22 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
171 |
512000 |
|
|
179621040 |
Wailydest |
F |
Nov. 6, 2022, 4:20 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
280 |
200806400 |
|
|
179652796 |
Sugar0612 |
F |
Nov. 6, 2022, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
280 |
200908800 |
|
|
179616254 |
hitonanode |
F |
Nov. 6, 2022, 3:59 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
93 |
102400 |
|
|
179645894 |
AutumnKite |
F |
Nov. 6, 2022, 5 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
93 |
102400 |
|
|
179615378 |
blackbori |
F |
Nov. 6, 2022, 3:56 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
124 |
204800 |
|
|
179832279 |
YeongTree |
F |
Nov. 7, 2022, 12:56 a.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
102400 |
|
|
179627059 |
Gary |
F |
Nov. 6, 2022, 4:41 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
218 |
204800 |
|
|
179626051 |
Xellos |
F |
Nov. 6, 2022, 4:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
249 |
201113600 |
|
|
179819197 |
leaf1415 |
F |
Nov. 6, 2022, 7:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
264 |
100454400 |
|
|
179622610 |
stevenkplus |
F |
Nov. 6, 2022, 4:27 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
280 |
100556800 |
|
|
179622461 |
Pointy |
F |
Nov. 6, 2022, 4:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
358 |
204800 |
|
|
179658681 |
keywet06 |
F |
Nov. 6, 2022, 5:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
405 |
200806400 |
|
|
179614949 |
Ormlis |
F |
Nov. 6, 2022, 3:55 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
62 |
0 |
|
|
179623620 |
Rubikun |
F |
Nov. 6, 2022, 4:30 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
62 |
102400 |
|
|
179633190 |
rg_gr |
F |
Nov. 6, 2022, 4:56 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
62 |
9523200 |
|
|
179685043 |
BurnedChicken |
F |
Nov. 6, 2022, 5:28 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
109 |
102400 |
|
|
179620820 |
bthero |
F |
Nov. 6, 2022, 4:19 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
109 |
102400 |
|
|
179686529 |
SomethingNew |
F |
Nov. 6, 2022, 5:37 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
109 |
201113600 |
|
|
179687298 |
SomethingNew |
F |
Nov. 6, 2022, 5:38 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
109 |
802611200 |
|
|
179842538 |
QwQcOrZ |
F |
Nov. 7, 2022, 3:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
124 |
102400 |
|
|
179633370 |
vipjml |
F |
Nov. 6, 2022, 4:57 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
139 |
100556800 |
|
|
179623829 |
jtnydv25 |
F |
Nov. 6, 2022, 4:31 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
139 |
100556800 |
|
|
179614603 |
conqueror_of_tourist |
F |
Nov. 6, 2022, 3:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
23 |
171 |
2764800 |
|
|
remove filters
Back to search problems