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'William really likes the cellular automaton called "Game of Life" so he decided to make his own version. For simplicity, William decided to define his cellular automaton on an array containing n cells, with each cell either being alive or dead. Evolution of the array in William 's cellular automaton occurs iteratively in the following way: Check the note section for examples of the evolution. You are given some initial state of all elements and you need to help William find the state of the array after m iterations of evolution. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^3 ). Description of the test cases follows. The first line of each test case contains two integers n and m ( 2 <= n <= 10^3, 1 <= m <= 10^9 ), which are the total number of cells in the array and the number of iterations. The second line of each test case contains a string of length n made up of characters "0" and "1" and defines the initial state of the array. "1" means a cell is alive and "0" means it is dead. It is guaranteed that the sum of n over all test cases does not exceed 10^4 . In each test case output a string of length n , made up of characters "0" and "1" -- the state of the array after m iterations of evolution. Sequence of iterations of evolution for the first test case Sequence of iterations of evolution for the second test case '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
117925506 |
ssvb |
A |
May 30, 2021, 6:06 p.m. |
OK |
D |
TESTS |
27 |
30 |
4198400 |
|
800 |
117927881 |
BLSkywolf |
A |
May 30, 2021, 6:35 p.m. |
OK |
GNU C11 |
TESTS |
27 |
31 |
0 |
|
800 |
117931749 |
20bcs030 |
A |
May 30, 2021, 7:30 p.m. |
OK |
GNU C11 |
TESTS |
27 |
31 |
0 |
|
800 |
117953417 |
hritikritesh |
A |
May 31, 2021, 5:20 a.m. |
OK |
GNU C11 |
TESTS |
28 |
31 |
0 |
|
800 |
117947936 |
milan_s1 |
A |
May 31, 2021, 3:57 a.m. |
OK |
GNU C11 |
TESTS |
28 |
31 |
0 |
|
800 |
117956275 |
huangmx |
A |
May 31, 2021, 5:59 a.m. |
OK |
GNU C11 |
TESTS |
28 |
31 |
0 |
|
800 |
117922635 |
fishcathu. |
A |
May 30, 2021, 5:38 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
0 |
|
800 |
117909144 |
Clayatu |
A |
May 30, 2021, 4:11 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
0 |
|
800 |
117911761 |
Darshpreet |
A |
May 30, 2021, 4:23 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
0 |
|
800 |
117948301 |
Deep_Kevin |
A |
May 31, 2021, 4:05 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
15 |
0 |
|
800 |
117943605 |
changle_cyx |
A |
May 31, 2021, 2:13 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
15 |
0 |
|
800 |
117941250 |
chasing_dream |
A |
May 31, 2021, 12:42 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
15 |
0 |
|
800 |
117934403 |
_Rifat |
A |
May 30, 2021, 8:19 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
0 |
|
800 |
117929793 |
Acranker |
A |
May 30, 2021, 7:03 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
0 |
|
800 |
117912325 |
Position_s |
A |
May 30, 2021, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
15 |
204800 |
|
800 |
117952817 |
Hxian |
A |
May 31, 2021, 5:10 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
0 |
|
800 |
117942337 |
Shaurya |
A |
May 31, 2021, 1:29 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
0 |
|
800 |
117939895 |
p4lacios |
A |
May 30, 2021, 11:38 p.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
0 |
|
800 |
117928578 |
mystic_ankush |
A |
May 30, 2021, 6:45 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
15 |
0 |
|
800 |
117927486 |
harleensingh |
A |
May 30, 2021, 6:29 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
15 |
0 |
|
800 |
117939388 |
avg_cf_user |
A |
May 30, 2021, 11:12 p.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
102400 |
|
800 |
117940599 |
loOpInfinityy |
A |
May 31, 2021, 12:10 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
204800 |
|
800 |
117931136 |
Sweety |
A |
May 30, 2021, 7:21 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
15 |
204800 |
|
800 |
117916768 |
hieu_2004 |
A |
May 30, 2021, 4:43 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
15 |
204800 |
|
800 |
117918473 |
pranav_63 |
A |
May 30, 2021, 4:48 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
15 |
1536000 |
|
800 |
117954316 |
Rb2.3 |
A |
May 31, 2021, 5:33 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
30 |
0 |
|
800 |
117955802 |
kimino |
A |
May 31, 2021, 5:53 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117951251 |
anil_111 |
A |
May 31, 2021, 4:47 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117949279 |
raj_chordia |
A |
May 31, 2021, 4:24 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117947194 |
Cccc23333 |
A |
May 31, 2021, 3:41 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117946297 |
ACMtourist |
A |
May 31, 2021, 3:22 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117945436 |
Sultan-18 |
A |
May 31, 2021, 3:01 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117940723 |
wxhzyr |
A |
May 31, 2021, 12:16 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
800 |
117931213 |
harpreet1237 |
A |
May 30, 2021, 7:23 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
15 |
0 |
|
800 |
117921932 |
gopi_ldce |
A |
May 30, 2021, 5:34 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
15 |
0 |
|
800 |
117921451 |
Ant_Man |
A |
May 30, 2021, 5:31 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
15 |
0 |
|
800 |
117955807 |
AkshitDh |
A |
May 31, 2021, 5:53 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117955790 |
satvik76 |
A |
May 31, 2021, 5:53 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117954904 |
emnem |
A |
May 31, 2021, 5:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117954065 |
sherlocked |
A |
May 31, 2021, 5:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117950012 |
tushar2805 |
A |
May 31, 2021, 4:38 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117946254 |
nhphucqt |
A |
May 31, 2021, 3:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
28 |
15 |
0 |
|
800 |
117934206 |
jrcodes |
A |
May 30, 2021, 8:15 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
15 |
0 |
|
800 |
117923891 |
rchalamala |
A |
May 30, 2021, 5:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
15 |
0 |
|
800 |
117923658 |
fastmath |
A |
May 30, 2021, 5:47 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
15 |
0 |
|
800 |
117923364 |
AnonySharma |
A |
May 30, 2021, 5:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
15 |
0 |
|
800 |
117956384 |
coder0687 |
A |
May 31, 2021, 6:01 a.m. |
OK |
Java 11 |
TESTS |
28 |
186 |
0 |
|
800 |
117923918 |
algothink |
A |
May 30, 2021, 5:50 p.m. |
OK |
Java 11 |
TESTS |
27 |
186 |
0 |
|
800 |
117938630 |
aryankhatri |
A |
May 30, 2021, 10:33 p.m. |
OK |
Java 11 |
TESTS |
28 |
187 |
0 |
|
800 |
117946806 |
boltUsain |
A |
May 31, 2021, 3:34 a.m. |
OK |
Java 11 |
TESTS |
28 |
187 |
0 |
|
800 |
117929673 |
future_me |
A |
May 30, 2021, 7:01 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117927994 |
tony_heart |
A |
May 30, 2021, 6:36 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117923329 |
flying_rocket |
A |
May 30, 2021, 5:44 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117922462 |
VishuTomar |
A |
May 30, 2021, 5:37 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117914221 |
gourav02 |
A |
May 30, 2021, 4:33 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117910370 |
VT01 |
A |
May 30, 2021, 4:17 p.m. |
OK |
Java 11 |
TESTS |
27 |
187 |
0 |
|
800 |
117953314 |
gssakash |
A |
May 31, 2021, 5:18 a.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
800 |
117943647 |
pmd |
A |
May 31, 2021, 2:15 a.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
800 |
117936190 |
twoBit |
A |
May 30, 2021, 9 p.m. |
OK |
Java 8 |
TESTS |
27 |
109 |
0 |
|
800 |
117931632 |
RonWonWon |
A |
May 30, 2021, 7:29 p.m. |
OK |
Java 8 |
TESTS |
27 |
109 |
0 |
|
800 |
117935341 |
kzhang2012 |
A |
May 30, 2021, 8:39 p.m. |
OK |
Java 8 |
TESTS |
27 |
109 |
0 |
|
800 |
117940007 |
marcose18 |
A |
May 30, 2021, 11:44 p.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
800 |
117931638 |
singhdhanwant |
A |
May 30, 2021, 7:29 p.m. |
OK |
Java 8 |
TESTS |
27 |
124 |
0 |
|
800 |
117931828 |
deepaksach |
A |
May 30, 2021, 7:32 p.m. |
OK |
Java 8 |
TESTS |
27 |
124 |
0 |
|
800 |
117949807 |
Halix |
A |
May 31, 2021, 4:34 a.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
800 |
117932029 |
Adi_7861 |
A |
May 30, 2021, 7:36 p.m. |
OK |
Java 8 |
TESTS |
27 |
124 |
0 |
|
800 |
117921203 |
Tlatoani |
A |
May 30, 2021, 5:29 p.m. |
OK |
Kotlin |
TESTS |
27 |
156 |
102400 |
|
800 |
117909584 |
Bloodwyn |
A |
May 30, 2021, 4:13 p.m. |
OK |
Kotlin |
TESTS |
27 |
202 |
204800 |
|
800 |
117921388 |
og.kostya |
A |
May 30, 2021, 5:30 p.m. |
OK |
Mono C# |
TESTS |
27 |
77 |
3174400 |
|
800 |
117913253 |
rjrstuewfyg |
A |
May 30, 2021, 4:29 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
31 |
0 |
|
800 |
117928775 |
Ilya.Yrasov |
A |
May 30, 2021, 6:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
31 |
0 |
|
800 |
117923953 |
UnHingedFrog |
A |
May 30, 2021, 5:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
31 |
0 |
|
800 |
117941327 |
dingzhao777 |
A |
May 31, 2021, 12:45 a.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
512000 |
|
800 |
117921882 |
codmacian |
A |
May 30, 2021, 5:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
46 |
0 |
|
800 |
117922004 |
codmacian |
A |
May 30, 2021, 5:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
61 |
0 |
|
800 |
117922117 |
codmacian |
A |
May 30, 2021, 5:35 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
171 |
0 |
|
800 |
117920942 |
fairy_lettuce |
A |
May 30, 2021, 5:28 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
93 |
1024000 |
|
800 |
117921310 |
og.kostya |
A |
May 30, 2021, 5:30 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
93 |
3072000 |
|
800 |
117920643 |
Ahad726 |
A |
May 30, 2021, 5:27 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
93 |
3379200 |
|
800 |
117941885 |
sakapon |
A |
May 31, 2021, 1:12 a.m. |
OK |
.NET Core C# |
TESTS |
28 |
108 |
716800 |
|
800 |
117924177 |
Insurkin |
A |
May 30, 2021, 5:52 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
296 |
3993600 |
|
800 |
117916873 |
PAG |
A |
May 30, 2021, 4:43 p.m. |
OK |
PascalABC.NET |
TESTS |
27 |
311 |
409600 |
|
800 |
117933851 |
elistark |
A |
May 30, 2021, 8:08 p.m. |
OK |
PyPy 2 |
TESTS |
27 |
186 |
4812800 |
|
800 |
117954932 |
54M4R |
A |
May 31, 2021, 5:41 a.m. |
OK |
PyPy 2 |
TESTS |
28 |
264 |
2560000 |
|
800 |
117933898 |
elistark |
A |
May 30, 2021, 8:10 p.m. |
OK |
PyPy 2 |
TESTS |
27 |
311 |
7577600 |
|
800 |
117954247 |
__eRRor__ |
A |
May 31, 2021, 5:32 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
139 |
3481600 |
|
800 |
117931970 |
abhishek4981 |
A |
May 30, 2021, 7:34 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
140 |
3379200 |
|
800 |
117921111 |
not_tehlka |
A |
May 30, 2021, 5:29 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
155 |
3993600 |
|
800 |
117942287 |
zwliew |
A |
May 31, 2021, 1:27 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
4096000 |
|
800 |
117936694 |
tanmay104 |
A |
May 30, 2021, 9:13 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
155 |
4198400 |
|
800 |
117942363 |
zwliew |
A |
May 31, 2021, 1:30 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
4710400 |
|
800 |
117937034 |
Munchy_1 |
A |
May 30, 2021, 9:24 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
155 |
199987200 |
|
800 |
117933621 |
Mistaek |
A |
May 30, 2021, 8:04 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
170 |
4403200 |
|
800 |
117954232 |
BigNerd24 |
A |
May 31, 2021, 5:31 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
171 |
4710400 |
|
800 |
117933629 |
elchinelo |
A |
May 30, 2021, 8:04 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
186 |
4710400 |
|
800 |
117920890 |
eugalt |
A |
May 30, 2021, 5:28 p.m. |
OK |
Python 3 |
TESTS |
27 |
62 |
0 |
|
800 |
117944623 |
eugalt |
A |
May 31, 2021, 2:41 a.m. |
OK |
Python 3 |
TESTS |
28 |
62 |
0 |
|
800 |
117915694 |
heisenberg_17 |
A |
May 30, 2021, 4:39 p.m. |
OK |
Python 3 |
TESTS |
27 |
62 |
102400 |
|
800 |
117931176 |
syntaxsugar |
A |
May 30, 2021, 7:22 p.m. |
OK |
Python 3 |
TESTS |
27 |
62 |
102400 |
|
800 |
117947488 |
ujjwalavishek |
A |
May 31, 2021, 3:48 a.m. |
OK |
Python 3 |
TESTS |
28 |
77 |
0 |
|
800 |
117919015 |
happybox00 |
A |
May 30, 2021, 4:49 p.m. |
OK |
Python 3 |
TESTS |
27 |
77 |
0 |
|
800 |
117932543 |
shubham_409 |
A |
May 30, 2021, 7:45 p.m. |
OK |
Python 3 |
TESTS |
27 |
77 |
102400 |
|
800 |
117947763 |
luhoc98 |
A |
May 31, 2021, 3:54 a.m. |
OK |
Python 3 |
TESTS |
28 |
77 |
102400 |
|
800 |
117931256 |
shubham_409 |
A |
May 30, 2021, 7:23 p.m. |
OK |
Python 3 |
TESTS |
27 |
77 |
102400 |
|
800 |
117937507 |
tayyrov |
A |
May 30, 2021, 9:41 p.m. |
OK |
Python 3 |
TESTS |
28 |
77 |
102400 |
|
800 |
117937678 |
Neo_Re_L |
A |
May 30, 2021, 9:47 p.m. |
OK |
Python 3 + libs |
TESTS |
28 |
77 |
0 |
|
800 |
117937010 |
Neo_Re_L |
A |
May 30, 2021, 9:23 p.m. |
OK |
Python 3 + libs |
TESTS |
27 |
78 |
0 |
|
800 |
117932275 |
myduomilia |
A |
May 30, 2021, 7:40 p.m. |
OK |
Rust |
TESTS |
27 |
78 |
102400 |
|
800 |
117932347 |
myduomilia |
A |
May 30, 2021, 7:41 p.m. |
OK |
Rust |
TESTS |
27 |
93 |
204800 |
|
800 |
remove filters
Back to search problems