Codeforces Round 783 (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
1668 Codeforces Round 783 (Div. 2) FINISHED False 7200 81444299 April 19, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16769 ) B Social Distance PROGRAMMING greedy math sortings 900

B' m chairs are arranged in a circle sequentially. The chairs are numbered from 0 to m-1 . n people want to sit in these chairs. The i -th of them wants at least a[i] empty chairs both on his right and left side. More formally, if the i -th person sits in the j -th chair, then no one else should sit in the following chairs: (j-a[i]) bmod m , (j-a[i]+1) bmod m , ... (j+a[i]-1) bmod m , (j+a[i]) bmod m . Decide if it is possible to sit down for all of them, under the given limitations. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 5 cdot 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and m ( 2 <= q n <= q 10^5 , 1 <= q m <= q 10^9 ) -- the number of people and the number of chairs. The next line contains n integers, a_1 , a_2 , ... a_n ( 1 <= q a_i <= q 10^9 ) -- the minimum number of empty chairs, on both sides of the i -th person. It is guaranteed that the sum of n over all test cases will not exceed 10^5 . For each test case print "YES" (without quotes) if it is possible for everyone to sit down and fulfil the restrictions, and "NO" (without quotes) otherwise. You may print every letter in any case you want (so, for example, the strings "yEs", "yes", "Yes" and "YES" will all be recognized as positive answers). Test case 1 : n>m , so they can not sit down. Test case 2 : the first person can sit 2 -nd and the second person can sit in the 0 -th chair. Both of them want at least 1 empty chair on both sides, chairs 1 and 3 are free, so this is a good solution. Test case 3 : if the second person sits down somewhere, he needs 2 empty chairs, both on his right and on his left side, so it is impossible to find a place for the fi'...

Tutorials

