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'There are two towers consisting of blocks of two colors: red and blue. Both towers are represented by strings of characters B and/or R denoting the order of blocks in them from the bottom to the top, where B corresponds to a blue block, and R corresponds to a red block. You can perform the following operation any number of times: choose a tower with at least two blocks, and move its top block to the top of the other tower. The pair of towers is beautiful if no pair of touching blocks has the same color; i. xe2 x80 x89e. no red block stands on top of another red block, and no blue block stands on top of another blue block. You have to check if it is possible to perform any number of operations (possibly zero) to make the pair of towers beautiful. The first line contains one integer t ( 1 <= t <= 1000 ) -- the number of test cases. Each test case consists of three lines: For each test case, print YES if it is possible to perform several (possibly zero) operations in such a way that the pair of towers becomes beautiful; otherwise print NO. You may print each letter in any case (YES, yes, Yes will all be recognized as positive answer, NO, no and nO will all be recognized as negative answer). In the first test case, you can move the top block from the first tower to the second tower (see the third picture). In the second test case, you can move the top block from the second tower to the first tower 6 times. In the third test case, the pair of towers is already beautiful. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
193899099 |
Antroz |
A |
Feb. 16, 2023, 4:19 p.m. |
OK |
C# 10 |
TESTS |
3 |
31 |
716800 |
|
|
193905730 |
SerhioUA |
A |
Feb. 16, 2023, 4:34 p.m. |
OK |
C# 8 |
TESTS |
3 |
124 |
819200 |
|
|
193908261 |
mdshadesh |
A |
Feb. 16, 2023, 4:47 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
3 |
46 |
0 |
|
|
193935770 |
mohamed.ramadan__ |
A |
Feb. 16, 2023, 9:57 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
3 |
46 |
0 |
|
|
193939095 |
SakurakoujiRuna |
A |
Feb. 16, 2023, 11:16 p.m. |
OK |
D |
TESTS |
3 |
30 |
204800 |
|
|
193903910 |
Small_Lime |
A |
Feb. 16, 2023, 4:31 p.m. |
OK |
GNU C11 |
TESTS |
3 |
0 |
0 |
|
|
193926170 |
itzvoko |
A |
Feb. 16, 2023, 7:34 p.m. |
OK |
GNU C11 |
TESTS |
3 |
0 |
204800 |
|
|
193904401 |
Quintessential |
A |
Feb. 16, 2023, 4:32 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193954780 |
Max_Uchiha |
A |
Feb. 17, 2023, 5:29 a.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193912798 |
JyotiradityaChillal |
A |
Feb. 16, 2023, 5:16 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193914912 |
rf_104 |
A |
Feb. 16, 2023, 5:33 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193926344 |
itzvoko |
A |
Feb. 16, 2023, 7:37 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193926602 |
itzvoko |
A |
Feb. 16, 2023, 7:40 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193939998 |
610tulika |
A |
Feb. 16, 2023, 11:40 p.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193950338 |
rushil21_ |
A |
Feb. 17, 2023, 4:13 a.m. |
OK |
GNU C11 |
TESTS |
3 |
15 |
0 |
|
|
193948706 |
six-floor-slip-liu |
A |
Feb. 17, 2023, 3:40 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193956716 |
Guichena |
A |
Feb. 17, 2023, 5:59 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193956276 |
kassem.fahed |
A |
Feb. 17, 2023, 5:53 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193955329 |
anagha_134 |
A |
Feb. 17, 2023, 5:37 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193955289 |
fhxjzlr |
A |
Feb. 17, 2023, 5:37 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193954426 |
I_Believe_In_Aliens |
A |
Feb. 17, 2023, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193952913 |
kota_9620 |
A |
Feb. 17, 2023, 5 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193952317 |
kingdomsouth |
A |
Feb. 17, 2023, 4:50 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193951722 |
panubhav0112 |
A |
Feb. 17, 2023, 4:40 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193948892 |
spyzvarun |
A |
Feb. 17, 2023, 3:44 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
0 |
0 |
|
|
193953244 |
ratingmatters |
A |
Feb. 17, 2023, 5:05 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193953659 |
Md_Mahim_Babu |
A |
Feb. 17, 2023, 5:12 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193953867 |
jaineshmachhi |
A |
Feb. 17, 2023, 5:15 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193954531 |
shadmanyaser890 |
A |
Feb. 17, 2023, 5:25 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193954652 |
niloymahmud |
A |
Feb. 17, 2023, 5:27 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193955037 |
Dev-i_varaprasad |
A |
Feb. 17, 2023, 5:33 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193956008 |
TwelveThread |
A |
Feb. 17, 2023, 5:48 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193956412 |
Symon434 |
A |
Feb. 17, 2023, 5:54 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193956585 |
novaa |
A |
Feb. 17, 2023, 5:57 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193956608 |
arnavai |
A |
Feb. 17, 2023, 5:57 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
0 |
0 |
|
|
193947949 |
ducati |
A |
Feb. 17, 2023, 3:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193945986 |
fojlerabbi2829 |
A |
Feb. 17, 2023, 2:32 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193945725 |
PCC |
A |
Feb. 17, 2023, 2:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193945418 |
Amigomust |
A |
Feb. 17, 2023, 2:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193944336 |
gluchie |
A |
Feb. 17, 2023, 1:47 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193943381 |
aprameyap |
A |
Feb. 17, 2023, 1:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193934582 |
enslaved |
A |
Feb. 16, 2023, 9:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193952570 |
AmirAli-Asgari |
A |
Feb. 17, 2023, 4:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193933782 |
Abdelrahmanmagdi |
A |
Feb. 16, 2023, 9:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193933638 |
Amer_Oniza10 |
A |
Feb. 16, 2023, 9:19 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
193955014 |
229zzz |
A |
Feb. 17, 2023, 5:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193956735 |
Allwinn3r |
A |
Feb. 17, 2023, 5:59 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193956605 |
swz |
A |
Feb. 17, 2023, 5:57 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193956438 |
Night_Fury_2411 |
A |
Feb. 17, 2023, 5:55 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193956420 |
HashingMan |
A |
Feb. 17, 2023, 5:55 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193956243 |
sankalp_gupta |
A |
Feb. 17, 2023, 5:52 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193955361 |
smartwinner |
A |
Feb. 17, 2023, 5:38 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193955288 |
Sevendeis |
A |
Feb. 17, 2023, 5:37 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193954902 |
TSN121 |
A |
Feb. 17, 2023, 5:31 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193954837 |
Govind._.20 |
A |
Feb. 17, 2023, 5:30 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
0 |
0 |
|
|
193934642 |
ritvik369 |
A |
Feb. 16, 2023, 9:36 p.m. |
OK |
Java 11 |
TESTS |
3 |
171 |
0 |
|
|
193950707 |
ok.surazz |
A |
Feb. 17, 2023, 4:20 a.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
|
193909903 |
tanish_1131 |
A |
Feb. 16, 2023, 4:56 p.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
|
193897519 |
HMETAO |
A |
Feb. 16, 2023, 4:15 p.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
|
193909268 |
Extradict |
A |
Feb. 16, 2023, 4:53 p.m. |
OK |
Java 11 |
TESTS |
3 |
187 |
0 |
|
|
193900619 |
_sumitchavanM |
A |
Feb. 16, 2023, 4:23 p.m. |
OK |
Java 11 |
TESTS |
3 |
202 |
0 |
|
|
193956456 |
__Serendipity |
A |
Feb. 17, 2023, 5:55 a.m. |
OK |
Java 11 |
TESTS |
3 |
202 |
0 |
|
|
193926843 |
Hinnawi24 |
A |
Feb. 16, 2023, 7:43 p.m. |
OK |
Java 11 |
TESTS |
3 |
202 |
0 |
|
|
193912208 |
krushna2611 |
A |
Feb. 16, 2023, 5:11 p.m. |
OK |
Java 11 |
TESTS |
3 |
202 |
0 |
|
|
193956116 |
ashutoshchahar1250 |
A |
Feb. 17, 2023, 5:50 a.m. |
OK |
Java 11 |
TESTS |
3 |
217 |
0 |
|
|
193941367 |
rmakash999 |
A |
Feb. 17, 2023, 12:22 a.m. |
OK |
Java 17 |
TESTS |
3 |
156 |
716800 |
|
|
193920232 |
Hiranmoy |
A |
Feb. 16, 2023, 6:25 p.m. |
OK |
Java 17 |
TESTS |
3 |
186 |
0 |
|
|
193948012 |
Mamimi |
A |
Feb. 17, 2023, 3:22 a.m. |
OK |
Java 17 |
TESTS |
3 |
186 |
307200 |
|
|
193954756 |
nishant7372 |
A |
Feb. 17, 2023, 5:29 a.m. |
OK |
Java 17 |
TESTS |
3 |
186 |
409600 |
|
|
193918757 |
joeeeeeeeeee |
A |
Feb. 16, 2023, 6:10 p.m. |
OK |
Java 17 |
TESTS |
3 |
187 |
409600 |
|
|
193910315 |
vikash_45 |
A |
Feb. 16, 2023, 4:59 p.m. |
OK |
Java 17 |
TESTS |
3 |
187 |
614400 |
|
|
193906102 |
be20cs035ayas |
A |
Feb. 16, 2023, 4:37 p.m. |
OK |
Java 17 |
TESTS |
3 |
202 |
0 |
|
|
193896338 |
nnaf |
A |
Feb. 16, 2023, 4:12 p.m. |
OK |
Java 17 |
TESTS |
3 |
202 |
0 |
|
|
193954865 |
jashwanth_2003 |
A |
Feb. 17, 2023, 5:30 a.m. |
OK |
Java 17 |
TESTS |
3 |
202 |
307200 |
|
|
193953425 |
vishalsonkusale50 |
A |
Feb. 17, 2023, 5:08 a.m. |
OK |
Java 17 |
TESTS |
3 |
202 |
307200 |
|
|
193898740 |
999ms_Clutch |
A |
Feb. 16, 2023, 4:18 p.m. |
OK |
Java 8 |
TESTS |
3 |
77 |
0 |
|
|
193926495 |
rish1896 |
A |
Feb. 16, 2023, 7:39 p.m. |
OK |
Java 8 |
TESTS |
3 |
92 |
0 |
|
|
193918011 |
Koka |
A |
Feb. 16, 2023, 6:02 p.m. |
OK |
Java 8 |
TESTS |
3 |
93 |
0 |
|
|
193922032 |
ujjwal_a0001 |
A |
Feb. 16, 2023, 6:46 p.m. |
OK |
Java 8 |
TESTS |
3 |
93 |
0 |
|
|
193919023 |
lpychemistry |
A |
Feb. 16, 2023, 6:12 p.m. |
OK |
Java 8 |
TESTS |
3 |
93 |
0 |
|
|
193913598 |
theconqueror707 |
A |
Feb. 16, 2023, 5:22 p.m. |
OK |
Java 8 |
TESTS |
3 |
93 |
0 |
|
|
193953245 |
lakshay.sharma.ug21 |
A |
Feb. 17, 2023, 5:05 a.m. |
OK |
Java 8 |
TESTS |
3 |
109 |
0 |
|
|
193952582 |
Mildog |
A |
Feb. 17, 2023, 4:55 a.m. |
OK |
Java 8 |
TESTS |
3 |
109 |
0 |
|
|
193955317 |
tejasS-27 |
A |
Feb. 17, 2023, 5:37 a.m. |
OK |
Java 8 |
TESTS |
3 |
124 |
0 |
|
|
193908487 |
toddliu26 |
A |
Feb. 16, 2023, 4:48 p.m. |
OK |
Java 8 |
TESTS |
3 |
124 |
0 |
|
|
193911359 |
Krantzy |
A |
Feb. 16, 2023, 5:05 p.m. |
OK |
Kotlin 1.7 |
TESTS |
3 |
311 |
1126400 |
|
|
193939005 |
TEUM |
A |
Feb. 16, 2023, 11:14 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
0 |
25088000 |
|
|
193898486 |
highDopamine |
A |
Feb. 16, 2023, 4:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
15 |
0 |
|
|
193947306 |
Ir0nic_Joker |
A |
Feb. 17, 2023, 3:04 a.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
15 |
0 |
|
|
193912475 |
Mapyax |
A |
Feb. 16, 2023, 5:13 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
15 |
0 |
|
|
193901482 |
Frozen-wjl |
A |
Feb. 16, 2023, 4:25 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
15 |
0 |
|
|
193897155 |
whiteReboot |
A |
Feb. 16, 2023, 4:14 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
15 |
0 |
|
|
193896309 |
Khush_08 |
A |
Feb. 16, 2023, 4:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
30 |
0 |
|
|
193901468 |
153floppa |
A |
Feb. 16, 2023, 4:25 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
31 |
0 |
|
|
193956091 |
n.n.n.kz |
A |
Feb. 17, 2023, 5:50 a.m. |
OK |
PHP |
TESTS |
3 |
30 |
0 |
|
|
193922700 |
crapcode |
A |
Feb. 16, 2023, 6:54 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
77 |
2355200 |
|
|
193925189 |
wkoo |
A |
Feb. 16, 2023, 7:22 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
171 |
4403200 |
|
|
193911645 |
Ali_Mohamed77 |
A |
Feb. 16, 2023, 5:07 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
171 |
5632000 |
|
|
193920184 |
RF_Faisal |
A |
Feb. 16, 2023, 6:25 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
171 |
5939200 |
|
|
193939268 |
bpdolson |
A |
Feb. 16, 2023, 11:21 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
4608000 |
|
|
193936803 |
M0mani |
A |
Feb. 16, 2023, 10:18 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
5427200 |
|
|
193935700 |
tohlenejsemja |
A |
Feb. 16, 2023, 9:56 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
5632000 |
|
|
193915847 |
VINAYKISHORE |
A |
Feb. 16, 2023, 5:42 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
5734400 |
|
|
193908806 |
Ali_Mohamed77 |
A |
Feb. 16, 2023, 4:50 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
6144000 |
|
|
193909487 |
JUBHAI |
A |
Feb. 16, 2023, 4:54 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
187 |
4608000 |
|
|
193915342 |
RUiNtheExtinct |
A |
Feb. 16, 2023, 5:37 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
62 |
3686400 |
|
|
193913709 |
rmr |
A |
Feb. 16, 2023, 5:23 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
62 |
3993600 |
|
|
193928076 |
oweijane |
A |
Feb. 16, 2023, 7:59 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
77 |
2252800 |
|
|
193925486 |
SophieHatter |
A |
Feb. 16, 2023, 7:26 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
77 |
2252800 |
|
|
193909391 |
2momo2 |
A |
Feb. 16, 2023, 4:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
77 |
2457600 |
|
|
193908838 |
hvbird |
A |
Feb. 16, 2023, 4:50 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
77 |
3788800 |
|
|
193954147 |
hkwu6013 |
A |
Feb. 17, 2023, 5:19 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
77 |
4812800 |
|
|
193932669 |
gesuta |
A |
Feb. 16, 2023, 9:03 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
92 |
4505600 |
|
|
193906746 |
CinaDor |
A |
Feb. 16, 2023, 4:39 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
92 |
5017600 |
|
|
193949690 |
aneesh2002 |
A |
Feb. 17, 2023, 4 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
93 |
4096000 |
|
|
193944043 |
Muhammad_Aneeq |
A |
Feb. 17, 2023, 1:38 a.m. |
OK |
Python 3 |
TESTS |
3 |
30 |
0 |
|
|
193917197 |
rikitikialex |
A |
Feb. 16, 2023, 5:54 p.m. |
OK |
Python 3 |
TESTS |
3 |
31 |
0 |
|
|
193910784 |
AbdallaE |
A |
Feb. 16, 2023, 5:02 p.m. |
OK |
Python 3 |
TESTS |
3 |
31 |
0 |
|
|
193910096 |
Typhoons |
A |
Feb. 16, 2023, 4:58 p.m. |
OK |
Python 3 |
TESTS |
3 |
31 |
0 |
|
|
193896986 |
samad323 |
A |
Feb. 16, 2023, 4:14 p.m. |
OK |
Python 3 |
TESTS |
3 |
31 |
0 |
|
|
193947983 |
sarose |
A |
Feb. 17, 2023, 3:21 a.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
193943085 |
kanth_7 |
A |
Feb. 17, 2023, 1:12 a.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
193936624 |
Wube |
A |
Feb. 16, 2023, 10:14 p.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
193936544 |
furkandogmus |
A |
Feb. 16, 2023, 10:12 p.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
193933713 |
Balio87 |
A |
Feb. 16, 2023, 9:20 p.m. |
OK |
Python 3 |
TESTS |
3 |
46 |
0 |
|
|
193909990 |
MrMopi5000 |
A |
Feb. 16, 2023, 4:57 p.m. |
OK |
Ruby 3 |
TESTS |
3 |
265 |
102400 |
|
|
193935097 |
Ztin |
A |
Feb. 16, 2023, 9:45 p.m. |
OK |
Rust 2021 |
TESTS |
3 |
15 |
0 |
|
|
remove filters
Back to search problems