Codeforces Round 906 (Div. 1)

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
1889 Codeforces Round 906 (Div. 1) FINISHED False 9000 33319499 Oct. 28, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7468 ) B Doremy's Connecting Plan PROGRAMMING greedy sortings

B'Doremy lives in a country consisting of n cities numbered from 1 to n , with a_i people living in the i -th city. It can be modeled as an undirected graph with n nodes. Initially, there are no edges in the graph. Now Doremy wants to make the graph connected. To do this, she can add an edge between i and j if sum_{k in S} a_k ge i cdot j cdot c, where S is the set of all the nodes that are currently in the same connected component of either i or j , and c is a given constant. Can Doremy make the graph connected? Two nodes (i, j) are in the same connected component if there exists a path from i to j . A graph is connected if all its nodes are in the same connected component. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line contains two integers n , c ( 2 <= n <= 2 cdot 10^5 , 1 <= c <= 10^6 ) -- the number of nodes and the constant. The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 0 <= a_i <= 10^{12} ) -- the number of people living in the i -th city. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print "YES" (without quotes), if it is possible to make the graph connected, and "NO" (without quotes) otherwise. You can print letters in any case (upper or lower). In the first test case, Doremy can add edges in the following order: In the second test case, Doremy can add edge (1,2) because a_1 + a_2 =2 ge 1 cdot 2 cdot 1 . After that, the graph is connected. In the third test case, Doremy can add edges in the order (5,4) , (5,3) , (5,2) and (5,1) . In the fourth test case, Doremy cannot add any edge at all. '...

Tutorials

