Codeforces Round 854 by cybercats (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
1799 Codeforces Round 854 by cybercats (Div. 1 + Div. 2) FINISHED False 10800 54314699 Feb. 27, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11636 ) A Recent Actions PROGRAMMING data structures greedy implementation math

B'On Codeforces the "Recent Actions" field shows the last n posts with recent actions. Initially, there are posts 1, 2, ldots, n in the field (this is in order from top to down). Also there are infinitely many posts not in the field, numbered with integers n + 1, n + 2, ldots . When recent action happens in the post p : You know, that the next m recent actions will happen in the posts p_1, p_2, ldots, p_m ( n + 1 <= q p_i <= q n + m ) in the moments of time 1, 2, ldots, m . Note, that recent actions only happen with posts with numbers geq n + 1 . For each post i ( 1 <= q i <= q n ), find the first time it will be removed from the "Recent Actions" field or say, that it won 't be removed. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Descriptions of test cases follow. The first line of each test case contains two integers n , m ( 1 <= q n, m <= q 5 cdot 10^4 ) -- the size of the "Recent Actions" field and the number of actions. The next line contains m integers p_1, p_2, ldots, p_m ( n + 1 <= q p_i <= q n + m ). It is guaranteed, that the sum of n and the sum of m for all test cases does not exceed 5 cdot 10^4 . For each test case print n integers t_1, t_2, ldots, t_n , where t_i=-1 if the post i won 't be removed or t_i equals to the first moment of time the post i will be removed ( 1 <= q t_i <= q m ). In the first test case, the only post 1 will be removed at the moment 1 and replaced by the post 2 . In the second test case the "Recent Actions" field will be (given an order from top to down): Post number 1 won 't be removed. In the third test case the "Recent Actions" field will be (given an order from top to down): Post number 1 won 't be removed. '...

Tutorials

