Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2)

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
1994 Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) FINISHED False 7200 10509899 July 18, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5751 ) D Funny Game PROGRAMMING constructive algorithms ds graphs greedy math number theory

B'Vanya has a graph with n vertices (numbered from 1 to n ) and an array a of n integers; initially, there are no edges in the graph. Vanya got bored, and to have fun, he decided to perform n - 1 operations. Operation number x (operations are numbered in order starting from 1 ) is as follows: Help Vanya get a connected ^{ text{ xe2 x88 x97}} graph using the n - 1 operations, or determine that it is impossible. ^{ text{ xe2 x88 x97}} A graph is called connected if it is possible to reach any vertex from any other by moving along the edges. Each test consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 10^{3} ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains the number n ( 1 <= q n <= q 2000 ) -- the number of vertices in the graph. The second line of each test case contains n numbers a_1, a_2, cdots a_n ( 1 <= q a_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case, if there is no solution, then output "No" (without quotes). Otherwise, output "Yes" (without quotes), and then output n - 1 lines, where in the i -th line, output the numbers u and v that need to be chosen for operation i . You can output each letter in any case (for example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as a positive answer). Let 's consider the second test case. '...

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
271308965 nemars D July 19, 2024, 2:16 a.m. OK C# 10 TESTS 32 109 3072000
271324022 oyrzk D July 19, 2024, 4:56 a.m. OK C++14 (GCC 6-32) TESTS 32 46 102400
271315188 llldddddd_ D July 19, 2024, 3:18 a.m. OK C++14 (GCC 6-32) TESTS 32 46 102400
271303505 Enoch_TARDIS D July 19, 2024, 1:10 a.m. OK C++14 (GCC 6-32) TESTS 32 46 102400
271324354 chennie D July 19, 2024, 5 a.m. OK C++14 (GCC 6-32) TESTS 32 61 0
271310971 sunumbrella D July 19, 2024, 2:38 a.m. OK C++14 (GCC 6-32) TESTS 32 61 0
271300806 Biult D July 19, 2024, 12:27 a.m. OK C++14 (GCC 6-32) TESTS 32 61 102400
271299465 _101111_ D July 19, 2024, 12:01 a.m. OK C++14 (GCC 6-32) TESTS 32 61 102400
271313498 a_sad_soul D July 19, 2024, 3:02 a.m. OK C++14 (GCC 6-32) TESTS 32 62 0
271310860 tejasvi.aynor D July 19, 2024, 2:37 a.m. OK C++14 (GCC 6-32) TESTS 32 62 0
271302503 antguz D July 19, 2024, 12:56 a.m. OK C++14 (GCC 6-32) TESTS 32 62 0
271311648 Husanboy D July 19, 2024, 2:45 a.m. OK C++17 (GCC 7-32) TESTS 32 46 0
271306425 Cras0432 D July 19, 2024, 1:46 a.m. OK C++17 (GCC 7-32) TESTS 32 46 0
271302225 Rororna D July 19, 2024, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 32 46 0
271327076 nguyenkhangninh99 D July 19, 2024, 5:31 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271325741 timurkn D July 19, 2024, 5:15 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271324272 always_still D July 19, 2024, 4:59 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271323540 kvivekcodes D July 19, 2024, 4:50 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271314507 sunliwei D July 19, 2024, 3:11 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271305117 MarioYC D July 19, 2024, 1:31 a.m. OK C++17 (GCC 7-32) TESTS 32 61 0
271327247 freakin23 D July 19, 2024, 5:33 a.m. OK C++17 (GCC 7-32) TESTS 32 61 8089600
271327911 lemalin D July 19, 2024, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271325010 wink D July 19, 2024, 5:07 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271324761 liuwenke D July 19, 2024, 5:04 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271322935 FellingRain D July 19, 2024, 4:41 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271320664 NotDWT D July 19, 2024, 4:12 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271317233 sharaf_makahleh D July 19, 2024, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271315405 FakeDuck D July 19, 2024, 3:21 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271312983 HHU_fl D July 19, 2024, 2:57 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271311332 anhphant D July 19, 2024, 2:41 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271310288 abbcc__1 D July 19, 2024, 2:30 a.m. OK C++20 (GCC 13-64) TESTS 32 46 0
271319087 ArminArlert69 D July 19, 2024, 3:55 a.m. OK GNU C11 TESTS 32 61 102400
271298546 rainboy D July 18, 2024, 11:40 p.m. OK GNU C11 TESTS 32 77 102400
271276276 susvant D July 18, 2024, 6:25 p.m. OK Java 21 TESTS 32 311 1433600
271286639 Sudip809 D July 18, 2024, 8:18 p.m. OK Java 21 TESTS 32 312 1024000
271314515 Zhanzhe_Lee D July 19, 2024, 3:11 a.m. OK Java 21 TESTS 32 343 819200
271263221 tushar19280 D July 18, 2024, 4:33 p.m. OK Java 21 TESTS 32 515 47308800
271279960 dzhi D July 18, 2024, 7:02 p.m. OK Java 21 TESTS 32 1781 251904000
271287527 om172 D July 18, 2024, 8:30 p.m. OK Java 8 TESTS 32 171 0
271278936 __runknowna__ D July 18, 2024, 6:51 p.m. OK Java 8 TESTS 32 171 39219200
271257703 BlizGale D July 18, 2024, 4:19 p.m. OK Java 8 TESTS 32 187 0
271309286 Yousef_Badr D July 19, 2024, 2:20 a.m. OK Java 8 TESTS 32 202 0
271281778 Sumitsingh7 D July 18, 2024, 7:21 p.m. OK Java 8 TESTS 32 202 6553600
271278993 CipherSphinx_Raj D July 18, 2024, 6:52 p.m. OK Java 8 TESTS 32 202 39219200
271272406 faresbadr316 D July 18, 2024, 5:53 p.m. OK Java 8 TESTS 32 249 0
271255812 RockStar_14 D July 18, 2024, 4:14 p.m. OK Java 8 TESTS 32 312 0
271262246 Eslam_Ahmed D July 18, 2024, 4:31 p.m. OK Java 8 TESTS 32 765 147660800
271262033 chinesedfan D July 18, 2024, 4:30 p.m. OK Node.js TESTS 32 124 3788800
271313762 Shisuko D July 19, 2024, 3:04 a.m. OK PyPy 3 TESTS 32 265 9625600
271291241 RobinFromTheHood D July 18, 2024, 9:18 p.m. OK PyPy 3-64 TESTS 32 124 3788800
271270784 Synaptic_Savant D July 18, 2024, 5:42 p.m. OK PyPy 3-64 TESTS 32 140 4198400
271294232 alexwice D July 18, 2024, 10:07 p.m. OK PyPy 3-64 TESTS 32 140 4608000
271291139 souviksarkar2k3 D July 18, 2024, 9:17 p.m. OK PyPy 3-64 TESTS 32 155 5017600
271277768 phungthienphuoc D July 18, 2024, 6:39 p.m. OK PyPy 3-64 TESTS 32 171 4915200
271303034 spaceybread0 D July 19, 2024, 1:04 a.m. OK PyPy 3-64 TESTS 32 171 5017600
271291457 edugong D July 18, 2024, 9:21 p.m. OK PyPy 3-64 TESTS 32 171 5632000
271274185 sushmanth.dampur8780 D July 18, 2024, 6:07 p.m. OK PyPy 3-64 TESTS 32 171 5939200
271310689 BeBeBe66666 D July 19, 2024, 2:35 a.m. OK PyPy 3-64 TESTS 32 186 5222400
271290990 Mr_Surfer D July 18, 2024, 9:14 p.m. OK PyPy 3-64 TESTS 32 186 9318400
271308216 pennymagic156 D July 19, 2024, 2:07 a.m. OK Python 3 TESTS 32 499 204800
271260271 explainingnotes D July 18, 2024, 4:26 p.m. OK Python 3 TESTS 32 1249 409600
271310642 Dynamic_Pigeon D July 19, 2024, 2:34 a.m. OK Rust 2021 TESTS 32 61 0
271273391 SnowballSH D July 18, 2024, 6 p.m. OK Rust 2021 TESTS 32 77 0
271258760 liut D July 18, 2024, 4:22 p.m. OK Rust 2021 TESTS 32 374 0

remove filters

Back to search problems