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 |
---|---|---|---|---|---|---|
1682 | Codeforces Round 793 (Div. 2) | FINISHED | False | 7200 | 83949863 | May 22, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 3390 ) | D | Circular Spanning Tree | PROGRAMMING | constructive algorithms trees |
B'There are n nodes arranged in a circle numbered from 1 to n in the clockwise order. You are also given a binary string s of length n . Your task is to construct a tree on the given n nodes satisfying the two conditions below or report that there such tree does not exist: Note that all edges are drawn as straight line segments. For example, edge (u, v) in the tree is drawn as a line segment connecting u and v on the circle. A tree on n nodes is a connected graph with n - 1 edges. The input consists of multiple test cases. The first line contains a single integer t (1 <= q t <= q 2 cdot 10^4) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n (2 <= q n <= q 2 cdot 10^5) -- the number of nodes. The second line of each test case contains a binary string s of length n . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, if there does not exist a tree that satisfies the given conditions, then output "NO" (without quotes), otherwise output "YES" followed by the description of tree. You can output each letter in any case (for example, "YES", "Yes", "yes", "yEs", "yEs" will be recognized as a positive answer). If there exists a tree, then output n - 1 lines, each containing two integers u and v (1 <= q u,v <= q n, u neq v) denoting an edge between u and v in the tree. If there are multiple possible answers, output any. In the first test case, the tree looks as follows: In the second test case, there is only one possible tree with an edge between 1 and 2 , and it does not satisfy the degree constraints. In the third test case, '... |
Codeforces Round #793 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
158122418 | FortyFour | D | May 23, 2022, 7:35 a.m. | OK | C# 10 | TESTS | 30 | 608 | 6041600 | ||
158123143 | FortyFour | D | May 23, 2022, 7:45 a.m. | OK | C# 10 | TESTS | 30 | 623 | 6041600 | ||
158300808 | Tdyx | D | May 24, 2022, 1:12 p.m. | OK | C# 8 | TESTS | 30 | 280 | 37990400 | ||
158133857 | blade_dance | D | May 23, 2022, 10:26 a.m. | OK | GNU C++14 | TESTS | 30 | 61 | 5017600 | ||
158505590 | luogu_bot3 | D | May 26, 2022, 8:20 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158505536 | 2022hanscome | D | May 26, 2022, 8:20 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158345412 | luxuhao | D | May 25, 2022, 2:48 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158148234 | lxeason | D | May 23, 2022, 1:30 p.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158129004 | duoluoluo | D | May 23, 2022, 9:14 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158114071 | closed_doors | D | May 23, 2022, 5:31 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158113335 | Chen03 | D | May 23, 2022, 5:19 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158103832 | Achtoria | D | May 23, 2022, 2:06 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 204800 | ||
158136940 | AOT_ERWIN | D | May 23, 2022, 11:11 a.m. | OK | GNU C++14 | TESTS | 30 | 62 | 512000 | ||
158109112 | ronin. | D | May 23, 2022, 4:07 a.m. | OK | GNU C++17 | TESTS | 30 | 61 | 4096000 | ||
158133806 | zero096 | D | May 23, 2022, 10:25 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 204800 | ||
158113979 | HLY111 | D | May 23, 2022, 5:30 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 204800 | ||
158516927 | Harsh1610 | D | May 26, 2022, 10:45 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158481500 | lskrly_ | D | May 26, 2022, 1:49 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158360098 | freesome | D | May 25, 2022, 7:18 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158343835 | daxgxr | D | May 25, 2022, 2:05 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158343199 | BappiLahiri | D | May 25, 2022, 1:40 a.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158322877 | vasvisood | D | May 24, 2022, 5:18 p.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158304486 | regian0001 | D | May 24, 2022, 1:52 p.m. | OK | GNU C++17 | TESTS | 30 | 62 | 512000 | ||
158144227 | alif_cse_ju | D | May 23, 2022, 12:41 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 512000 | ||
158273535 | exzang | D | May 24, 2022, 7:19 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 1024000 | ||
158120534 | dimss | D | May 23, 2022, 7:07 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 512000 | ||
158118439 | pakhandi98 | D | May 23, 2022, 6:37 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 512000 | ||
158112180 | pavankalyanpallapolu | D | May 23, 2022, 5:01 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 512000 | ||
158573318 | bkifhr9 | D | May 27, 2022, 1:39 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 2048000 | ||
158133738 | shencheng_ | D | May 23, 2022, 10:24 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 2150400 | ||
158136099 | lijiatu10086 | D | May 23, 2022, 10:59 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 4300800 | ||
158121721 | vljxjg | D | May 23, 2022, 7:25 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 4505600 | ||
158308339 | _mystery_ | D | May 24, 2022, 2:35 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 61 | 4608000 | ||
158253797 | -is-this-fft- | D | May 24, 2022, 1:29 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 512000 | ||
158112882 | blockche | D | May 23, 2022, 5:12 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 512000 | ||
158336759 | N_oB_ody | D | May 24, 2022, 9:09 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 2560000 | ||
158323028 | a_fan_of_xiaofan7 | D | May 24, 2022, 5:20 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158317539 | 10FastFinger | D | May 24, 2022, 4:17 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158305613 | naniim | D | May 24, 2022, 2:04 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158295752 | mohit40 | D | May 24, 2022, 12:13 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158265310 | yohackaboi69 | D | May 24, 2022, 5:16 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158131775 | jimm89 | D | May 23, 2022, 9:54 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158130012 | OtabekJurabekov | D | May 23, 2022, 9:28 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 512000 | ||
158285498 | Relief | D | May 24, 2022, 10:03 a.m. | OK | Java 11 | TESTS | 30 | 233 | 0 | ||
158114738 | rachitagrawal1011 | D | May 23, 2022, 5:42 a.m. | OK | Java 11 | TESTS | 30 | 234 | 3584000 | ||
158337577 | MrOtter | D | May 24, 2022, 9:34 p.m. | OK | Java 11 | TESTS | 30 | 265 | 0 | ||
158231106 | Asgar | D | May 23, 2022, 5:21 p.m. | OK | Java 11 | TESTS | 30 | 265 | 0 | ||
158104542 | naman5811 | D | May 23, 2022, 2:26 a.m. | OK | Java 11 | TESTS | 30 | 265 | 2867200 | ||
158112268 | eshan18.09 | D | May 23, 2022, 5:03 a.m. | OK | Java 11 | TESTS | 30 | 280 | 5324800 | ||
158128938 | ArchitSharma | D | May 23, 2022, 9:13 a.m. | OK | Java 11 | TESTS | 30 | 295 | 2150400 | ||
158112675 | eshan18.09 | D | May 23, 2022, 5:09 a.m. | OK | Java 11 | TESTS | 30 | 296 | 5324800 | ||
158105578 | dzhi | D | May 23, 2022, 2:51 a.m. | OK | Java 11 | TESTS | 30 | 296 | 15564800 | ||
158105794 | dzhi | D | May 23, 2022, 2:56 a.m. | OK | Java 11 | TESTS | 30 | 311 | 15974400 | ||
158236555 | ziduoyi | D | May 23, 2022, 6:24 p.m. | OK | Java 8 | TESTS | 30 | 202 | 1331200 | ||
158135886 | UniversalAdmin | D | May 23, 2022, 10:56 a.m. | OK | Java 8 | TESTS | 30 | 202 | 10137600 | ||
158249738 | invincible777 | D | May 23, 2022, 10:57 p.m. | OK | Java 8 | TESTS | 30 | 218 | 18944000 | ||
158314687 | tanishq044 | D | May 24, 2022, 3:45 p.m. | OK | Java 8 | TESTS | 30 | 233 | 12902400 | ||
158376317 | freehandle | D | May 25, 2022, 10:03 a.m. | OK | Java 8 | TESTS | 30 | 421 | 0 | ||
158144825 | ripity | D | May 23, 2022, 12:48 p.m. | OK | Kotlin 1.6 | TESTS | 30 | 311 | 3891200 | ||
158151235 | Kanata369 | D | May 23, 2022, 2:07 p.m. | OK | MS C++ 2017 | TESTS | 30 | 249 | 6041600 | ||
158365599 | freehandle | D | May 25, 2022, 8:35 a.m. | OK | MS C++ 2017 | TESTS | 30 | 841 | 3174400 | ||
158365523 | freehandle | D | May 25, 2022, 8:34 a.m. | OK | MS C++ 2017 | TESTS | 30 | 873 | 3174400 | ||
158149355 | 1_2_3_4_5_9 | D | May 23, 2022, 1:44 p.m. | OK | PyPy 2 | TESTS | 30 | 124 | 8396800 | ||
158128508 | ps_12 | D | May 23, 2022, 9:06 a.m. | OK | PyPy 3 | TESTS | 30 | 482 | 15974400 | ||
158343093 | YMSeah | D | May 25, 2022, 1:36 a.m. | OK | PyPy 3 | TESTS | 30 | 483 | 45875200 | ||
158502386 | Sufiyan18 | D | May 26, 2022, 7:38 a.m. | OK | PyPy 3 | TESTS | 30 | 499 | 29388800 | ||
158149907 | Shaydiesin | D | May 23, 2022, 1:51 p.m. | OK | PyPy 3 | TESTS | 30 | 639 | 11468800 | ||
158244318 | hxu10 | D | May 23, 2022, 8:29 p.m. | OK | PyPy 3 | TESTS | 30 | 686 | 19558400 | ||
158151736 | ossau_guildo | D | May 23, 2022, 2:13 p.m. | OK | PyPy 3-64 | TESTS | 30 | 170 | 24678400 | ||
158119152 | 9.86960440109 | D | May 23, 2022, 6:47 a.m. | OK | PyPy 3-64 | TESTS | 30 | 358 | 39936000 | ||
158148171 | wanderman | D | May 23, 2022, 1:29 p.m. | OK | PyPy 3-64 | TESTS | 30 | 608 | 52121600 | ||
158322639 | lemiao12 | D | May 24, 2022, 5:15 p.m. | OK | PyPy 3-64 | TESTS | 30 | 685 | 22528000 | ||
158149998 | apostoldaniel854 | D | May 23, 2022, 1:52 p.m. | OK | Python 3 | TESTS | 30 | 296 | 20480000 | ||
158574035 | pennymagic156 | D | May 27, 2022, 2 a.m. | OK | Python 3 | TESTS | 30 | 685 | 18227200 | ||
158122125 | Vanthoci | D | May 23, 2022, 7:31 a.m. | OK | Python 3 | TESTS | 30 | 733 | 11980800 | ||
158109932 | hannibal404 | D | May 23, 2022, 4:23 a.m. | OK | Python 3 | TESTS | 30 | 810 | 18944000 |
Back to search problems