Codeforces Round 782 (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
1659 Codeforces Round 782 (Div. 2) FINISHED False 8100 81617099 April 17, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4039 ) D Reverse Sort Sum PROGRAMMING constructive algorithms data structures greedy implementation math two pointers

B"Suppose you had an array A of n elements, each of which is 0 or 1 . Let us define a function f(k,A) which returns another array B , the result of sorting the first k elements of A in non-decreasing order. For example, f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0] . Note that the first 4 elements were sorted. Now consider the arrays B_1, B_2, ldots, B_n generated by f(1,A), f(2,A), ldots,f(n,A) . Let C be the array obtained by taking the element-wise sum of B_1, B_2, ldots, B_n . For example, let A=[0,1,0,1] . Then we have B_1=[0,1,0,1] , B_2=[0,1,0,1] , B_3=[0,0,1,1] , B_4=[0,0,1,1] . Then C=B_1+B_2+B_3+B_4=[0,1,0,1]+[0,1,0,1]+[0,0,1,1]+[0,0,1,1]=[0,2,2,4] . You are given C . Determine a binary array A that would give C when processed as above. It is guaranteed that an array A exists for given C in the input. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Each test case has two lines. The first line contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ). The second line contains n integers c_1, c_2, ldots, c_n ( 0 <= q c_i <= q n ). It is guaranteed that a valid array A exists for the given C . The sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single line containing n integers a_1, a_2, ldots, a_n ( a_i is 0 or 1 ). If there are multiple answers, you may output any of them. Here's the explanation for the first test case. Given that A=[1,1,0,1] , we can construct each B_i : "...

Tutorials