Codeforces Round #854 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
195176184 chopin123 A Feb. 27, 2023, 4:34 p.m. OK C# 10 TESTS 23 202 7884800
195197627 Hadeel_Althbiti A Feb. 27, 2023, 6:42 p.m. OK Clang++17 Diagnostics TESTS 23 857 4403200
195202484 salo7aa A Feb. 27, 2023, 7:34 p.m. OK Clang++20 Diagnostics TESTS 23 530 15257600
195204672 NenadDapic A Feb. 27, 2023, 8:01 p.m. OK FPC TESTS 23 156 819200
195200251 asm_rayhan A Feb. 27, 2023, 7:09 p.m. OK GNU C11 TESTS 23 234 614400
195200967 iffatul_anon A Feb. 27, 2023, 7:17 p.m. OK GNU C11 TESTS 23 343 614400
195197728 my_alt_69 A Feb. 27, 2023, 6:43 p.m. OK GNU C11 TESTS 23 452 2764800
195181173 _DRIN_ A Feb. 27, 2023, 4:56 p.m. OK GNU C11 TESTS 23 639 409600
195200632 iffatul_anon A Feb. 27, 2023, 7:13 p.m. OK GNU C11 TESTS 23 748 2252800
195182305 Prashant_ksy A Feb. 27, 2023, 5:02 p.m. OK GNU C11 TESTS 23 857 409600
195208272 MooNaz A Feb. 27, 2023, 8:50 p.m. OK GNU C11 TESTS 23 920 614400
195186203 Ismail03 A Feb. 27, 2023, 5:20 p.m. OK GNU C11 TESTS 23 967 614400
195220742 M4verick A Feb. 28, 2023, 1:45 a.m. OK GNU C++14 TESTS 24 31 204800
195195600 cot-in A Feb. 27, 2023, 6:24 p.m. OK GNU C++14 TESTS 23 31 204800
195194590 Splashing A Feb. 27, 2023, 6:16 p.m. OK GNU C++14 TESTS 23 31 307200
195218804 yimuhua A Feb. 28, 2023, 12:44 a.m. OK GNU C++14 TESTS 24 31 512000
195218812 vjudge1 A Feb. 28, 2023, 12:44 a.m. OK GNU C++14 TESTS 24 31 512000
195223465 zixiangcode A Feb. 28, 2023, 2:58 a.m. OK GNU C++14 TESTS 24 31 614400
195220862 PlayerGuan A Feb. 28, 2023, 1:49 a.m. OK GNU C++14 TESTS 24 31 614400
195230563 JoesSR A Feb. 28, 2023, 5:13 a.m. OK GNU C++14 TESTS 24 31 819200
195230421 2021040313 A Feb. 28, 2023, 5:11 a.m. OK GNU C++14 TESTS 24 31 921600
195220252 nixnehc A Feb. 28, 2023, 1:31 a.m. OK GNU C++14 TESTS 24 31 1331200
195228199 osama_bq A Feb. 28, 2023, 4:32 a.m. OK GNU C++17 TESTS 24 31 204800
195181585 limbo16 A Feb. 27, 2023, 4:58 p.m. OK GNU C++17 TESTS 23 31 204800
195177374 yongdori A Feb. 27, 2023, 4:39 p.m. OK GNU C++17 TESTS 23 31 307200
195219893 technodumb A Feb. 28, 2023, 1:20 a.m. OK GNU C++17 TESTS 24 31 409600
195208819 LucaLucaM A Feb. 27, 2023, 8:58 p.m. OK GNU C++17 TESTS 23 31 409600
195192997 adelian A Feb. 27, 2023, 6:06 p.m. OK GNU C++17 TESTS 23 31 409600
195220061 Joanh_Lan A Feb. 28, 2023, 1:25 a.m. OK GNU C++17 TESTS 24 31 512000
195231247 _skb_ A Feb. 28, 2023, 5:25 a.m. OK GNU C++17 TESTS 24 31 614400
195229842 TaylorFly A Feb. 28, 2023, 5:02 a.m. OK GNU C++17 TESTS 24 31 614400
195226959 EduardoBrito A Feb. 28, 2023, 4:07 a.m. OK GNU C++17 TESTS 24 31 614400
195173825 xiaoyiru A Feb. 27, 2023, 4:24 p.m. OK GNU C++17 (64) TESTS 23 30 614400
195218870 drdilyor A Feb. 28, 2023, 12:46 a.m. OK GNU C++17 (64) TESTS 24 30 2867200
195208720 PurpleCrayon A Feb. 27, 2023, 8:56 p.m. OK GNU C++17 (64) TESTS 23 31 409600
195194281 0_Shipul_1 A Feb. 27, 2023, 6:14 p.m. OK GNU C++17 (64) TESTS 23 31 614400
195223875 wa_wa_vegetable A Feb. 28, 2023, 3:06 a.m. OK GNU C++17 (64) TESTS 24 31 614400
195224612 Serendipity_lyy A Feb. 28, 2023, 3:23 a.m. OK GNU C++17 (64) TESTS 24 31 819200
195218570 lqx2005 A Feb. 28, 2023, 12:37 a.m. OK GNU C++17 (64) TESTS 24 31 819200
195195321 N_z__ A Feb. 27, 2023, 6:22 p.m. OK GNU C++17 (64) TESTS 23 31 819200
195215041 hopsfb A Feb. 27, 2023, 10:53 p.m. OK GNU C++17 (64) TESTS 23 31 2662400
195227797 ikuyo_kita A Feb. 28, 2023, 4:23 a.m. OK GNU C++17 (64) TESTS 24 31 2867200
195226563 Daybreak7 A Feb. 28, 2023, 3:59 a.m. OK GNU C++20 (64) TESTS 24 15 409600
195216867 batyousef A Feb. 27, 2023, 11:44 p.m. OK GNU C++20 (64) TESTS 23 15 2662400
195230411 ss.001.cai A Feb. 28, 2023, 5:11 a.m. OK GNU C++20 (64) TESTS 24 30 409600
195225031 tlsdydaud1 A Feb. 28, 2023, 3:31 a.m. OK GNU C++20 (64) TESTS 24 30 614400
195216095 luogu_bot1 A Feb. 27, 2023, 11:22 p.m. OK GNU C++20 (64) TESTS 23 30 11878400
195232614 Rinors A Feb. 28, 2023, 5:50 a.m. OK GNU C++20 (64) TESTS 24 31 204800
195198958 UnknownPlanet A Feb. 27, 2023, 6:55 p.m. OK GNU C++20 (64) TESTS 23 31 204800
195198897 UnknownPlanet A Feb. 27, 2023, 6:54 p.m. OK GNU C++20 (64) TESTS 23 31 204800
195199112 UnknownPlanet A Feb. 27, 2023, 6:57 p.m. OK GNU C++20 (64) TESTS 23 31 204800
195215920 ScarletS A Feb. 27, 2023, 11:17 p.m. OK GNU C++20 (64) TESTS 23 31 204800
195228372 dhruvil_8803 A Feb. 28, 2023, 4:35 a.m. OK Java 11 TESTS 24 202 0
195227343 ok.surazz A Feb. 28, 2023, 4:14 a.m. OK Java 11 TESTS 24 248 5632000
195231630 tanish_1131 A Feb. 28, 2023, 5:32 a.m. OK Java 11 TESTS 24 389 0
195217466 sarafnavneet2 A Feb. 28, 2023, 12:03 a.m. OK Java 11 TESTS 24 405 0
195196402 anikethend1234 A Feb. 27, 2023, 6:31 p.m. OK Java 11 TESTS 23 420 5324800
195232124 achal5623 A Feb. 28, 2023, 5:41 a.m. OK Java 11 TESTS 24 467 0
195195761 dilshar23 A Feb. 27, 2023, 6:25 p.m. OK Java 11 TESTS 23 514 0
195198052 sarvesh_bawari A Feb. 27, 2023, 6:46 p.m. OK Java 17 TESTS 23 233 716800
195173125 koolkartik A Feb. 27, 2023, 4:22 p.m. OK Java 17 TESTS 23 311 307200
195195904 not_just_rr A Feb. 27, 2023, 6:26 p.m. OK Java 17 TESTS 23 327 4812800
195196420 vikash_45 A Feb. 27, 2023, 6:31 p.m. OK Java 17 TESTS 23 374 307200
195174142 balajireddy.cf A Feb. 27, 2023, 4:26 p.m. OK Java 17 TESTS 23 420 3276800
195172087 mishra316x A Feb. 27, 2023, 4:18 p.m. OK Java 17 TESTS 23 420 4812800
195199694 AdityaGupta19 A Feb. 27, 2023, 7:02 p.m. OK Java 17 TESTS 23 514 1024000
195197293 shabashoff A Feb. 27, 2023, 6:39 p.m. OK Java 17 TESTS 23 530 1024000
195172786 hky12 A Feb. 27, 2023, 4:20 p.m. OK Java 17 TESTS 23 545 819200
195188196 AlcorRoss A Feb. 27, 2023, 5:28 p.m. OK Java 17 TESTS 23 561 512000
195197033 megaspazz A Feb. 27, 2023, 6:37 p.m. OK Java 8 TESTS 23 124 0
195229286 parth_13_ A Feb. 28, 2023, 4:53 a.m. OK Java 8 TESTS 24 124 0
195197839 megaspazz A Feb. 27, 2023, 6:44 p.m. OK Java 8 TESTS 23 124 0
195229350 dhruvil_8803 A Feb. 28, 2023, 4:54 a.m. OK Java 8 TESTS 24 140 0
195226942 FeehamSzYr A Feb. 28, 2023, 4:07 a.m. OK Java 8 TESTS 24 155 0
195198827 dogranmol A Feb. 27, 2023, 6:54 p.m. OK Java 8 TESTS 23 155 2048000
195221004 -crazy_coder- A Feb. 28, 2023, 1:54 a.m. OK Java 8 TESTS 24 171 10342400
195221150 -crazy_coder- A Feb. 28, 2023, 1:58 a.m. OK Java 8 TESTS 24 187 11673600
195194153 Koka A Feb. 27, 2023, 6:13 p.m. OK Java 8 TESTS 23 202 5632000
195194197 SadTommy A Feb. 27, 2023, 6:14 p.m. OK Java 8 TESTS 23 296 0
195204164 maxK99 A Feb. 27, 2023, 7:54 p.m. OK MS C++ 2017 TESTS 23 78 1945600
195200587 rajharshsingh2003 A Feb. 27, 2023, 7:12 p.m. OK MS C++ 2017 TESTS 23 93 819200
195183130 Satyr_ A Feb. 27, 2023, 5:05 p.m. OK MS C++ 2017 TESTS 23 93 2457600
195176764 spanish_god A Feb. 27, 2023, 4:37 p.m. OK MS C++ 2017 TESTS 23 108 1843200
195228113 beksultanomirzak.2001 A Feb. 28, 2023, 4:30 a.m. OK Node.js TESTS 24 234 10342400
195231965 ankitesh A Feb. 28, 2023, 5:38 a.m. OK PyPy 3 TESTS 24 171 9932800
195196409 AadiS A Feb. 27, 2023, 6:31 p.m. OK PyPy 3 TESTS 23 217 9728000
195185718 Xzh0u A Feb. 27, 2023, 5:18 p.m. OK PyPy 3 TESTS 23 264 11878400
195196368 KeiTsukishima A Feb. 27, 2023, 6:31 p.m. OK PyPy 3 TESTS 23 327 16793600
195231724 yxu18yxu18 A Feb. 28, 2023, 5:34 a.m. OK PyPy 3 TESTS 24 374 9728000
195218362 bpdolson A Feb. 28, 2023, 12:31 a.m. OK PyPy 3 TESTS 24 452 9830400
195213888 kavorka A Feb. 27, 2023, 10:26 p.m. OK PyPy 3-64 TESTS 23 93 11059200
195213902 kavorka A Feb. 27, 2023, 10:27 p.m. OK PyPy 3-64 TESTS 23 109 10956800
195213871 kavorka A Feb. 27, 2023, 10:26 p.m. OK PyPy 3-64 TESTS 23 109 11059200
195202311 SophieHatter A Feb. 27, 2023, 7:32 p.m. OK PyPy 3-64 TESTS 23 124 9932800
195213858 kavorka A Feb. 27, 2023, 10:26 p.m. OK PyPy 3-64 TESTS 23 139 10956800
195226152 CinaDor A Feb. 28, 2023, 3:49 a.m. OK PyPy 3-64 TESTS 24 140 9932800
195201012 zouyu9631 A Feb. 27, 2023, 7:17 p.m. OK PyPy 3-64 TESTS 23 140 10137600
195223857 Yansou A Feb. 28, 2023, 3:06 a.m. OK PyPy 3-64 TESTS 24 140 11571200
195195517 kavorka A Feb. 27, 2023, 6:23 p.m. OK PyPy 3-64 TESTS 23 140 11776000
195194282 anuj_negi A Feb. 27, 2023, 6:14 p.m. OK PyPy 3-64 TESTS 23 140 13107200
195211424 Omar_Ashraf_Fathy A Feb. 27, 2023, 9:40 p.m. OK Python 3 TESTS 23 109 6144000
195224800 DawnMagnet A Feb. 28, 2023, 3:27 a.m. OK Python 3 TESTS 24 186 6758400
195181572 Roudivich A Feb. 27, 2023, 4:58 p.m. OK Python 3 TESTS 23 187 3276800
195172419 jae0821 A Feb. 27, 2023, 4:19 p.m. OK Python 3 TESTS 23 187 5427200
195221120 odinluca A Feb. 28, 2023, 1:57 a.m. OK Python 3 TESTS 24 202 4505600
195219481 PartinGQAQ A Feb. 28, 2023, 1:06 a.m. OK Python 3 TESTS 24 202 5222400
195172960 2000080188 A Feb. 27, 2023, 4:21 p.m. OK Python 3 TESTS 23 202 7987200
195211451 Sovi_11 A Feb. 27, 2023, 9:40 p.m. OK Python 3 TESTS 23 217 3686400
195197012 2392008643 A Feb. 27, 2023, 6:36 p.m. OK Python 3 TESTS 23 217 3686400
195197190 Rasel A Feb. 27, 2023, 6:38 p.m. OK Python 3 TESTS 23 218 5222400
195221043 cperkkk A Feb. 28, 2023, 1:55 a.m. OK Rust 2021 TESTS 24 108 2764800
195173368 nithyabhagam A Feb. 27, 2023, 4:23 p.m. OK Rust 2021 TESTS 23 139 1843200

remove filters

Back to search problems