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 |
1951
|
Codeforces Global Round 25 |
FINISHED |
False |
10800 |
24765863 |
April 6, 2024, 2:35 p.m. |
Problems
B'There are n lamps numbered 1 to n lined up in a row, initially turned off. You can perform the following operation any number of times (possibly zero): Determine whether you can reach configuration s , where s_i = 1 means the i -th lamp is turned on, and s_i = 0 otherwise. {}^ dagger Only lamp i and i + 1 are adjacent for all 1 <= i < n . Note that lamp n and 1 are not adjacent when n ne 2 . Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains an integer n ( 1 <= n <= 50 ) -- the number of lamps. The second line of each test case contains a binary string s of size n -- the final desired configuration. For each test case, print on one line "YES" if we can reach the configuration s via applying the given operation any number of times. Otherwise, print "NO". In the first test case, the sequence of operation could have been as follows (note that initially s is all zero): mathtt{0000000000} to mathtt{ color{red}{1}0000000 color{red}{1}0} to mathtt{1 color{red}{1}00000 color{red}{1}10} to mathtt{110 color{red}{1}0 color{red}{1}0110} . In the third test case, we don 't have to do any operation. In the fourth test case, we cannot do any operation, but we need the first lamp to be on. Therefore, it is impossible to achieve the desired state. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
255402065 |
karamkontar |
A |
April 7, 2024, 1:54 a.m. |
OK |
C# 10 |
TESTS |
3 |
93 |
512000 |
|
|
255402258 |
karamkontar |
A |
April 7, 2024, 1:58 a.m. |
OK |
C# 10 |
TESTS |
3 |
109 |
512000 |
|
|
255401503 |
yuel33829 |
A |
April 7, 2024, 1:45 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
30 |
0 |
|
|
255397555 |
Bree_Cui |
A |
April 7, 2024, 12:31 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
30 |
0 |
|
|
255394691 |
Last_Bencher0_0 |
A |
April 6, 2024, 11:38 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
30 |
0 |
|
|
255396853 |
amine_meddeb |
A |
April 7, 2024, 12:18 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
31 |
0 |
|
|
255413320 |
allfi_imnida |
A |
April 7, 2024, 4:42 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255418935 |
Phenomenal_Sid |
A |
April 7, 2024, 5:40 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255415555 |
shah_entrance |
A |
April 7, 2024, 5:07 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255414079 |
SitaRam_01 |
A |
April 7, 2024, 4:51 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255413647 |
Nikunj_Sheer52 |
A |
April 7, 2024, 4:46 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255413154 |
_Shashanksingh |
A |
April 7, 2024, 4:40 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
3 |
46 |
0 |
|
|
255417876 |
dilLegyikudi |
A |
April 7, 2024, 5:31 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
15 |
0 |
|
|
255396259 |
FFFishmaker |
A |
April 7, 2024, 12:07 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
15 |
0 |
|
|
255415263 |
Maharaj7_ |
A |
April 7, 2024, 5:04 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255417148 |
sudhirMTS |
A |
April 7, 2024, 5:24 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255413598 |
cleave |
A |
April 7, 2024, 4:46 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255412178 |
sachin_3059 |
A |
April 7, 2024, 4:28 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255411544 |
aniketkuma-r |
A |
April 7, 2024, 4:21 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255410774 |
Drink_Medicine |
A |
April 7, 2024, 4:10 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255410377 |
Rahul_Appu |
A |
April 7, 2024, 4:05 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255410137 |
pycharm15 |
A |
April 7, 2024, 4:02 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
3 |
30 |
0 |
|
|
255420143 |
_code_wizard_ |
A |
April 7, 2024, 5:51 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255366269 |
Filikec |
A |
April 6, 2024, 6:33 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255365598 |
ChasedByShadows |
A |
April 6, 2024, 6:29 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255365369 |
LOKI_29 |
A |
April 6, 2024, 6:28 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255417500 |
D12EQD |
A |
April 7, 2024, 5:27 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255410783 |
hanmx |
A |
April 7, 2024, 4:10 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255406158 |
ngphucthinh |
A |
April 7, 2024, 3:02 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255374748 |
keyur18 |
A |
April 6, 2024, 7:40 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255373885 |
Nastya_An |
A |
April 6, 2024, 7:32 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255372745 |
AkSingh021 |
A |
April 6, 2024, 7:24 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
3 |
30 |
0 |
|
|
255392119 |
bluemegane |
A |
April 6, 2024, 10:53 p.m. |
OK |
C# 8 |
TESTS |
3 |
108 |
409600 |
|
|
255415485 |
Istiyak1264 |
A |
April 7, 2024, 5:07 a.m. |
OK |
GNU C11 |
TESTS |
3 |
31 |
0 |
|
|
255392985 |
mahrezkhan |
A |
April 6, 2024, 11:08 p.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
|
255411951 |
CS23B036 |
A |
April 7, 2024, 4:25 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
102400 |
|
|
255418587 |
Lauhensan |
A |
April 7, 2024, 5:37 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
102400 |
|
|
255391784 |
Maisha106 |
A |
April 6, 2024, 10:48 p.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
|
255411933 |
nguyenquocthao00 |
A |
April 7, 2024, 4:25 a.m. |
OK |
Go |
TESTS |
3 |
46 |
512000 |
|
|
255399335 |
xin2002 |
A |
April 7, 2024, 1:06 a.m. |
OK |
Java 21 |
TESTS |
3 |
187 |
614400 |
|
|
255381536 |
Festyve |
A |
April 6, 2024, 8:41 p.m. |
OK |
Java 21 |
TESTS |
3 |
202 |
512000 |
|
|
255374009 |
sharmanitin5114 |
A |
April 6, 2024, 7:33 p.m. |
OK |
Java 21 |
TESTS |
3 |
202 |
921600 |
|
|
255418938 |
amit_roy |
A |
April 7, 2024, 5:40 a.m. |
OK |
Java 21 |
TESTS |
3 |
202 |
1843200 |
|
|
255407305 |
wizwilzo |
A |
April 7, 2024, 3:22 a.m. |
OK |
Java 21 |
TESTS |
3 |
203 |
409600 |
|
|
255415517 |
Fizi |
A |
April 7, 2024, 5:07 a.m. |
OK |
Java 21 |
TESTS |
3 |
217 |
512000 |
|
|
255375071 |
ramitg254 |
A |
April 6, 2024, 7:42 p.m. |
OK |
Java 21 |
TESTS |
3 |
218 |
512000 |
|
|
255365842 |
sagargupta36 |
A |
April 6, 2024, 6:30 p.m. |
OK |
Java 21 |
TESTS |
3 |
233 |
307200 |
|
|
255398694 |
Enderbrine16 |
A |
April 7, 2024, 12:53 a.m. |
OK |
Java 21 |
TESTS |
3 |
234 |
0 |
|
|
255402895 |
V0ice |
A |
April 7, 2024, 2:09 a.m. |
OK |
Java 21 |
TESTS |
3 |
234 |
512000 |
|
|
255420365 |
danuj828 |
A |
April 7, 2024, 5:53 a.m. |
OK |
Java 8 |
TESTS |
3 |
155 |
0 |
|
|
255401147 |
adibhai0845R |
A |
April 7, 2024, 1:38 a.m. |
OK |
Java 8 |
TESTS |
3 |
156 |
0 |
|
|
255388419 |
Meghnath_IJ |
A |
April 6, 2024, 9:59 p.m. |
OK |
Java 8 |
TESTS |
3 |
156 |
6553600 |
|
|
255418318 |
Baidiki |
A |
April 7, 2024, 5:35 a.m. |
OK |
Java 8 |
TESTS |
3 |
171 |
0 |
|
|
255405002 |
Rondo9 |
A |
April 7, 2024, 2:44 a.m. |
OK |
Java 8 |
TESTS |
3 |
171 |
0 |
|
|
255392646 |
ShadowBeast_13 |
A |
April 6, 2024, 11:02 p.m. |
OK |
Java 8 |
TESTS |
3 |
171 |
0 |
|
|
255372272 |
iamcodebug |
A |
April 6, 2024, 7:19 p.m. |
OK |
Java 8 |
TESTS |
3 |
171 |
0 |
|
|
255416150 |
Shreyaansh_yadav |
A |
April 7, 2024, 5:14 a.m. |
OK |
Java 8 |
TESTS |
3 |
186 |
0 |
|
|
255355235 |
Xi_Wang_LC |
A |
April 6, 2024, 5:23 p.m. |
OK |
Java 8 |
TESTS |
3 |
186 |
0 |
|
|
255370767 |
desaizeeshan22 |
A |
April 6, 2024, 7:07 p.m. |
OK |
Java 8 |
TESTS |
3 |
187 |
0 |
|
|
255375845 |
gurupad |
A |
April 6, 2024, 7:49 p.m. |
OK |
Kotlin 1.9 |
TESTS |
3 |
124 |
0 |
|
|
255402999 |
bboo_123 |
A |
April 7, 2024, 2:11 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
124 |
4915200 |
|
|
255417591 |
abhay_30281125 |
A |
April 7, 2024, 5:28 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
202 |
4096000 |
|
|
255413605 |
Hossam_Hassan_Taher |
A |
April 7, 2024, 4:46 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
78 |
3276800 |
|
|
255399846 |
voicon |
A |
April 7, 2024, 1:14 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
92 |
1843200 |
|
|
255413023 |
riroan |
A |
April 7, 2024, 4:39 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
92 |
2150400 |
|
|
255407853 |
Mohamed_Hamed |
A |
April 7, 2024, 3:30 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
92 |
2252800 |
|
|
255393784 |
tanmay1610 |
A |
April 6, 2024, 11:22 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
93 |
2048000 |
|
|
255367117 |
sanctus |
A |
April 6, 2024, 6:39 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
93 |
3993600 |
|
|
255405948 |
mikeac |
A |
April 7, 2024, 2:58 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
108 |
2560000 |
|
|
255411985 |
yuki_keshiki |
A |
April 7, 2024, 4:26 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
109 |
2048000 |
|
|
255410881 |
dsanurag520 |
A |
April 7, 2024, 4:12 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
109 |
3072000 |
|
|
255422473 |
Deecey01 |
A |
April 7, 2024, 5:59 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
109 |
4915200 |
|
|
255365880 |
OLOGY |
A |
April 6, 2024, 6:31 p.m. |
OK |
Python 2 |
TESTS |
3 |
62 |
0 |
|
|
255381759 |
A.Orazberdiyev |
A |
April 6, 2024, 8:43 p.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
255357399 |
Sanjay_1331 |
A |
April 6, 2024, 5:28 p.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
255394081 |
BuRabea3 |
A |
April 6, 2024, 11:27 p.m. |
OK |
Python 3 |
TESTS |
3 |
61 |
0 |
|
|
255383503 |
eugalt |
A |
April 6, 2024, 9 p.m. |
OK |
Python 3 |
TESTS |
3 |
61 |
0 |
|
|
255369465 |
Ante_ |
A |
April 6, 2024, 6:56 p.m. |
OK |
Python 3 |
TESTS |
3 |
61 |
0 |
|
|
255367406 |
Asymptote_hk27 |
A |
April 6, 2024, 6:41 p.m. |
OK |
Python 3 |
TESTS |
3 |
61 |
0 |
|
|
255405635 |
xingliu |
A |
April 7, 2024, 2:53 a.m. |
OK |
Python 3 |
TESTS |
3 |
62 |
0 |
|
|
255382745 |
MTA9402 |
A |
April 6, 2024, 8:53 p.m. |
OK |
Python 3 |
TESTS |
3 |
62 |
0 |
|
|
255378812 |
G_M_Rakib |
A |
April 6, 2024, 8:16 p.m. |
OK |
Python 3 |
TESTS |
3 |
62 |
0 |
|
|
255376455 |
the_eggbeater |
A |
April 6, 2024, 7:55 p.m. |
OK |
Python 3 |
TESTS |
3 |
62 |
0 |
|
|
255370408 |
0x81 |
A |
April 6, 2024, 7:04 p.m. |
OK |
Ruby 3 |
TESTS |
3 |
343 |
1331200 |
|
|
remove filters
Back to search problems