Codeforces Round 906 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
230218821 mban259 B Oct. 28, 2023, 3:24 p.m. OK C# 10 TESTS 36 187 36864000
230217288 KumaTachiRen B Oct. 28, 2023, 3:21 p.m. OK C# 8 TESTS 36 124 4608000
230206302 hos.lyric B Oct. 28, 2023, 3:04 p.m. OK D TESTS 36 78 23961600
230236505 Gassa B Oct. 28, 2023, 3:58 p.m. OK D TESTS 36 187 20787200
230215503 chro4896 B Oct. 28, 2023, 3:18 p.m. OK GNU C11 TESTS 36 109 4812800
230223649 Misha100896 B Oct. 28, 2023, 3:32 p.m. OK GNU C++14 TESTS 36 77 3174400
230298244 KN200711 B Oct. 29, 2023, 12:58 a.m. OK GNU C++14 TESTS 36 77 3174400
230222818 Leasier B Oct. 28, 2023, 3:31 p.m. OK GNU C++14 TESTS 36 78 2355200
230242123 zhouyuheng2009 B Oct. 28, 2023, 4:11 p.m. OK GNU C++14 TESTS 36 78 3174400
230297733 zltzlt B Oct. 29, 2023, 12:41 a.m. OK GNU C++14 TESTS 36 78 3174400
230208206 jason_sun B Oct. 28, 2023, 3:07 p.m. OK GNU C++14 TESTS 36 78 4812800
230202479 rfpermen B Oct. 28, 2023, 2:59 p.m. OK GNU C++14 TESTS 36 78 7987200
230269602 Striker009 B Oct. 28, 2023, 5:55 p.m. OK GNU C++14 TESTS 36 78 16281600
230199310 crazy_sea B Oct. 28, 2023, 2:55 p.m. OK GNU C++14 TESTS 36 78 20070400
230213170 -2x9_21- B Oct. 28, 2023, 3:14 p.m. OK GNU C++14 TESTS 36 93 2457600
230220418 Ayanami_desu B Oct. 28, 2023, 3:26 p.m. OK GNU C++17 TESTS 36 46 13209600
230230975 InfernoSloth B Oct. 28, 2023, 3:47 p.m. OK GNU C++17 TESTS 36 77 1638400
230266383 Edu175 B Oct. 28, 2023, 5:38 p.m. OK GNU C++17 TESTS 36 77 1638400
230225261 Arnob B Oct. 28, 2023, 3:35 p.m. OK GNU C++17 TESTS 36 77 1945600
230293862 Andyvanh1 B Oct. 28, 2023, 10:25 p.m. OK GNU C++17 TESTS 36 77 3584000
230282902 CepryH9 B Oct. 28, 2023, 7:44 p.m. OK GNU C++17 TESTS 36 78 2457600
230224548 Onjo B Oct. 28, 2023, 3:34 p.m. OK GNU C++17 TESTS 36 78 3174400
230223914 Nson B Oct. 28, 2023, 3:33 p.m. OK GNU C++17 TESTS 36 78 3174400
230286180 ninQ1703 B Oct. 28, 2023, 8:22 p.m. OK GNU C++17 TESTS 36 78 3174400
230212380 myst-6 B Oct. 28, 2023, 3:13 p.m. OK GNU C++17 TESTS 36 78 4812800
230226296 zyxoi B Oct. 28, 2023, 3:37 p.m. OK GNU C++17 (64) TESTS 36 31 1638400
230202670 QAQAutoMaton B Oct. 28, 2023, 2:59 p.m. OK GNU C++17 (64) TESTS 36 31 9011200
230227428 HCPS42 B Oct. 28, 2023, 3:39 p.m. OK GNU C++17 (64) TESTS 36 46 1638400
230216022 Xellos B Oct. 28, 2023, 3:19 p.m. OK GNU C++17 (64) TESTS 36 46 1638400
230214183 ethening B Oct. 28, 2023, 3:16 p.m. OK GNU C++17 (64) TESTS 36 46 3174400
230300916 prairie2022 B Oct. 29, 2023, 2:09 a.m. OK GNU C++17 (64) TESTS 36 46 3174400
230219311 YeongTree B Oct. 28, 2023, 3:25 p.m. OK GNU C++17 (64) TESTS 36 46 3993600
230205014 kotatsugame B Oct. 28, 2023, 3:02 p.m. OK GNU C++17 (64) TESTS 36 46 4198400
230199117 Dawnq B Oct. 28, 2023, 2:55 p.m. OK GNU C++17 (64) TESTS 36 46 4812800
230202283 zwh2008 B Oct. 28, 2023, 2:59 p.m. OK GNU C++17 (64) TESTS 36 46 4812800
230287166 bibikov1 B Oct. 28, 2023, 8:34 p.m. OK GNU C++20 (64) TESTS 36 31 1638400
230278280 Alfeh B Oct. 28, 2023, 7 p.m. OK GNU C++20 (64) TESTS 36 31 1638400
230212314 5sb B Oct. 28, 2023, 3:13 p.m. OK GNU C++20 (64) TESTS 36 31 2867200
230202551 20333333333 B Oct. 28, 2023, 2:59 p.m. OK GNU C++20 (64) TESTS 36 31 6860800
230228064 c1120231020 B Oct. 28, 2023, 3:41 p.m. OK GNU C++20 (64) TESTS 36 31 12083200
230266916 GusFring B Oct. 28, 2023, 5:40 p.m. OK GNU C++20 (64) TESTS 36 46 0
230309062 harshit7650 B Oct. 29, 2023, 4:28 a.m. OK GNU C++20 (64) TESTS 36 46 0
230278077 KilluaZolldyck B Oct. 28, 2023, 6:58 p.m. OK GNU C++20 (64) TESTS 36 46 1638400
230279249 J.Ahmed B Oct. 28, 2023, 7:09 p.m. OK GNU C++20 (64) TESTS 36 46 1638400
230266647 MattTheNub B Oct. 28, 2023, 5:39 p.m. OK GNU C++20 (64) TESTS 36 46 1638400
230245027 profchi B Oct. 28, 2023, 4:18 p.m. OK Java 11 TESTS 36 296 14131200
230215228 taran_1407 B Oct. 28, 2023, 3:18 p.m. OK Java 11 TESTS 36 421 16179200
230229451 TCchen B Oct. 28, 2023, 3:44 p.m. OK Java 11 TESTS 36 483 8806400
230271722 golions B Oct. 28, 2023, 6:09 p.m. OK Java 8 TESTS 36 155 10649600
230210408 SecondThread B Oct. 28, 2023, 3:10 p.m. OK Java 8 TESTS 36 280 67891200
230201690 FastFreeTask B Oct. 28, 2023, 2:58 p.m. OK Kotlin 1.6 TESTS 36 311 0
230245226 Tlatoani B Oct. 28, 2023, 4:19 p.m. OK Kotlin 1.6 TESTS 36 483 25088000
230227259 plevande B Oct. 28, 2023, 3:39 p.m. OK PyPy 3 TESTS 36 248 29491200
230219919 tamato B Oct. 28, 2023, 3:26 p.m. OK PyPy 3 TESTS 36 764 38604800
230212454 titia B Oct. 28, 2023, 3:13 p.m. OK PyPy 3-64 TESTS 36 171 29491200
230217112 little_young B Oct. 28, 2023, 3:21 p.m. OK PyPy 3-64 TESTS 36 233 39219200
230280524 Alex239 B Oct. 28, 2023, 7:21 p.m. OK PyPy 3-64 TESTS 36 249 29184000
230195495 toam B Oct. 28, 2023, 2:51 p.m. OK PyPy 3-64 TESTS 36 265 32563200
230206035 whatshisbucket B Oct. 28, 2023, 3:04 p.m. OK PyPy 3-64 TESTS 36 280 28467200
230220687 Kalyano B Oct. 28, 2023, 3:27 p.m. OK PyPy 3-64 TESTS 36 280 34508800
230275211 -14 B Oct. 28, 2023, 6:34 p.m. OK PyPy 3-64 TESTS 36 295 25395200
230203658 alxwen711 B Oct. 28, 2023, 3 p.m. OK PyPy 3-64 TESTS 36 295 28467200
230218667 petamingks B Oct. 28, 2023, 3:24 p.m. OK PyPy 3-64 TESTS 36 295 36966400
230268519 Super_Misha B Oct. 28, 2023, 5:49 p.m. OK PyPy 3-64 TESTS 36 311 33382400
230256641 WaterColor2037 B Oct. 28, 2023, 4:49 p.m. OK Rust 2021 TESTS 36 139 10854400
230209231 sansen B Oct. 28, 2023, 3:08 p.m. OK Rust 2021 TESTS 36 139 19456000

remove filters

Back to search problems