Codeforces Round #782 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
153923943 Clock_Paradox D April 17, 2022, 3:52 p.m. OK FPC TESTS 49 624 4812800
153934064 ztfgsxdgyt D April 17, 2022, 4:31 p.m. OK GNU C11 TESTS 49 46 2048000
153927586 rainboy D April 17, 2022, 4:05 p.m. OK GNU C11 TESTS 49 810 1024000
153929262 Winterfrost D April 17, 2022, 4:11 p.m. OK GNU C++14 TESTS 49 30 4198400
153941617 omeganot D April 17, 2022, 5:37 p.m. OK GNU C++14 TESTS 49 62 1638400
153934020 antguz D April 17, 2022, 4:31 p.m. OK GNU C++14 TESTS 49 62 1638400
153933092 hidgxia D April 17, 2022, 4:27 p.m. OK GNU C++14 TESTS 49 62 1638400
153929961 shitmaster D April 17, 2022, 4:14 p.m. OK GNU C++14 TESTS 49 62 1638400
153964815 Altopc D April 18, 2022, 3:35 a.m. OK GNU C++14 TESTS 49 62 1638400
153932410 CoachDanke D April 17, 2022, 4:24 p.m. OK GNU C++14 TESTS 49 62 2355200
153942038 Becky D April 17, 2022, 5:43 p.m. OK GNU C++14 TESTS 49 62 2457600
153948212 t_bb1 D April 17, 2022, 7:29 p.m. OK GNU C++14 TESTS 49 62 2457600
153969459 suzhen D April 18, 2022, 5:13 a.m. OK GNU C++14 TESTS 49 62 2457600
153951547 niyuzheNO1 D April 17, 2022, 8:39 p.m. OK GNU C++17 TESTS 49 31 8499200
153926754 PineapplesOnPizza D April 17, 2022, 4:02 p.m. OK GNU C++17 TESTS 49 61 1638400
153944350 original_name153 D April 17, 2022, 6:17 p.m. OK GNU C++17 TESTS 49 62 819200
153968131 Khushboo_13 D April 18, 2022, 4:48 a.m. OK GNU C++17 TESTS 49 62 1638400
153942427 mohamedeltair D April 17, 2022, 5:48 p.m. OK GNU C++17 TESTS 49 62 1638400
153941719 lxyb D April 17, 2022, 5:39 p.m. OK GNU C++17 TESTS 49 62 1638400
153941599 lxyb D April 17, 2022, 5:37 p.m. OK GNU C++17 TESTS 49 62 1638400
153940428 _dlbm17 D April 17, 2022, 5:24 p.m. OK GNU C++17 TESTS 49 62 1638400
153953657 Apiram D April 17, 2022, 9:28 p.m. OK GNU C++17 TESTS 49 62 1638400
153957933 lDust D April 17, 2022, 11:50 p.m. OK GNU C++17 TESTS 49 62 1638400
153929564 Mofashaoye3 D April 17, 2022, 4:12 p.m. OK GNU C++17 (64) TESTS 49 31 5222400
153925711 MOPKOBKA228 D April 17, 2022, 3:58 p.m. OK GNU C++17 (64) TESTS 49 46 1638400
153968878 retiredd D April 18, 2022, 5:01 a.m. OK GNU C++17 (64) TESTS 49 46 1638400
153947699 CodigoL D April 17, 2022, 7:19 p.m. OK GNU C++17 (64) TESTS 49 46 1638400
153933021 BERNARB.01 D April 17, 2022, 4:26 p.m. OK GNU C++17 (64) TESTS 49 46 1638400
153930621 Lucina D April 17, 2022, 4:17 p.m. OK GNU C++17 (64) TESTS 49 46 2355200
153937022 thiago_bastos D April 17, 2022, 4:44 p.m. OK GNU C++17 (64) TESTS 49 46 2457600
153959162 Pepsi__Cola D April 18, 2022, 12:38 a.m. OK GNU C++17 (64) TESTS 49 46 2457600
153967475 bunny1024 D April 18, 2022, 4:37 a.m. OK GNU C++17 (64) TESTS 49 46 3174400
153940029 GouenjiShuuya D April 17, 2022, 5:21 p.m. OK GNU C++17 (64) TESTS 49 46 3174400
153954238 thenromanov D April 17, 2022, 9:44 p.m. OK GNU C++20 (64) TESTS 49 31 1638400
153933254 08150442 D April 17, 2022, 4:27 p.m. OK GNU C++20 (64) TESTS 49 31 4812800
153940099 AlexLorintz D April 17, 2022, 5:21 p.m. OK GNU C++20 (64) TESTS 49 46 204800
153926450 Adam_GS D April 17, 2022, 4:01 p.m. OK GNU C++20 (64) TESTS 49 46 819200
153924532 bachbeo2007 D April 17, 2022, 3:54 p.m. OK GNU C++20 (64) TESTS 49 46 819200
153969866 DreadArceus D April 18, 2022, 5:20 a.m. OK GNU C++20 (64) TESTS 49 46 1638400
153971897 j.w D April 18, 2022, 6:01 a.m. OK GNU C++20 (64) TESTS 49 46 1638400
153970113 apoorv_me D April 18, 2022, 5:25 a.m. OK GNU C++20 (64) TESTS 49 46 1638400
153969972 DreadArceus D April 18, 2022, 5:23 a.m. OK GNU C++20 (64) TESTS 49 46 1638400
153968951 Rinors D April 18, 2022, 5:02 a.m. OK GNU C++20 (64) TESTS 49 46 1638400
153965850 koqo D April 18, 2022, 4:03 a.m. OK Go TESTS 49 140 3174400
153955227 mbfeci D April 17, 2022, 10:14 p.m. OK Java 11 TESTS 49 233 0
153925183 AndreySiunov D April 17, 2022, 3:56 p.m. OK Java 11 TESTS 49 265 0
153930460 near_or D April 17, 2022, 4:16 p.m. OK Java 11 TESTS 49 265 307200
153930889 __Serendipity D April 17, 2022, 4:17 p.m. OK Java 11 TESTS 49 265 1740800
153927434 warks D April 17, 2022, 4:04 p.m. OK Java 11 TESTS 49 280 5222400
153960641 LongWalk D April 18, 2022, 1:33 a.m. OK Java 11 TESTS 49 280 11161600
153961488 UlaanBatat D April 18, 2022, 2 a.m. OK Java 11 TESTS 49 405 0
153946657 profchi D April 17, 2022, 6:58 p.m. OK Java 11 TESTS 49 421 0
153934441 dzhi D April 17, 2022, 4:32 p.m. OK Java 11 TESTS 49 451 3993600
153949337 for.toobye321 D April 17, 2022, 7:52 p.m. OK Java 11 TESTS 49 467 204800
153932703 jonsnow7 D April 17, 2022, 4:25 p.m. OK Java 8 TESTS 49 124 0
153962379 ChenHuaXin D April 18, 2022, 2:29 a.m. OK Java 8 TESTS 49 155 2764800
153940997 priyaroy3370 D April 17, 2022, 5:30 p.m. OK Java 8 TESTS 49 155 11059200
153932340 adi_7861 D April 17, 2022, 4:23 p.m. OK Java 8 TESTS 49 187 2355200
153935831 kkkkush D April 17, 2022, 4:39 p.m. OK Java 8 TESTS 49 187 3072000
153940201 MagentaCobra D April 17, 2022, 5:22 p.m. OK Java 8 TESTS 49 202 3276800
153937252 DylanSmith D April 17, 2022, 4:45 p.m. OK Java 8 TESTS 49 218 2867200
153929227 iakovlev.zakhar D April 17, 2022, 4:11 p.m. OK Java 8 TESTS 49 280 37376000
153968313 ttolkku D April 18, 2022, 4:51 a.m. OK Java 8 TESTS 49 343 0
153924615 DumplingLife D April 17, 2022, 3:54 p.m. OK Java 8 TESTS 49 373 2867200
153923953 arvindf232 D April 17, 2022, 3:52 p.m. OK Kotlin 1.4 TESTS 49 560 1331200
153938148 afix D April 17, 2022, 4:48 p.m. OK MS C++ 2017 TESTS 49 155 1638400
153940137 De_nis D April 17, 2022, 5:21 p.m. OK MS C++ 2017 TESTS 49 171 1740800
153962724 dogoeswoof D April 18, 2022, 2:39 a.m. OK MS C++ 2017 TESTS 49 234 1638400
153962657 dogoeswoof D April 18, 2022, 2:37 a.m. OK MS C++ 2017 TESTS 49 249 1638400
153937913 MaksimLogic D April 17, 2022, 4:47 p.m. OK MS C++ 2017 TESTS 49 249 2457600
153929135 KseniaShk D April 17, 2022, 4:11 p.m. OK MS C++ 2017 TESTS 49 249 3174400
153925448 salyg1n D April 17, 2022, 3:57 p.m. OK MS C++ 2017 TESTS 49 249 6451200
153942941 Dybulina_Anna D April 17, 2022, 5:55 p.m. OK MS C++ 2017 TESTS 49 265 1740800
153930735 yeko0990 D April 17, 2022, 4:17 p.m. OK MS C++ 2017 TESTS 49 265 3174400
153929140 acorn11 D April 17, 2022, 4:11 p.m. OK PyPy 2 TESTS 49 156 16384000
153941197 1_2_3_4_5_9 D April 17, 2022, 5:32 p.m. OK PyPy 2 TESTS 49 217 15462400
153927891 14_15_16 D April 17, 2022, 4:06 p.m. OK PyPy 2 TESTS 49 217 15462400
153933109 ruimina D April 17, 2022, 4:27 p.m. OK PyPy 3 TESTS 49 186 18227200
153945128 random__person D April 17, 2022, 6:30 p.m. OK PyPy 3 TESTS 49 187 23859200
153929317 misorin D April 17, 2022, 4:11 p.m. OK PyPy 3 TESTS 49 202 24985600
153936536 jano31415 D April 17, 2022, 4:42 p.m. OK PyPy 3 TESTS 49 249 19558400
153936778 _deva_ D April 17, 2022, 4:43 p.m. OK PyPy 3 TESTS 49 295 26316800
153931071 coder_sounak D April 17, 2022, 4:18 p.m. OK PyPy 3 TESTS 49 296 25088000
153927962 eepsilon D April 17, 2022, 4:06 p.m. OK PyPy 3 TESTS 49 312 18636800
153924872 kostieE D April 17, 2022, 3:55 p.m. OK PyPy 3 TESTS 49 374 23449600
153933923 mouryasatyam D April 17, 2022, 4:30 p.m. OK PyPy 3 TESTS 49 436 23654400
153932526 Amiy_Tiwari D April 17, 2022, 4:24 p.m. OK PyPy 3 TESTS 49 452 26419200
153940802 shobonvip D April 17, 2022, 5:28 p.m. OK PyPy 3-64 TESTS 49 140 29286400
153941224 hritik3878 D April 17, 2022, 5:33 p.m. OK PyPy 3-64 TESTS 49 171 29696000
153968994 nicku123 D April 18, 2022, 5:03 a.m. OK PyPy 3-64 TESTS 49 233 33996800
153926665 xxh1999 D April 17, 2022, 4:01 p.m. OK PyPy 3-64 TESTS 49 296 25600000
153941518 turkids D April 17, 2022, 5:36 p.m. OK PyPy 3-64 TESTS 49 296 29081600
153925007 t0mmyn D April 17, 2022, 3:55 p.m. OK PyPy 3-64 TESTS 49 311 28569600
153934076 wolfram_ D April 17, 2022, 4:31 p.m. OK PyPy 3-64 TESTS 49 327 28979200
153938155 kritarth21 D April 17, 2022, 4:48 p.m. OK PyPy 3-64 TESTS 49 342 31846400
153937424 r57shell D April 17, 2022, 4:45 p.m. OK PyPy 3-64 TESTS 49 373 26828800
153943166 alex391a D April 17, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 49 374 27340800
153940678 r57shell D April 17, 2022, 5:26 p.m. OK Python 3 TESTS 49 436 13926400
153933589 koder_786 D April 17, 2022, 4:29 p.m. OK Python 3 TESTS 49 514 13926400
153930545 clause D April 17, 2022, 4:16 p.m. OK Rust 2021 TESTS 49 93 4812800

remove filters

Back to search problems