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'Recently, the students of School 179 have developed a unique algorithm, which takes in a binary string s as input. However, they soon found out that if some substring t of s is a palindrome of length greater than 1, the algorithm will work incorrectly. Can the students somehow reorder the characters of s so that the algorithm will work correctly on the string? A binary string is a string where each character is either 0 or 1. A string a is a substring of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end. A palindrome is a string that reads the same backwards as forwards. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the length of the string s . The second line of each test case contains the string s of length n consisting only of the characters 0 and 1. For each test case, print YES (case-insensitive) if it is possible to reorder the characters of s so that there are no substrings that are a palindrome of length greater than 1, or NO (case-insensitive) otherwise. In the first three test cases, the given strings do not contain palindromes of length greater than 1, so the answers are YES. In the last test case, it is impossible to reorder the characters so that the string does not contain palindromes of length greater than 1, so the answer is NO. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
144605179 |
dhruv_pandya |
A |
Jan. 31, 2022, 1:14 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
9 |
30 |
0 |
|
|
144616285 |
YouRFlame |
A |
Jan. 31, 2022, 5:50 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
9 |
31 |
0 |
|
|
144593312 |
ishitbansal |
A |
Jan. 30, 2022, 6:40 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144593384 |
ishitbansal |
A |
Jan. 30, 2022, 6:41 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144594836 |
Qu1etboy |
A |
Jan. 30, 2022, 7:03 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144594931 |
Sankalp_12 |
A |
Jan. 30, 2022, 7:05 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144596292 |
soham.korade |
A |
Jan. 30, 2022, 7:29 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144611049 |
fahimfarhad123 |
A |
Jan. 31, 2022, 4:23 a.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144587893 |
shirish2601 |
A |
Jan. 30, 2022, 5:37 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144586247 |
Ashish_Varma |
A |
Jan. 30, 2022, 5:24 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144591498 |
saker.hajji |
A |
Jan. 30, 2022, 6:15 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144592656 |
ishitbansal |
A |
Jan. 30, 2022, 6:30 p.m. |
OK |
GNU C11 |
TESTS |
9 |
15 |
0 |
|
|
144613153 |
mfk_786 |
A |
Jan. 31, 2022, 5:02 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144612837 |
pitUuu |
A |
Jan. 31, 2022, 4:57 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144612715 |
vikra_rock |
A |
Jan. 31, 2022, 4:54 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144616785 |
CunFu_ZhuGe |
A |
Jan. 31, 2022, 5:58 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144616478 |
LostStar_99 |
A |
Jan. 31, 2022, 5:53 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144616169 |
chrhaaeon |
A |
Jan. 31, 2022, 5:49 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144616124 |
Miaky |
A |
Jan. 31, 2022, 5:48 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144615444 |
Chindi_Chor_1 |
A |
Jan. 31, 2022, 5:38 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144614734 |
rts_tamak |
A |
Jan. 31, 2022, 5:27 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144613313 |
zzzzym |
A |
Jan. 31, 2022, 5:05 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
0 |
0 |
|
|
144616648 |
Alpha08 |
A |
Jan. 31, 2022, 5:55 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144616578 |
Geerbani_shashi |
A |
Jan. 31, 2022, 5:55 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144616594 |
Rohan002 |
A |
Jan. 31, 2022, 5:55 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144616380 |
Darshit_Gupta |
A |
Jan. 31, 2022, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144616123 |
abhilash_360 |
A |
Jan. 31, 2022, 5:48 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144616092 |
realillanurag |
A |
Jan. 31, 2022, 5:48 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144615838 |
sapta0506 |
A |
Jan. 31, 2022, 5:44 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144615794 |
Teerthkr |
A |
Jan. 31, 2022, 5:43 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144615584 |
gp919934 |
A |
Jan. 31, 2022, 5:40 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144615109 |
hrai_20 |
A |
Jan. 31, 2022, 5:32 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
0 |
0 |
|
|
144607328 |
originalsidd |
A |
Jan. 31, 2022, 2:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144616856 |
sagar_sk007 |
A |
Jan. 31, 2022, 5:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144613545 |
Retired_Isaunoya |
A |
Jan. 31, 2022, 5:08 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144609071 |
CODEGod1 |
A |
Jan. 31, 2022, 3:38 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144608140 |
codesomee |
A |
Jan. 31, 2022, 3:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144607215 |
a129838445808 |
A |
Jan. 31, 2022, 2:45 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144605544 |
Komeiji_Satori_ |
A |
Jan. 31, 2022, 1:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144604965 |
wygzgyw |
A |
Jan. 31, 2022, 1:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144603681 |
ayham.aree21 |
A |
Jan. 30, 2022, 11:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144601749 |
dnazirzhanov05 |
A |
Jan. 30, 2022, 9:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
0 |
0 |
|
|
144613173 |
MEET30 |
A |
Jan. 31, 2022, 5:02 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144613190 |
HermEs32 |
A |
Jan. 31, 2022, 5:03 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144613434 |
Henansh721 |
A |
Jan. 31, 2022, 5:07 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144614336 |
Deep23 |
A |
Jan. 31, 2022, 5:21 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144614820 |
abdu11a |
A |
Jan. 31, 2022, 5:28 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144615200 |
doneela |
A |
Jan. 31, 2022, 5:34 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144615328 |
krystelarekt |
A |
Jan. 31, 2022, 5:36 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144615567 |
Tahim_097 |
A |
Jan. 31, 2022, 5:40 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144615858 |
ParthMangal |
A |
Jan. 31, 2022, 5:44 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144616486 |
vjudge1 |
A |
Jan. 31, 2022, 5:53 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
0 |
0 |
|
|
144590238 |
hksenpai |
A |
Jan. 30, 2022, 6 p.m. |
OK |
Java 11 |
TESTS |
9 |
140 |
0 |
|
|
144592402 |
mrlucent |
A |
Jan. 30, 2022, 6:27 p.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144616177 |
Tykonan |
A |
Jan. 31, 2022, 5:49 a.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144615620 |
the_unknown1 |
A |
Jan. 31, 2022, 5:41 a.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144609144 |
Toinfinity |
A |
Jan. 31, 2022, 3:41 a.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144606629 |
g00dluckroon |
A |
Jan. 31, 2022, 2:24 a.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144602077 |
mohamedsamirtkd |
A |
Jan. 30, 2022, 10:03 p.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144589357 |
tushar19280 |
A |
Jan. 30, 2022, 5:51 p.m. |
OK |
Java 11 |
TESTS |
9 |
155 |
0 |
|
|
144613034 |
DylanSmith |
A |
Jan. 31, 2022, 5 a.m. |
OK |
Java 11 |
TESTS |
9 |
156 |
0 |
|
|
144600785 |
codebook_2000 |
A |
Jan. 30, 2022, 9:14 p.m. |
OK |
Java 11 |
TESTS |
9 |
156 |
0 |
|
|
144589714 |
_Gupta_JI_ |
A |
Jan. 30, 2022, 5:55 p.m. |
OK |
Java 8 |
TESTS |
9 |
77 |
0 |
|
|
144615951 |
vivek_7777 |
A |
Jan. 31, 2022, 5:46 a.m. |
OK |
Java 8 |
TESTS |
9 |
78 |
0 |
|
|
144600082 |
roctes7 |
A |
Jan. 30, 2022, 8:53 p.m. |
OK |
Java 8 |
TESTS |
9 |
78 |
0 |
|
|
144595391 |
niknaks |
A |
Jan. 30, 2022, 7:13 p.m. |
OK |
Java 8 |
TESTS |
9 |
78 |
0 |
|
|
144606016 |
Yuxiang |
A |
Jan. 31, 2022, 2:01 a.m. |
OK |
Java 8 |
TESTS |
9 |
92 |
0 |
|
|
144592203 |
Sayazhan |
A |
Jan. 30, 2022, 6:24 p.m. |
OK |
Java 8 |
TESTS |
9 |
92 |
0 |
|
|
144614024 |
muhammad_mehedi_hasan |
A |
Jan. 31, 2022, 5:16 a.m. |
OK |
Java 8 |
TESTS |
9 |
93 |
0 |
|
|
144612542 |
gssakash |
A |
Jan. 31, 2022, 4:51 a.m. |
OK |
Java 8 |
TESTS |
9 |
93 |
0 |
|
|
144611512 |
suyash.211.sn |
A |
Jan. 31, 2022, 4:31 a.m. |
OK |
Java 8 |
TESTS |
9 |
93 |
0 |
|
|
144609047 |
ved20 |
A |
Jan. 31, 2022, 3:38 a.m. |
OK |
Java 8 |
TESTS |
9 |
93 |
0 |
|
|
144580453 |
knitin2604 |
A |
Jan. 30, 2022, 4:30 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
0 |
0 |
|
|
144609373 |
edfearay11 |
A |
Jan. 31, 2022, 3:46 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144607963 |
Uditpatel78 |
A |
Jan. 31, 2022, 3:09 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144606017 |
RealStarlight |
A |
Jan. 31, 2022, 2:01 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144595087 |
Gadi |
A |
Jan. 30, 2022, 7:07 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144593493 |
adarshpandey11222 |
A |
Jan. 30, 2022, 6:42 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144593093 |
Devil_777 |
A |
Jan. 30, 2022, 6:37 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144590588 |
v.pelosio |
A |
Jan. 30, 2022, 6:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144588896 |
Tangerine |
A |
Jan. 30, 2022, 5:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144588889 |
temur_sherov |
A |
Jan. 30, 2022, 5:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
15 |
0 |
|
|
144597616 |
fclibxyz |
A |
Jan. 30, 2022, 7:54 p.m. |
OK |
Node.js |
TESTS |
9 |
62 |
0 |
|
|
144585472 |
1_2_3_4_5_9 |
A |
Jan. 30, 2022, 5:19 p.m. |
OK |
PyPy 2 |
TESTS |
9 |
93 |
307200 |
|
|
144607275 |
aman404found |
A |
Jan. 31, 2022, 2:47 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
61 |
0 |
|
|
144585149 |
Igorfardoc |
A |
Jan. 30, 2022, 5:17 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
61 |
0 |
|
|
144593121 |
MistaAsh |
A |
Jan. 30, 2022, 6:37 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
62 |
0 |
|
|
144592740 |
brimstone |
A |
Jan. 30, 2022, 6:31 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
62 |
0 |
|
|
144614823 |
rudrashah |
A |
Jan. 31, 2022, 5:28 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144610440 |
Preetmodh_13 |
A |
Jan. 31, 2022, 4:11 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144610070 |
zunayed_cse |
A |
Jan. 31, 2022, 4:02 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144609015 |
__J__ |
A |
Jan. 31, 2022, 3:37 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144590178 |
barampampsh |
A |
Jan. 30, 2022, 6 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144588865 |
bmsb235 |
A |
Jan. 30, 2022, 5:46 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
77 |
0 |
|
|
144600316 |
ParmenidesOfElea |
A |
Jan. 30, 2022, 9 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
62 |
0 |
|
|
144588284 |
ne1tron |
A |
Jan. 30, 2022, 5:41 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
62 |
0 |
|
|
144579851 |
roshchupkin2 |
A |
Jan. 30, 2022, 4:29 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
62 |
0 |
|
|
144606259 |
noOneShouldKnow |
A |
Jan. 31, 2022, 2:10 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
62 |
102400 |
|
|
144591342 |
Bhosrasur |
A |
Jan. 30, 2022, 6:13 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
62 |
102400 |
|
|
144616116 |
rutz12 |
A |
Jan. 31, 2022, 5:48 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
77 |
0 |
|
|
144614561 |
MHAII |
A |
Jan. 31, 2022, 5:24 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
77 |
0 |
|
|
144613080 |
Varad2002 |
A |
Jan. 31, 2022, 5:01 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
77 |
0 |
|
|
144610497 |
Anti-Neutrino |
A |
Jan. 31, 2022, 4:12 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
77 |
0 |
|
|
144609457 |
Waziri |
A |
Jan. 31, 2022, 3:49 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
77 |
0 |
|
|
144592297 |
varunsh17 |
A |
Jan. 30, 2022, 6:25 p.m. |
OK |
Python 3 |
TESTS |
9 |
30 |
0 |
|
|
144585649 |
anusha_nemani |
A |
Jan. 30, 2022, 5:20 p.m. |
OK |
Python 3 |
TESTS |
9 |
30 |
0 |
|
|
144614821 |
Haruka39 |
A |
Jan. 31, 2022, 5:28 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144613236 |
MuhammadAMMAR |
A |
Jan. 31, 2022, 5:04 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144609663 |
harshk_52 |
A |
Jan. 31, 2022, 3:54 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144609271 |
khaliqdaad |
A |
Jan. 31, 2022, 3:44 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144608307 |
Northfence |
A |
Jan. 31, 2022, 3:19 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144607937 |
ayushj121 |
A |
Jan. 31, 2022, 3:08 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144606216 |
Muhammad.Daniyal |
A |
Jan. 31, 2022, 2:09 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144605366 |
Srirambabu |
A |
Jan. 31, 2022, 1:25 a.m. |
OK |
Python 3 |
TESTS |
9 |
31 |
0 |
|
|
144597663 |
Codula |
A |
Jan. 30, 2022, 7:56 p.m. |
OK |
Rust 2021 |
TESTS |
9 |
0 |
0 |
|
|
144587594 |
tajirhas9 |
A |
Jan. 30, 2022, 5:34 p.m. |
OK |
Rust 2021 |
TESTS |
9 |
15 |
0 |
|
|
remove filters
Back to search problems