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'A bracket sequence is a string containing only characters "(" and ")". A regular bracket sequence (or, shortly, an RBS) is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the original characters of the sequence. For example: There was an RBS. Some brackets have been replaced with question marks. Is it true that there is a unique way to replace question marks with brackets, so that the resulting sequence is an RBS? The first line contains a single integer t ( 1 <= t <= 5 cdot 10^4 ) -- the number of testcases. The only line of each testcase contains an RBS with some brackets replaced with question marks. Each character is either '( ', ') ' or '? '. At least one RBS can be recovered from the given sequence. The total length of the sequences over all testcases doesn 't exceed 2 cdot 10^5 . For each testcase, print "YES" if the way to replace question marks with brackets, so that the resulting sequence is an RBS, is unique. If there is more than one way, then print "NO". In the first testcase, the only possible original RBS is "(())". In the second testcase, there are multiple ways to recover an RBS. In the third and the fourth testcases, the only possible original RBS is "()". In the fifth testcase, the original RBS can be either "((()()))" or "(())()()". '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
165230983 |
TheILICH |
C |
July 21, 2022, 6:47 p.m. |
OK |
C# 8 |
TESTS |
10 |
202 |
2662400 |
|
|
165256631 |
LeonGymretzka |
C |
July 22, 2022, 3:01 a.m. |
OK |
GNU C11 |
TESTS |
10 |
31 |
512000 |
|
|
165260838 |
CyberDog |
C |
July 22, 2022, 4 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165259587 |
wojiao |
C |
July 22, 2022, 3:42 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165259219 |
pclie |
C |
July 22, 2022, 3:36 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165259152 |
mfs0914 |
C |
July 22, 2022, 3:35 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165258148 |
tqzzzzz |
C |
July 22, 2022, 3:21 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165256451 |
QQH |
C |
July 22, 2022, 2:58 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165253923 |
1287971889 |
C |
July 22, 2022, 2:24 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165264384 |
retcarizy |
C |
July 22, 2022, 4:50 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165264267 |
rui_er |
C |
July 22, 2022, 4:48 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165266502 |
CECY |
C |
July 22, 2022, 5:19 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
204800 |
|
|
165265312 |
HaPpY1213 |
C |
July 22, 2022, 5:02 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165256831 |
XenonWZH |
C |
July 22, 2022, 3:03 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165256699 |
lindi530 |
C |
July 22, 2022, 3:01 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165256107 |
swjtu_cfbird |
C |
July 22, 2022, 2:53 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165252966 |
eE_v_Ee |
C |
July 22, 2022, 2:10 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165250139 |
WingWingSQ |
C |
July 22, 2022, 1:28 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165249525 |
NIUhaha |
C |
July 22, 2022, 1:18 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165246427 |
sbdlg |
C |
July 22, 2022, 12:07 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165235326 |
qw12 |
C |
July 21, 2022, 7:52 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165258313 |
CY011 |
C |
July 22, 2022, 3:23 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
204800 |
|
|
165266911 |
SCAU_Lnn |
C |
July 22, 2022, 5:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165257421 |
zycac |
C |
July 22, 2022, 3:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
204800 |
|
|
165257384 |
zycac |
C |
July 22, 2022, 3:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
204800 |
|
|
165257056 |
wx13479893646 |
C |
July 22, 2022, 3:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
204800 |
|
|
165250871 |
KcwAC |
C |
July 22, 2022, 1:40 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
204800 |
|
|
165248281 |
Eter.nal |
C |
July 22, 2022, 12:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
204800 |
|
|
165266942 |
SCAU_Lnn |
C |
July 22, 2022, 5:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
512000 |
|
|
165263510 |
btushar_12 |
C |
July 22, 2022, 4:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
512000 |
|
|
165264350 |
infiniteloop97 |
C |
July 22, 2022, 4:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
512000 |
|
|
165268664 |
whohet |
C |
July 22, 2022, 5:48 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
512000 |
|
|
165239224 |
codingwizard24 |
C |
July 21, 2022, 9:03 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165231099 |
arghakole |
C |
July 21, 2022, 6:48 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165224208 |
ScorpioDagger |
C |
July 21, 2022, 5:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165222138 |
Daybreak7 |
C |
July 21, 2022, 5:16 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165225944 |
miga_nn |
C |
July 21, 2022, 5:50 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165263792 |
Kidding_M |
C |
July 22, 2022, 4:41 a.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165262444 |
poojan_021102 |
C |
July 22, 2022, 4:22 a.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165261211 |
77x17 |
C |
July 22, 2022, 4:06 a.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
512000 |
|
|
165261358 |
The_First_Avenger |
C |
July 22, 2022, 4:08 a.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
819200 |
|
|
165230795 |
prithwiraj15 |
C |
July 21, 2022, 6:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
10 |
0 |
1024000 |
|
|
165265365 |
zouyu963l |
C |
July 22, 2022, 5:03 a.m. |
OK |
Go |
TESTS |
10 |
30 |
1126400 |
|
|
165231251 |
QPALZM123 |
C |
July 21, 2022, 6:50 p.m. |
OK |
Java 11 |
TESTS |
10 |
170 |
0 |
|
|
165226866 |
themadknight45 |
C |
July 21, 2022, 6 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165264903 |
singhshivsm20001 |
C |
July 22, 2022, 4:57 a.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165246610 |
Nicolas125841 |
C |
July 22, 2022, 12:11 a.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165242095 |
themadknight45 |
C |
July 21, 2022, 10:06 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165241602 |
tusharpruth |
C |
July 21, 2022, 9:54 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165228259 |
saurabh_kh |
C |
July 21, 2022, 6:17 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165225103 |
satyaa_78 |
C |
July 21, 2022, 5:42 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165224050 |
satyaa_78 |
C |
July 21, 2022, 5:33 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
165257434 |
Akash151101 |
C |
July 22, 2022, 3:12 a.m. |
OK |
Java 11 |
TESTS |
10 |
186 |
0 |
|
|
165263465 |
kkz666 |
C |
July 22, 2022, 4:36 a.m. |
OK |
Java 17 |
TESTS |
10 |
202 |
409600 |
|
|
165251691 |
kritikmodi |
C |
July 22, 2022, 1:51 a.m. |
OK |
Java 17 |
TESTS |
10 |
311 |
409600 |
|
|
165233511 |
Marbik |
C |
July 21, 2022, 7:22 p.m. |
OK |
Java 17 |
TESTS |
10 |
327 |
102400 |
|
|
165218441 |
O_E |
C |
July 21, 2022, 4:52 p.m. |
OK |
Java 8 |
TESTS |
10 |
93 |
0 |
|
|
165234178 |
javaisbetter |
C |
July 21, 2022, 7:33 p.m. |
OK |
Java 8 |
TESTS |
10 |
108 |
0 |
|
|
165226603 |
MagentaCobra |
C |
July 21, 2022, 5:57 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
165259087 |
naveenkant227 |
C |
July 22, 2022, 3:34 a.m. |
OK |
Java 8 |
TESTS |
10 |
389 |
0 |
|
|
165236797 |
Kaldaruly |
C |
July 21, 2022, 8:16 p.m. |
OK |
Java 8 |
TESTS |
10 |
389 |
0 |
|
|
165251670 |
kritikmodi |
C |
July 22, 2022, 1:51 a.m. |
OK |
Java 8 |
TESTS |
10 |
390 |
0 |
|
|
165237234 |
PavelChadnov |
C |
July 21, 2022, 8:23 p.m. |
OK |
Kotlin 1.4 |
TESTS |
10 |
295 |
3993600 |
|
|
165266627 |
6ziv |
C |
July 22, 2022, 5:20 a.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
15 |
204800 |
|
|
165225696 |
nikuradze2006 |
C |
July 21, 2022, 5:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
155 |
614400 |
|
|
165225732 |
nikuradze2006 |
C |
July 21, 2022, 5:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
170 |
614400 |
|
|
165219954 |
TemporalBloom |
C |
July 21, 2022, 5:01 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
187 |
819200 |
|
|
165258678 |
wincss |
C |
July 22, 2022, 3:28 a.m. |
OK |
PyPy 2 |
TESTS |
10 |
249 |
5222400 |
|
|
165231925 |
sami02jain |
C |
July 21, 2022, 6:59 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
202 |
8908800 |
|
|
165222490 |
sushmanth.dampur8780 |
C |
July 21, 2022, 5:19 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
233 |
9420800 |
|
|
165225892 |
hxu10 |
C |
July 21, 2022, 5:50 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
280 |
11161600 |
|
|
165219374 |
zouyu9631 |
C |
July 21, 2022, 4:57 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
296 |
12902400 |
|
|
165214482 |
anishde85 |
C |
July 21, 2022, 4:36 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
374 |
15257600 |
|
|
165242140 |
heathcliff_sun |
C |
July 21, 2022, 10:07 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
686 |
7884800 |
|
|
165220653 |
Glad1ator |
C |
July 21, 2022, 5:05 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
733 |
8089600 |
|
|
165217203 |
EthicEtheR |
C |
July 21, 2022, 4:46 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
1044 |
14131200 |
|
|
165247739 |
biglunchdude |
C |
July 22, 2022, 12:40 a.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
9523200 |
|
|
165225742 |
mintplz |
C |
July 21, 2022, 5:48 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
13414400 |
|
|
165234268 |
MistaAsh |
C |
July 21, 2022, 7:34 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
17920000 |
|
|
165256033 |
pennymagic156 |
C |
July 22, 2022, 2:52 a.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
140 |
9011200 |
|
|
165241544 |
iska_terminator |
C |
July 21, 2022, 9:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
155 |
9216000 |
|
|
165219703 |
rusel515 |
C |
July 21, 2022, 4:59 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
170 |
20070400 |
|
|
165218498 |
unknownSolver |
C |
July 21, 2022, 4:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
170 |
20172800 |
|
|
165263006 |
abhaumik24 |
C |
July 22, 2022, 4:29 a.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
171 |
139571200 |
|
|
165232459 |
mayank35 |
C |
July 21, 2022, 7:06 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
186 |
21401600 |
|
|
165218944 |
coconut99 |
C |
July 21, 2022, 4:55 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
187 |
11059200 |
|
|
165245077 |
mohanned_war |
C |
July 21, 2022, 11:28 p.m. |
OK |
Python 3 |
TESTS |
10 |
202 |
4915200 |
|
|
165241180 |
KappaGolden |
C |
July 21, 2022, 9:45 p.m. |
OK |
Python 3 |
TESTS |
10 |
404 |
716800 |
|
|
165269162 |
anvesh_saxena |
C |
July 22, 2022, 5:54 a.m. |
OK |
Python 3 |
TESTS |
10 |
420 |
716800 |
|
|
165267966 |
MohamedHamed123 |
C |
July 22, 2022, 5:39 a.m. |
OK |
Python 3 |
TESTS |
10 |
420 |
716800 |
|
|
165241194 |
KappaGolden |
C |
July 21, 2022, 9:45 p.m. |
OK |
Python 3 |
TESTS |
10 |
436 |
716800 |
|
|
165243323 |
hany.elnokaly |
C |
July 21, 2022, 10:37 p.m. |
OK |
Python 3 |
TESTS |
10 |
451 |
716800 |
|
|
165220746 |
Misterio_ |
C |
July 21, 2022, 5:06 p.m. |
OK |
Python 3 |
TESTS |
10 |
452 |
716800 |
|
|
165220338 |
Misterio_ |
C |
July 21, 2022, 5:03 p.m. |
OK |
Python 3 |
TESTS |
10 |
467 |
716800 |
|
|
165250024 |
crrystalz |
C |
July 22, 2022, 1:26 a.m. |
OK |
Python 3 |
TESTS |
10 |
483 |
716800 |
|
|
165233068 |
bip22 |
C |
July 21, 2022, 7:15 p.m. |
OK |
Python 3 |
TESTS |
10 |
483 |
3174400 |
|
|
165263875 |
Niklassanden |
C |
July 22, 2022, 4:42 a.m. |
OK |
Rust 2021 |
TESTS |
10 |
15 |
819200 |
|
|
165219053 |
robostac |
C |
July 21, 2022, 4:56 p.m. |
OK |
Rust 2021 |
TESTS |
10 |
15 |
2150400 |
|
|
165253645 |
xttt |
C |
July 22, 2022, 2:20 a.m. |
OK |
Rust 2021 |
TESTS |
10 |
31 |
5734400 |
|
|
remove filters
Back to search problems