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 |
|---|---|---|---|---|---|---|
| 2223 | Codeforces Round 1097 (Div. 1, Based on Zhili Cup 2026) | FINISHED | False | 9000 | 2418896 | May 6, 2026, 6:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 6354 ) | A | Zhily and Bracket Swapping | PROGRAMMING | constructive algorithms greedy |
Deep in the wilderness, Zhily and Jily discovered two sequences composed of brackets. Each sequence carries some logical structure, but neither of them is necessarily a regular bracket sequence on its own. They found that by swapping brackets between the two sequences, they could repair them. They wish to make both sequences regular bracket sequences by swapping brackets between them. A regular bracket sequence is a sequence consisting of '(' and ')', which can be turned into a valid math expression by inserting 1 and + any number of times into the sequence. For example, the sequence "()(()())" is a regular bracket sequence, while "())((" or "(()" are not regular bracket sequences. You are given two bracket sequences (a) and (b) of even length (n). You can perform the following operation any number of times: Choose a position (i) ((1 \leq i \leq n)) and swap (a_i) and (b_i). Determine whether you can turn both (a) and (b) into regular bracket sequences. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \leq n \leq 2\cdot 10^5), (n) is even) — the length of the strings (a) and (b). The second line of each test case contains a sequence (a) of length (n) consisting only of characters '(' and ')'. The third line of each test case contains a sequence (b) of length (n) consisting only of characters '(' and ')'. It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, output "YES" if you can turn both (a) and (b) into a regular bracket sequences, "NO" otherwise. You can output "YES" and "NO" in any case (for example, "yES", "yes", and "Yes" will be recognized as a positive response). In the first, fourth, and sixth test cases, both (a) and $$$ |
| Codeforces Round 1097 (Div. 1, Div2, Based on Zhili Cup 2026) Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 373664998 | caffeine2ac | A | May 6, 2026, 6:40 a.m. | OK | C# 13 | TESTS | 7 | 78 | 17100800 | ||
| 373752906 | abhishek_singh19 | A | May 6, 2026, 5:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 15 | 102400 | ||
| 373671874 | More | A | May 6, 2026, 7:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 15 | 409600 | ||
| 373776428 | ZahidUlHaq | A | May 7, 2026, 3:32 a.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373766335 | durid17 | A | May 6, 2026, 10:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373765517 | bubbarob19 | A | May 6, 2026, 10:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373715772 | Speedtortoise | A | May 6, 2026, 12:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373715629 | bounce__back | A | May 6, 2026, 12:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373657274 | CrossFire1 | A | May 6, 2026, 6:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373656311 | dinohaur | A | May 6, 2026, 6:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373656272 | yogzinhoo | A | May 6, 2026, 6:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 7 | 31 | 0 | ||
| 373656076 | turska | A | May 6, 2026, 6:16 a.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 15 | 0 | ||
| 373655616 | aaa_Pigeon2 | A | May 6, 2026, 6:15 a.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 15 | 102400 | ||
| 373658142 | www_bilibili_com | A | May 6, 2026, 6:21 a.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 15 | 307200 | ||
| 373771666 | Jensen123 | A | May 7, 2026, 1:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373755998 | jesterjet | A | May 6, 2026, 6:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373753996 | BLOBVISGOD | A | May 6, 2026, 6:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373732083 | aqxa | A | May 6, 2026, 2:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373731413 | Arup2002 | A | May 6, 2026, 2:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373730808 | You_Wang | A | May 6, 2026, 2:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373696446 | ASnown | A | May 6, 2026, 9:16 a.m. | OK | C++20 (GCC 13-64) | TESTS | 7 | 31 | 0 | ||
| 373659382 | .Alternate. | A | May 6, 2026, 6:24 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 15 | 0 | ||
| 373657103 | NortGlG | A | May 6, 2026, 6:18 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 15 | 102400 | ||
| 373781965 | yyyyzc | A | May 7, 2026, 5:27 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373780743 | link1k | A | May 7, 2026, 5:05 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373779941 | thakurchinmay10 | A | May 7, 2026, 4:48 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373777338 | csk2005 | A | May 7, 2026, 3:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373775836 | IseriNina27 | A | May 7, 2026, 3:19 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373761340 | I_am_blindfold | A | May 6, 2026, 8:12 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373760353 | xndr | A | May 6, 2026, 7:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373756752 | Utkarsh_Patidar | A | May 6, 2026, 6:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 7 | 31 | 0 | ||
| 373658730 | Gassa | A | May 6, 2026, 6:22 a.m. | OK | D | TESTS | 7 | 62 | 2662400 | ||
| 373652831 | pengin_2000 | A | May 6, 2026, 6:09 a.m. | OK | GNU C11 | TESTS | 7 | 31 | 307200 | ||
| 373668242 | codecrasher_ | A | May 6, 2026, 6:50 a.m. | OK | Go | TESTS | 7 | 31 | 1536000 | ||
| 373759073 | sysmux | A | May 6, 2026, 7:26 p.m. | OK | Java 21 | TESTS | 7 | 171 | 409600 | ||
| 373746043 | SHASHANK711 | A | May 6, 2026, 4:49 p.m. | OK | Java 21 | TESTS | 7 | 218 | 0 | ||
| 373666935 | lybord | A | May 6, 2026, 6:46 a.m. | OK | Java 21 | TESTS | 7 | 218 | 716800 | ||
| 373653138 | MBBN | A | May 6, 2026, 6:09 a.m. | OK | Java 21 | TESTS | 7 | 250 | 204800 | ||
| 373739061 | semiha1626 | A | May 6, 2026, 3:41 p.m. | OK | Java 21 | TESTS | 7 | 281 | 819200 | ||
| 373655073 | gofrozen21 | A | May 6, 2026, 6:13 a.m. | OK | Java 21 | TESTS | 7 | 296 | 1024000 | ||
| 373733187 | abhinav2222 | A | May 6, 2026, 2:52 p.m. | OK | Java 8 | TESTS | 7 | 109 | 0 | ||
| 373735559 | rkr21381 | A | May 6, 2026, 3:12 p.m. | OK | Java 8 | TESTS | 7 | 125 | 0 | ||
| 373667430 | hardgonnapass | A | May 6, 2026, 6:48 a.m. | OK | Java 8 | TESTS | 7 | 125 | 0 | ||
| 373721004 | kanishkar06k | A | May 6, 2026, 1:10 p.m. | OK | Java 8 | TESTS | 7 | 187 | 0 | ||
| 373742639 | Ayush79 | A | May 6, 2026, 4:15 p.m. | OK | Kotlin 2.2 | TESTS | 7 | 109 | 0 | ||
| 373681572 | bitplease_ | A | May 6, 2026, 7:45 a.m. | OK | Node.js | TESTS | 7 | 93 | 6041600 | ||
| 373779101 | choco_bar333 | A | May 7, 2026, 4:30 a.m. | OK | PyPy 3 | TESTS | 7 | 171 | 6656000 | ||
| 373699393 | Kartel234 | A | May 6, 2026, 9:47 a.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 4710400 | ||
| 373735430 | mawnoj | A | May 6, 2026, 3:11 p.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 4505600 | ||
| 373653382 | detteiuu | A | May 6, 2026, 6:10 a.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 4608000 | ||
| 373654165 | Emikooh | A | May 6, 2026, 6:11 a.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 4710400 | ||
| 373775684 | kamio-misuzu | A | May 7, 2026, 3:16 a.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 7168000 | ||
| 373706707 | flakepym | A | May 6, 2026, 11:09 a.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 5120000 | ||
| 373656371 | Only365 | A | May 6, 2026, 6:16 a.m. | OK | PyPy 3-64 | TESTS | 7 | 125 | 6758400 | ||
| 373777662 | kamio-misuzu | A | May 7, 2026, 3:59 a.m. | OK | PyPy 3-64 | TESTS | 7 | 125 | 6860800 | ||
| 373776352 | 123gjweq2 | A | May 7, 2026, 3:30 a.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 6963200 | ||
| 373727064 | DeadMan69 | A | May 6, 2026, 1:59 p.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 25600000 | ||
| 373707087 | nuriyevisa10 | A | May 6, 2026, 11:13 a.m. | OK | Python 3 | TESTS | 7 | 78 | 1126400 | ||
| 373731567 | NOK | A | May 6, 2026, 2:38 p.m. | OK | Python 3 | TESTS | 7 | 78 | 3174400 | ||
| 373743721 | Glebosyatina | A | May 6, 2026, 4:25 p.m. | OK | Python 3 | TESTS | 7 | 125 | 2764800 | ||
| 373776412 | chmpro | A | May 7, 2026, 3:31 a.m. | OK | Python 3 | TESTS | 7 | 140 | 1126400 | ||
| 373655100 | Midhilesh | A | May 6, 2026, 6:13 a.m. | OK | Python 3 | TESTS | 7 | 140 | 2560000 | ||
| 373701415 | nameng | A | May 6, 2026, 10:08 a.m. | OK | Python 3 | TESTS | 7 | 140 | 3686400 | ||
| 373656437 | sbt214 | A | May 6, 2026, 6:17 a.m. | OK | Python 3 | TESTS | 7 | 156 | 1228800 | ||
| 373653045 | sansen | A | May 6, 2026, 6:09 a.m. | OK | Rust 2021 | TESTS | 7 | 46 | 102400 | ||
| 373779298 | Spheniscine | A | May 7, 2026, 4:35 a.m. | OK | Rust 2024 | TESTS | 7 | 31 | 11776000 | ||
| 373655939 | DanielAnker | A | May 6, 2026, 6:15 a.m. | OK | Rust 2024 | TESTS | 7 | 46 | 0 | ||
| 373652057 | Egor | A | May 6, 2026, 6:07 a.m. | OK | Rust 2024 | TESTS | 7 | 46 | 0 |
Back to search problems