Codeforces Round #783 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154585057 rajeshsr B April 22, 2022, 5:52 p.m. OK Clang++17 Diagnostics TESTS 52 109 409600 900
154155138 smeey B April 20, 2022, 1:15 a.m. OK Clang++17 Diagnostics TESTS 52 873 8294400 900
154818359 Pendem B April 24, 2022, 7 a.m. OK Clang++17 Diagnostics TESTS 52 889 819200 900
154691266 swapnil_s_s B April 23, 2022, 1:31 p.m. OK Clang++17 Diagnostics TESTS 52 1060 0 900
154224056 SadiaAfrinAnika B April 20, 2022, 6:49 p.m. OK Clang++17 Diagnostics TESTS 52 1123 8294400 900
154144978 k4m1k4ze B April 19, 2022, 8:34 p.m. OK GNU C11 TESTS 52 46 0 900
154895191 byte_of_u B April 24, 2022, 11:03 p.m. OK GNU C11 TESTS 52 218 409600 900
154214454 roamer B April 20, 2022, 4:15 p.m. OK GNU C11 TESTS 52 218 409600 900
154214750 roamer B April 20, 2022, 4:20 p.m. OK GNU C11 TESTS 52 218 409600 900
154215110 roamer B April 20, 2022, 4:24 p.m. OK GNU C11 TESTS 52 218 409600 900
154215385 roamer B April 20, 2022, 4:29 p.m. OK GNU C11 TESTS 52 218 409600 900
154169548 Sarwar82 B April 20, 2022, 6:03 a.m. OK GNU C11 TESTS 52 218 819200 900
154263002 chinawcp B April 21, 2022, 9:42 a.m. OK GNU C11 TESTS 52 218 1638400 900
154281982 Yash983 B April 21, 2022, 1:50 p.m. OK GNU C11 TESTS 52 233 1638400 900
154224078 bluetoothsfuneral B April 20, 2022, 6:50 p.m. OK GNU C11 TESTS 52 234 0 900
154212036 hnust_liangchen B April 20, 2022, 3:41 p.m. OK GNU C++14 TESTS 52 31 819200 900
154194566 jstzmxuan B April 20, 2022, 12:05 p.m. OK GNU C++14 TESTS 52 31 8192000 900
154194617 jstzmxuan KaTeX B April 20, 2022, 12:06 p.m. OK GNU C++14 TESTS 52 31 8192000 900
154258564 yungchi B April 21, 2022, 8:34 a.m. OK GNU C++14 TESTS 52 46 0 900
154540043 Noriel B April 22, 2022, 3:14 p.m. OK GNU C++14 TESTS 52 46 0 900
154149083 amis_v B April 19, 2022, 10:08 p.m. OK GNU C++14 TESTS 52 46 0 900
154152557 XG0000 B April 20, 2022, 12:01 a.m. OK GNU C++14 TESTS 52 46 0 900
154213285 ushmita B April 20, 2022, 3:59 p.m. OK GNU C++14 TESTS 52 46 0 900
154817522 bkifhr8 B April 24, 2022, 6:50 a.m. OK GNU C++14 TESTS 52 46 409600 900
154895292 Andwerp B April 24, 2022, 11:06 p.m. OK GNU C++14 TESTS 52 46 409600 900
154158401 NIU_MA B April 20, 2022, 2:40 a.m. OK GNU C++17 TESTS 52 31 5836800 900
154474446 93.kunal B April 22, 2022, 7:53 a.m. OK GNU C++17 TESTS 52 46 0 900
154247254 luicosas B April 21, 2022, 4:55 a.m. OK GNU C++17 TESTS 52 46 0 900
154219674 ak5113165 B April 20, 2022, 5:38 p.m. OK GNU C++17 TESTS 52 46 0 900
154214584 vaibhaviroy B April 20, 2022, 4:17 p.m. OK GNU C++17 TESTS 52 46 0 900
154207804 harsh.loomba B April 20, 2022, 2:42 p.m. OK GNU C++17 TESTS 52 46 0 900
154170601 medeshi.kristian B April 20, 2022, 6:19 a.m. OK GNU C++17 TESTS 52 46 0 900
154156187 kobeforces B April 20, 2022, 1:43 a.m. OK GNU C++17 TESTS 52 46 0 900
154276412 Kit-Cat B April 21, 2022, 12:46 p.m. OK GNU C++17 TESTS 52 46 0 900
154792053 t4rmo B April 23, 2022, 9:49 p.m. OK GNU C++17 TESTS 52 46 0 900
154484115 shirley_ B April 22, 2022, 10:01 a.m. OK GNU C++17 (64) TESTS 52 30 5017600 900
154169395 tm_professor20 B April 20, 2022, 6:01 a.m. OK GNU C++17 (64) TESTS 52 31 0 900
154165437 Dog_food_is_me B April 20, 2022, 4:54 a.m. OK GNU C++17 (64) TESTS 52 31 0 900
154792962 Timer_011 B April 23, 2022, 10:10 p.m. OK GNU C++17 (64) TESTS 52 31 204800 900
154427089 xprezzzboi B April 21, 2022, 5:45 p.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154185647 Kurama B April 20, 2022, 10:06 a.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154182811 hustler_123 B April 20, 2022, 9:24 a.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154176890 nitss9 B April 20, 2022, 7:56 a.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154157208 Time_JYF B April 20, 2022, 2:12 a.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154153755 -DanTheMan- B April 20, 2022, 12:37 a.m. OK GNU C++17 (64) TESTS 52 31 409600 900
154169824 luogu_bot4 B April 20, 2022, 6:07 a.m. OK GNU C++20 (64) TESTS 52 15 409600 900
154283778 the.one.liner B April 21, 2022, 1:56 p.m. OK GNU C++20 (64) TESTS 52 30 0 900
154196442 Skuyyyy B April 20, 2022, 12:28 p.m. OK GNU C++20 (64) TESTS 52 31 0 900
154208387 SanguineChameleon B April 20, 2022, 2:51 p.m. OK GNU C++20 (64) TESTS 52 31 0 900
154251011 SaiPrasad_27 B April 21, 2022, 6:19 a.m. OK GNU C++20 (64) TESTS 52 31 0 900
154253244 SaiPrasad_27 B April 21, 2022, 7:03 a.m. OK GNU C++20 (64) TESTS 52 31 0 900
154261625 atodo B April 21, 2022, 9:28 a.m. OK GNU C++20 (64) TESTS 52 31 0 900
154692121 Alokik_Roy B April 23, 2022, 1:41 p.m. OK GNU C++20 (64) TESTS 52 31 0 900
154860579 lightYGM B April 24, 2022, 2:09 p.m. OK GNU C++20 (64) TESTS 52 31 0 900
154191899 Pradumanji108 B April 20, 2022, 11:33 a.m. OK GNU C++20 (64) TESTS 52 31 0 900
154181923 xiaoru B April 20, 2022, 9:11 a.m. OK Go TESTS 52 280 4300800 900
154623161 sf14t B April 23, 2022, 6:19 a.m. OK Java 11 TESTS 52 202 0 900
154173997 rishabhpanchal B April 20, 2022, 7:10 a.m. OK Java 11 TESTS 52 202 0 900
154154464 the_unseen B April 20, 2022, 12:57 a.m. OK Java 11 TESTS 52 202 0 900
154153598 Tier33 B April 20, 2022, 12:33 a.m. OK Java 11 TESTS 52 202 0 900
154145461 mbfeci B April 19, 2022, 8:43 p.m. OK Java 11 TESTS 52 202 0 900
154144547 henrychenOutlook B April 19, 2022, 8:26 p.m. OK Java 11 TESTS 52 202 0 900
154906219 gaju321 B April 25, 2022, 5:32 a.m. OK Java 11 TESTS 52 217 0 900
154263854 _ryan18_ B April 21, 2022, 9:56 a.m. OK Java 11 TESTS 52 218 0 900
154200958 LongWalk B April 20, 2022, 1:20 p.m. OK Java 11 TESTS 52 218 0 900
154452309 Dhruv_Parsaniya B April 22, 2022, 1:54 a.m. OK Java 11 TESTS 52 218 0 900
154413526 harshitnsharma B April 21, 2022, 4:28 p.m. OK Java 8 TESTS 52 109 0 900
154418355 harshitnsharma B April 21, 2022, 4:36 p.m. OK Java 8 TESTS 52 124 0 900
154186496 ND_ B April 20, 2022, 10:18 a.m. OK Java 8 TESTS 52 124 0 900
154150828 headshot1703 B April 19, 2022, 11:01 p.m. OK Java 8 TESTS 52 124 0 900
154274307 Daly105 B April 21, 2022, 12:19 p.m. OK Java 8 TESTS 52 139 0 900
154229337 green_619 B April 20, 2022, 8:44 p.m. OK Java 8 TESTS 52 139 0 900
154450584 O_E B April 22, 2022, 1:13 a.m. OK Java 8 TESTS 52 140 0 900
154217015 gssakash B April 20, 2022, 4:56 p.m. OK Java 8 TESTS 52 140 0 900
154155161 amit_roy B April 20, 2022, 1:16 a.m. OK Java 8 TESTS 52 140 0 900
154153621 Degree_Qi B April 20, 2022, 12:33 a.m. OK Java 8 TESTS 52 140 0 900
154460058 MadinaN B April 22, 2022, 4:21 a.m. OK JavaScript TESTS 52 436 16896000 900
154567251 cfcfs B April 22, 2022, 4:11 p.m. OK Kotlin 1.6 TESTS 52 670 5427200 900
154205305 aslashkin2010 B April 20, 2022, 2:10 p.m. OK Mono C# TESTS 52 249 6656000 900
154257189 xuancx B April 21, 2022, 8:12 a.m. OK MS C++ 2017 TESTS 52 46 409600 900
154156388 deyilhou B April 20, 2022, 1:49 a.m. OK MS C++ 2017 TESTS 52 46 409600 900
154207546 Killer_No.47 B April 20, 2022, 2:39 p.m. OK MS C++ 2017 TESTS 52 46 819200 900
154256882 xuancx B April 21, 2022, 8:06 a.m. OK MS C++ 2017 TESTS 52 61 409600 900
154752403 Superlau B April 23, 2022, 3:55 p.m. OK MS C++ 2017 TESTS 52 62 409600 900
154156282 deyilhou B April 20, 2022, 1:46 a.m. OK MS C++ 2017 TESTS 52 62 819200 900
154200000 afix B April 20, 2022, 1:09 p.m. OK MS C++ 2017 TESTS 52 124 409600 900
154464322 Mr_Simple_TG B April 22, 2022, 5:45 a.m. OK MS C++ 2017 TESTS 52 124 819200 900
154605024 mnrmustafa B April 23, 2022, 12:10 a.m. OK MS C++ 2017 TESTS 52 139 819200 900
154855463 vjudge1 B April 24, 2022, 1:19 p.m. OK MS C++ 2017 TESTS 52 140 819200 900
154169655 XYShaoKang B April 20, 2022, 6:05 a.m. OK Node.js TESTS 52 498 13209600 900
154857491 ramanujanvs B April 24, 2022, 1:39 p.m. OK Node.js TESTS 52 530 26419200 900
154152460 hxu10 B April 19, 2022, 11:58 p.m. OK PyPy 3 TESTS 52 187 8806400 900
154252273 Code_100 B April 21, 2022, 6:44 a.m. OK PyPy 3 TESTS 52 202 8908800 900
154275825 dogydevstorage B April 21, 2022, 12:39 p.m. OK PyPy 3 TESTS 52 202 9523200 900
154169677 tahuruzzoha B April 20, 2022, 6:05 a.m. OK PyPy 3 TESTS 52 202 9625600 900
154223132 Andrei_Kuz B April 20, 2022, 6:33 p.m. OK PyPy 3 TESTS 52 218 8192000 900
154558679 whatshisbucket B April 22, 2022, 3:50 p.m. OK PyPy 3 TESTS 52 295 9523200 900
154263864 fiblonaria B April 21, 2022, 9:56 a.m. OK PyPy 3 TESTS 52 295 9625600 900
154744229 raggzy B April 23, 2022, 3:30 p.m. OK PyPy 3 TESTS 52 311 9523200 900
154250254 pmarecki B April 21, 2022, 6:04 a.m. OK PyPy 3 TESTS 52 311 9523200 900
154222468 grawlixes B April 20, 2022, 6:22 p.m. OK PyPy 3 TESTS 52 311 9625600 900
154497762 hkwu6013 B April 22, 2022, 12:41 p.m. OK PyPy 3-64 TESTS 52 140 13619200 900
154267530 rivnam B April 21, 2022, 10:39 a.m. OK PyPy 3-64 TESTS 52 155 13926400 900
154165933 152334H B April 20, 2022, 5:03 a.m. OK PyPy 3-64 TESTS 52 155 14336000 900
154271212 pratyanch_jain B April 21, 2022, 11:37 a.m. OK PyPy 3-64 TESTS 52 156 11264000 900
154181309 Het_Fadia B April 20, 2022, 9:02 a.m. OK PyPy 3-64 TESTS 52 171 11468800 900
154166997 notTehlka B April 20, 2022, 5:21 a.m. OK PyPy 3-64 TESTS 52 171 13926400 900
154151470 nealzane B April 19, 2022, 11:24 p.m. OK PyPy 3-64 TESTS 52 187 13824000 900
154393775 lemiao12 B April 21, 2022, 3:58 p.m. OK PyPy 3-64 TESTS 52 202 13926400 900
154223141 Andrei_Kuz B April 20, 2022, 6:33 p.m. OK PyPy 3-64 TESTS 52 217 14745600 900
154198219 Icedburger B April 20, 2022, 12:49 p.m. OK PyPy 3-64 TESTS 52 248 11673600 900
154424227 OLOGY B April 21, 2022, 5:16 p.m. OK Python 2 TESTS 52 233 7884800 900
154424503 OLOGY B April 21, 2022, 5:18 p.m. OK Python 2 TESTS 52 234 7884800 900
154247830 cherub8128 B April 21, 2022, 5:09 a.m. OK Python 3 TESTS 52 218 6451200 900
154649983 voicon B April 23, 2022, 11:21 a.m. OK Python 3 TESTS 52 296 6451200 900
154201774 grininja B April 20, 2022, 1:30 p.m. OK Python 3 TESTS 52 311 6451200 900
154163980 only_noob B April 20, 2022, 4:28 a.m. OK Python 3 TESTS 52 311 7065600 900
154252923 bunny_stew B April 21, 2022, 6:56 a.m. OK Python 3 TESTS 52 311 9420800 900
154223096 Andrei_Kuz B April 20, 2022, 6:32 p.m. OK Python 3 TESTS 52 312 5632000 900
154489710 woodsman B April 22, 2022, 11:18 a.m. OK Python 3 TESTS 52 561 6144000 900
154338760 krativarshney B April 21, 2022, 3:02 p.m. OK Python 3 TESTS 52 561 6144000 900
154173689 its_AK B April 20, 2022, 7:06 a.m. OK Python 3 TESTS 52 561 6144000 900
154459741 navidtajk B April 22, 2022, 4:15 a.m. OK Python 3 TESTS 52 576 6041600 900
154266840 robostac B April 21, 2022, 10:27 a.m. OK Rust 2021 TESTS 52 15 3174400 900
154601954 userCodeForces B April 22, 2022, 10:28 p.m. OK Rust 2021 TESTS 52 499 3174400 900

remove filters

Back to search problems