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'Luca has a cypher made up of a sequence of n wheels, each with a digit a_i written on it. On the i -th wheel, he made b_i moves. Each move is one of two types: Luca knows the final sequence of wheels and the moves for each wheel. Help him find the original sequence and crack the cypher. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 100 ) -- the number of wheels. The second line contains n integers a_i ( 0 <= q a_i <= q 9 ) -- the digit shown on the i -th wheel after all moves have been performed. Then n lines follow, the i -th of which contains the integer b_i ( 1 <= q b_i <= q 10 ) and b_i characters that are either texttt{U} or texttt{D} -- the number of moves performed on the i -th wheel, and the moves performed. texttt{U} and texttt{D} represent an up move and a down move respectively. For each test case, output n space-separated digits -- the initial sequence of the cypher. In the first test case, we can prove that initial sequence was [2,1,1] . In that case, the following moves were performed: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
163961172 |
bluemegane |
C |
July 12, 2022, 10:18 p.m. |
OK |
C# 8 |
TESTS |
4 |
77 |
2150400 |
|
|
163946704 |
janv |
C |
July 12, 2022, 6:28 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
4 |
124 |
0 |
|
|
163984659 |
Mohit-sankhla02 |
C |
July 13, 2022, 5:27 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
4 |
124 |
7372800 |
|
|
163939085 |
Belyashmat |
C |
July 12, 2022, 5:29 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
4 |
139 |
5222400 |
|
|
163947057 |
charan68 |
C |
July 12, 2022, 6:31 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
4 |
140 |
3174400 |
|
|
163958511 |
Ajoad_Islam_Nishat |
C |
July 12, 2022, 9:13 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
0 |
|
|
163938480 |
sreya_883 |
C |
July 12, 2022, 5:25 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
0 |
|
|
163940276 |
sushmapunna1 |
C |
July 12, 2022, 5:37 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
0 |
|
|
163954914 |
ashitamv |
C |
July 12, 2022, 8:01 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
0 |
|
|
163935078 |
IMartisI |
C |
July 12, 2022, 5:07 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
204800 |
|
|
163975842 |
hnust_hejianlin |
C |
July 13, 2022, 3:22 a.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
163963758 |
bobbytan |
C |
July 12, 2022, 11:41 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
163947166 |
Uptownfun |
C |
July 12, 2022, 6:32 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
163943108 |
ketansarode_17 |
C |
July 12, 2022, 5:58 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
163986087 |
AaronLin |
C |
July 13, 2022, 5:43 a.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
163956525 |
maiky |
C |
July 12, 2022, 8:31 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
102400 |
|
|
163985819 |
adilvinayak19 |
C |
July 13, 2022, 5:40 a.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
102400 |
|
|
163936862 |
himdyuti |
C |
July 12, 2022, 5:15 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
8601600 |
|
|
163987041 |
AtharvaDing |
C |
July 13, 2022, 5:53 a.m. |
OK |
GNU C++14 |
TESTS |
4 |
15 |
0 |
|
|
163986850 |
Perseus. |
C |
July 13, 2022, 5:52 a.m. |
OK |
GNU C++14 |
TESTS |
4 |
15 |
0 |
|
|
163967503 |
nothing36 |
C |
July 13, 2022, 1:14 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163965377 |
SugarT |
C |
July 13, 2022, 12:29 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163981027 |
im_anik |
C |
July 13, 2022, 4:41 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163954877 |
hagersobhy123 |
C |
July 12, 2022, 8 p.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163953147 |
senzoe |
C |
July 12, 2022, 7:38 p.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163962107 |
Nouran_Mohsen55 |
C |
July 12, 2022, 10:46 p.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163979517 |
Shoriful_Islam |
C |
July 13, 2022, 4:18 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163977270 |
bgg0516 |
C |
July 13, 2022, 3:44 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163973482 |
bai_yueguang |
C |
July 13, 2022, 2:48 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163968195 |
GrandCaster |
C |
July 13, 2022, 1:26 a.m. |
OK |
GNU C++17 |
TESTS |
4 |
0 |
0 |
|
|
163958630 |
rakib2624 |
C |
July 12, 2022, 9:16 p.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163983312 |
Restarted_lghhh |
C |
July 13, 2022, 5:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163972228 |
LeeJiaHua |
C |
July 13, 2022, 2:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163969974 |
enslaved |
C |
July 13, 2022, 1:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163967676 |
qsmy |
C |
July 13, 2022, 1:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163965028 |
MoNasr |
C |
July 13, 2022, 12:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163961422 |
alwyn |
C |
July 12, 2022, 10:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163958825 |
tamuwarhead |
C |
July 12, 2022, 9:20 p.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163956251 |
maxcruickshanks |
C |
July 12, 2022, 8:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163955635 |
jesse_pinkman_619 |
C |
July 12, 2022, 8:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
4 |
0 |
0 |
|
|
163979431 |
buddhimevriddhi |
C |
July 13, 2022, 4:17 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163977940 |
207r1a05p2 |
C |
July 13, 2022, 3:54 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163977112 |
kyomukyomupurin |
C |
July 13, 2022, 3:41 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163976935 |
Hoshikira |
C |
July 13, 2022, 3:39 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163976114 |
moikfer |
C |
July 13, 2022, 3:27 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163979483 |
ssshanto |
C |
July 13, 2022, 4:17 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163979610 |
sourav.gupta0401 |
C |
July 13, 2022, 4:19 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163982030 |
amr449273 |
C |
July 13, 2022, 4:55 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163983782 |
StonedSloth |
C |
July 13, 2022, 5:16 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163986485 |
anas_ahmad_khan |
C |
July 13, 2022, 5:48 a.m. |
OK |
GNU C++20 (64) |
TESTS |
4 |
0 |
0 |
|
|
163972116 |
rajneesh.osho |
C |
July 13, 2022, 2:28 a.m. |
OK |
Java 11 |
TESTS |
4 |
155 |
0 |
|
|
163981128 |
Ahmad_Bedair |
C |
July 13, 2022, 4:43 a.m. |
OK |
Java 11 |
TESTS |
4 |
171 |
0 |
|
|
163973601 |
kamannb |
C |
July 13, 2022, 2:50 a.m. |
OK |
Java 11 |
TESTS |
4 |
171 |
0 |
|
|
163970308 |
aditya2024 |
C |
July 13, 2022, 2 a.m. |
OK |
Java 11 |
TESTS |
4 |
202 |
0 |
|
|
163985642 |
eshan18.09 |
C |
July 13, 2022, 5:38 a.m. |
OK |
Java 11 |
TESTS |
4 |
202 |
0 |
|
|
163960910 |
pranp_24 |
C |
July 12, 2022, 10:12 p.m. |
OK |
Java 11 |
TESTS |
4 |
217 |
0 |
|
|
163958658 |
Amir_Coderest |
C |
July 12, 2022, 9:17 p.m. |
OK |
Java 11 |
TESTS |
4 |
217 |
0 |
|
|
163939978 |
gurkaran_s |
C |
July 12, 2022, 5:34 p.m. |
OK |
Java 11 |
TESTS |
4 |
217 |
0 |
|
|
163961542 |
wickedpro |
C |
July 12, 2022, 10:28 p.m. |
OK |
Java 11 |
TESTS |
4 |
234 |
0 |
|
|
163985760 |
Suraj1607 |
C |
July 13, 2022, 5:40 a.m. |
OK |
Java 11 |
TESTS |
4 |
264 |
0 |
|
|
163967543 |
Loomak |
C |
July 13, 2022, 1:15 a.m. |
OK |
Java 8 |
TESTS |
4 |
92 |
0 |
|
|
163956730 |
Ancient_One |
C |
July 12, 2022, 8:35 p.m. |
OK |
Java 8 |
TESTS |
4 |
93 |
0 |
|
|
163942848 |
BhargavModha |
C |
July 12, 2022, 5:56 p.m. |
OK |
Java 8 |
TESTS |
4 |
93 |
0 |
|
|
163942928 |
MovingBit |
C |
July 12, 2022, 5:57 p.m. |
OK |
Java 8 |
TESTS |
4 |
108 |
0 |
|
|
163937049 |
AhmedAlArousi |
C |
July 12, 2022, 5:16 p.m. |
OK |
Java 8 |
TESTS |
4 |
109 |
0 |
|
|
163952107 |
rish1896 |
C |
July 12, 2022, 7:25 p.m. |
OK |
Java 8 |
TESTS |
4 |
124 |
0 |
|
|
163945363 |
Rafs |
C |
July 12, 2022, 6:17 p.m. |
OK |
Java 8 |
TESTS |
4 |
155 |
0 |
|
|
163977243 |
eteshb |
C |
July 13, 2022, 3:43 a.m. |
OK |
Java 8 |
TESTS |
4 |
171 |
0 |
|
|
163951987 |
Aditya1786 |
C |
July 12, 2022, 7:23 p.m. |
OK |
Java 8 |
TESTS |
4 |
171 |
0 |
|
|
163945938 |
cpcdevar |
C |
July 12, 2022, 6:22 p.m. |
OK |
Java 8 |
TESTS |
4 |
171 |
0 |
|
|
163973058 |
qihnus |
C |
July 13, 2022, 2:42 a.m. |
OK |
Kotlin 1.6 |
TESTS |
4 |
187 |
0 |
|
|
163965436 |
bhaa |
C |
July 13, 2022, 12:30 a.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
31 |
0 |
|
|
163964547 |
JustOnlyOne |
C |
July 13, 2022, 12:06 a.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
46 |
0 |
|
|
163960613 |
abdoshaisha |
C |
July 12, 2022, 10:03 p.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
46 |
0 |
|
|
163958751 |
HappyFall |
C |
July 12, 2022, 9:19 p.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
46 |
0 |
|
|
163957287 |
lomonmoh |
C |
July 12, 2022, 8:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
46 |
0 |
|
|
163962179 |
sky_. |
C |
July 12, 2022, 10:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
4 |
62 |
0 |
|
|
163936653 |
grawlixes |
C |
July 12, 2022, 5:14 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
108 |
3174400 |
|
|
163941666 |
hritik3878 |
C |
July 12, 2022, 5:47 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
124 |
2764800 |
|
|
163956768 |
YashNandwana |
C |
July 12, 2022, 8:36 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
124 |
5222400 |
|
|
163986247 |
sagamantus |
C |
July 13, 2022, 5:45 a.m. |
OK |
PyPy 3 |
TESTS |
4 |
171 |
4198400 |
|
|
163987445 |
Multibala |
C |
July 13, 2022, 5:57 a.m. |
OK |
PyPy 3 |
TESTS |
4 |
171 |
8089600 |
|
|
163956014 |
thebongy |
C |
July 12, 2022, 8:21 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
186 |
3891200 |
|
|
163947821 |
sky9313 |
C |
July 12, 2022, 6:39 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
186 |
4505600 |
|
|
163943111 |
Ilya_Is2022 |
C |
July 12, 2022, 5:58 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
186 |
4710400 |
|
|
163943693 |
dawitys010 |
C |
July 12, 2022, 6:03 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
187 |
3891200 |
|
|
163972203 |
Abdullah_Qayyum |
C |
July 13, 2022, 2:29 a.m. |
OK |
PyPy 3 |
TESTS |
4 |
202 |
4300800 |
|
|
163951357 |
cxomel |
C |
July 12, 2022, 7:16 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
5222400 |
|
|
163984229 |
only_noob |
C |
July 13, 2022, 5:21 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
5427200 |
|
|
163976316 |
mrng |
C |
July 13, 2022, 3:29 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
5529600 |
|
|
163978370 |
chan_uuu |
C |
July 13, 2022, 4:01 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
6656000 |
|
|
163987547 |
GN6 |
C |
July 13, 2022, 5:58 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
5120000 |
|
|
163960840 |
pirate0 |
C |
July 12, 2022, 10:09 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
5836800 |
|
|
163986950 |
GN6 |
C |
July 13, 2022, 5:52 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
7577600 |
|
|
163950203 |
fan_of_tourist |
C |
July 12, 2022, 7:03 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
108 |
6963200 |
|
|
163984966 |
DaRk_hEaRt_ |
C |
July 13, 2022, 5:31 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
108 |
214835200 |
|
|
163976207 |
sp_Piyush |
C |
July 13, 2022, 3:28 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
109 |
5632000 |
|
|
163965059 |
likeadodo |
C |
July 13, 2022, 12:21 a.m. |
OK |
Python 3 |
TESTS |
4 |
46 |
0 |
|
|
163940813 |
Sai7 |
C |
July 12, 2022, 5:41 p.m. |
OK |
Python 3 |
TESTS |
4 |
46 |
0 |
|
|
163971448 |
WJ.L |
C |
July 13, 2022, 2:18 a.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
163969323 |
Shah.Zaib |
C |
July 13, 2022, 1:44 a.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
163949648 |
valak_5701 |
C |
July 12, 2022, 6:57 p.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
163935970 |
Mofh |
C |
July 12, 2022, 5:11 p.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
163977242 |
jamalou |
C |
July 13, 2022, 3:43 a.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
163972298 |
Mueez_Aizdi |
C |
July 13, 2022, 2:30 a.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
163969699 |
williamcz |
C |
July 13, 2022, 1:50 a.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
163961207 |
soham0209 |
C |
July 12, 2022, 10:19 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
163935665 |
dvalerio12343 |
C |
July 12, 2022, 5:10 p.m. |
OK |
Rust 2021 |
TESTS |
4 |
15 |
0 |
|
|
remove filters
Back to search problems