Codeforces Round 857 (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
1802 Codeforces Round 857 (Div. 2) FINISHED False 10800 53468699 March 9, 2023, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15934 ) A Likes PROGRAMMING greedy implementation

B"Nikita recently held a very controversial round, after which his contribution changed very quickly. The announcement hung on the main page for n seconds. In the i th second |a_i| th person either liked or removed the like (Nikita was lucky in this task and there are no dislikes). If a_i > 0 , then the a_i th person put a like. If a_i < 0 , then the person -a_i removed the like. Each person put and removed the like no more than once. A person could not remove a like if he had not put it before. Since Nikita's contribution became very bad after the round, he wanted to analyze how his contribution changed while the announcement was on the main page. He turned to the creator of the platform with a request to give him the sequence a_1, a_2, ldots, a_n . But due to the imperfection of the platform, the sequence a was shuffled. You are given a shuffled sequence of a that describes user activity. You need to tell for each moment from 1 to n what the maximum and minimum number of likes could be on the post at that moment. The first line of input data contains one number t ( 1 <= qslant t <= qslant 1000 ) -- the number of test cases. In the first line of test case, one number is given n ( 1 <= qslant n <= qslant 100 ) -- the number of seconds during which Nikita's announcement hung on the main page. The next line contains n numbers b_1, b_2, b_3, ldots, b_n ( 1 <= qslant |b_i| <= qslant n ) -- mixed array a . It is guaranteed that there exists such a permutation of b that it is a correct sequence of events described in the condition. It is guaranteed that the sum of n for all input test cases does not exceed 10^4 . For each test case, output two lines, each of which contains n numbers. In the first line, for each test case, output the maximum number of likes that Nikita could have at the announcement at the i th second. In the s"...

Tutorials

Codeforces Round #857 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
196725967 chopin123 A March 10, 2023, 12:35 a.m. OK C# 10 TESTS 11 77 1331200
196681288 Fingolfin__ A March 9, 2023, 3:40 p.m. OK Clang++20 Diagnostics TESTS 11 31 0
196714038 NenadDapic A March 9, 2023, 8:36 p.m. OK FPC TESTS 11 62 0
196686752 asishbharadwajc A March 9, 2023, 4:24 p.m. OK GNU C11 TESTS 11 78 0
196707015 Neel_174 A March 9, 2023, 7:13 p.m. OK GNU C11 TESTS 11 78 0
196706947 Ansh_Shah_ A March 9, 2023, 7:12 p.m. OK GNU C11 TESTS 11 93 0
196692053 _M7s3c7 A March 9, 2023, 5:06 p.m. OK GNU C11 TESTS 11 93 0
196650286 deku_1 A March 9, 2023, 12:10 p.m. OK GNU C11 TESTS 11 93 0
196655921 c0derro A March 9, 2023, 12:27 p.m. OK GNU C11 TESTS 11 93 0
196668310 Smallorange A March 9, 2023, 2:04 p.m. OK GNU C11 TESTS 11 93 0
196686549 SP2003 A March 9, 2023, 4:22 p.m. OK GNU C11 TESTS 11 93 0
196649071 ritika.sharma.met21 A March 9, 2023, 12:07 p.m. OK GNU C11 TESTS 11 108 0
196679877 gandour A March 9, 2023, 3:22 p.m. OK GNU C11 TESTS 11 109 0
196739216 akshit5638 A March 10, 2023, 5:17 a.m. OK GNU C++14 TESTS 11 15 0
196742300 Martysss A March 10, 2023, 5:53 a.m. OK GNU C++14 TESTS 11 15 0
196742230 Sarthak_Dengre A March 10, 2023, 5:53 a.m. OK GNU C++14 TESTS 11 15 0
196740875 _wh A March 10, 2023, 5:35 a.m. OK GNU C++14 TESTS 11 15 0
196739428 rushil21_ A March 10, 2023, 5:20 a.m. OK GNU C++14 TESTS 11 15 0
196738490 kuailededatong A March 10, 2023, 5:07 a.m. OK GNU C++14 TESTS 11 15 0
196736355 wust-zzl A March 10, 2023, 4:31 a.m. OK GNU C++14 TESTS 11 15 0
196732981 xzr1729 A March 10, 2023, 3:27 a.m. OK GNU C++14 TESTS 11 15 0
196731580 zac2010 A March 10, 2023, 2:57 a.m. OK GNU C++14 TESTS 11 15 0
196730417 Anduril66 A March 10, 2023, 2:29 a.m. OK GNU C++14 TESTS 11 15 0
196733641 Saadblaze456 A March 10, 2023, 3:41 a.m. OK GNU C++17 TESTS 11 15 0
196735234 maple A March 10, 2023, 4:13 a.m. OK GNU C++17 TESTS 11 15 0
196736234 hello_its_me_ A March 10, 2023, 4:29 a.m. OK GNU C++17 TESTS 11 15 0
196737915 OneLeftShiftTwo A March 10, 2023, 4:58 a.m. OK GNU C++17 TESTS 11 15 0
196738472 Sumit_Monpara A March 10, 2023, 5:06 a.m. OK GNU C++17 TESTS 11 15 0
196739188 tranxuantruong A March 10, 2023, 5:17 a.m. OK GNU C++17 TESTS 11 15 0
196741864 Aryan0Barsaiyan A March 10, 2023, 5:48 a.m. OK GNU C++17 TESTS 11 15 0
196741949 mostafakh A March 10, 2023, 5:49 a.m. OK GNU C++17 TESTS 11 15 0
196741973 unnati_dutt A March 10, 2023, 5:49 a.m. OK GNU C++17 TESTS 11 15 0
196742029 jahirul A March 10, 2023, 5:50 a.m. OK GNU C++17 TESTS 11 15 0
196712377 os-moussao A March 9, 2023, 8:14 p.m. OK GNU C++17 (64) TESTS 11 0 0
196675815 YocyCraft A March 9, 2023, 2:52 p.m. OK GNU C++17 (64) TESTS 11 0 819200
196725665 PCC A March 10, 2023, 12:26 a.m. OK GNU C++17 (64) TESTS 11 15 0
196721446 romanmg12 A March 9, 2023, 10:34 p.m. OK GNU C++17 (64) TESTS 11 15 0
196717528 GILGAMESH A March 9, 2023, 9:26 p.m. OK GNU C++17 (64) TESTS 11 15 0
196705603 HDN8022 A March 9, 2023, 6:59 p.m. OK GNU C++17 (64) TESTS 11 15 0
196705499 Chaitanya1231 A March 9, 2023, 6:58 p.m. OK GNU C++17 (64) TESTS 11 15 0
196704777 Soumyo_Halder A March 9, 2023, 6:51 p.m. OK GNU C++17 (64) TESTS 11 15 0
196731676 xkcdjerry A March 10, 2023, 2:59 a.m. OK GNU C++17 (64) TESTS 11 15 0
196700669 shock_wav3 A March 9, 2023, 6:15 p.m. OK GNU C++17 (64) TESTS 11 15 0
196706104 arpandesai0 A March 9, 2023, 7:04 p.m. OK GNU C++20 (64) TESTS 11 0 0
196742951 tiger_34 A March 10, 2023, 6:01 a.m. OK GNU C++20 (64) TESTS 11 0 0
196739615 GusFring A March 10, 2023, 5:23 a.m. OK GNU C++20 (64) TESTS 11 0 0
196738213 nirjhorJU A March 10, 2023, 5:02 a.m. OK GNU C++20 (64) TESTS 11 0 0
196733119 PotremZ A March 10, 2023, 3:30 a.m. OK GNU C++20 (64) TESTS 11 0 0
196731675 Asuka12312 A March 10, 2023, 2:59 a.m. OK GNU C++20 (64) TESTS 11 0 0
196714294 kashyapv727 A March 9, 2023, 8:39 p.m. OK GNU C++20 (64) TESTS 11 0 0
196712624 achvanov A March 9, 2023, 8:18 p.m. OK GNU C++20 (64) TESTS 11 0 0
196706854 qwerty2300730 A March 9, 2023, 7:11 p.m. OK GNU C++20 (64) TESTS 11 0 0
196698637 lalakanheyalal.ray A March 9, 2023, 5:58 p.m. OK GNU C++20 (64) TESTS 11 0 0
196716336 Totum A March 9, 2023, 9:06 p.m. OK Haskell TESTS 11 46 0
196678408 aamir_1102 A March 9, 2023, 3:11 p.m. OK Java 11 TESTS 11 187 0
196671166 profchi A March 9, 2023, 2:21 p.m. OK Java 11 TESTS 11 187 0
196667157 bharathiraj A March 9, 2023, 1:58 p.m. OK Java 11 TESTS 11 187 0
196713467 Hinnawi24 A March 9, 2023, 8:29 p.m. OK Java 11 TESTS 11 202 0
196664397 Pranav_Sharda A March 9, 2023, 1:44 p.m. OK Java 11 TESTS 11 202 0
196705314 shoryakmr2719 A March 9, 2023, 6:56 p.m. OK Java 11 TESTS 11 233 0
196702095 Ankita1129 A March 9, 2023, 6:27 p.m. OK Java 11 TESTS 11 264 0
196663552 leoncn A March 9, 2023, 1:26 p.m. OK Java 11 TESTS 11 264 0
196725988 Jackyjuman A March 10, 2023, 12:35 a.m. OK Java 11 TESTS 11 265 0
196692159 Vaibhav_Rajpal A March 9, 2023, 5:07 p.m. OK Java 11 TESTS 11 280 0
196666794 Eslam_Ahmed A March 9, 2023, 1:56 p.m. OK Java 17 TESTS 11 186 204800
196684410 utkarsh3112 A March 9, 2023, 4:05 p.m. OK Java 17 TESTS 11 217 307200
196666851 vismay__yerunkar A March 9, 2023, 1:56 p.m. OK Java 17 TESTS 11 264 307200
196683196 manish47 A March 9, 2023, 3:56 p.m. OK Java 17 TESTS 11 280 204800
196697048 Abdelrahman.M.3 A March 9, 2023, 5:45 p.m. OK Java 17 TESTS 11 280 614400
196651097 priyanshu.sharma2612 A March 9, 2023, 12:13 p.m. OK Java 17 TESTS 11 296 409600
196652810 Primel A March 9, 2023, 12:18 p.m. OK Java 17 TESTS 11 311 204800
196683484 Vinay_Jain A March 9, 2023, 3:58 p.m. OK Java 17 TESTS 11 327 1024000
196656632 sdhasif A March 9, 2023, 12:29 p.m. OK Java 17 TESTS 11 343 204800
196646872 Thiain A March 9, 2023, noon OK Java 17 TESTS 11 358 0
196730908 megaspazz A March 10, 2023, 2:40 a.m. OK Java 8 TESTS 11 93 0
196701544 IanISam A March 9, 2023, 6:22 p.m. OK Java 8 TESTS 11 108 0
196727983 oneafter A March 10, 2023, 1:29 a.m. OK Java 8 TESTS 11 109 0
196741229 vkukretiwork A March 10, 2023, 5:39 a.m. OK Java 8 TESTS 11 109 0
196721516 -crazy_coder- A March 9, 2023, 10:36 p.m. OK Java 8 TESTS 11 109 0
196680098 ahmedTarek28 A March 9, 2023, 3:24 p.m. OK Java 8 TESTS 11 109 0
196670266 NerfThis A March 9, 2023, 2:15 p.m. OK Java 8 TESTS 11 109 0
196664689 raj_shahh A March 9, 2023, 1:46 p.m. OK Java 8 TESTS 11 109 0
196663571 ankit_0207 A March 9, 2023, 1:26 p.m. OK Java 8 TESTS 11 109 0
196738847 tejasS-27 A March 10, 2023, 5:12 a.m. OK Java 8 TESTS 11 124 0
196710435 endless_code A March 9, 2023, 7:51 p.m. OK Kotlin 1.7 TESTS 11 373 4812800
196694653 Mhmd_Bakr A March 9, 2023, 5:26 p.m. OK Mono C# TESTS 11 124 1536000
196658718 Alexstein058 A March 9, 2023, 12:34 p.m. OK MS C++ 2017 TESTS 11 31 0
196651925 FriendlyFire_1 A March 9, 2023, 12:15 p.m. OK MS C++ 2017 TESTS 11 31 0
196651345 Renat315 A March 9, 2023, 12:14 p.m. OK MS C++ 2017 TESTS 11 31 0
196650894 Volyna A March 9, 2023, 12:12 p.m. OK MS C++ 2017 TESTS 11 31 0
196679471 TRR A March 9, 2023, 3:19 p.m. OK MS C++ 2017 TESTS 11 31 0
196648807 Tojer A March 9, 2023, 12:06 p.m. OK MS C++ 2017 TESTS 11 46 0
196718341 _Bosonto_ A March 9, 2023, 9:38 p.m. OK MS C++ 2017 TESTS 11 46 0
196694561 danpfei02 A March 9, 2023, 5:25 p.m. OK Ocaml TESTS 11 31 0
196672950 Roni404 A March 9, 2023, 2:33 p.m. OK PyPy 3 TESTS 11 187 6246400
196672598 Roni404 A March 9, 2023, 2:31 p.m. OK PyPy 3 TESTS 11 202 6656000
196683529 Yash_Nandwana A March 9, 2023, 3:58 p.m. OK PyPy 3 TESTS 11 218 7065600
196719666 Golden9 aruniscoding A March 9, 2023, 9:59 p.m. OK PyPy 3 TESTS 11 234 6144000
196742476 Void.exe A March 10, 2023, 5:56 a.m. OK PyPy 3 TESTS 11 249 8192000
196724648 bpdolson A March 9, 2023, 11:56 p.m. OK PyPy 3 TESTS 11 280 9523200
196670435 MdAshrafuzzaman_Sunny02 A March 9, 2023, 2:16 p.m. OK PyPy 3-64 TESTS 11 93 5017600
196732850 MdAshrafuzzaman_Sunny02 A March 10, 2023, 3:24 a.m. OK PyPy 3-64 TESTS 11 93 5120000
196732828 MdAshrafuzzaman_Sunny02 A March 10, 2023, 3:24 a.m. OK PyPy 3-64 TESTS 11 108 8396800
196712190 RobinFromTheHood A March 9, 2023, 8:12 p.m. OK PyPy 3-64 TESTS 11 109 7987200
196668920 Ana_naS A March 9, 2023, 2:08 p.m. OK PyPy 3-64 TESTS 11 109 8294400
196697989 titia A March 9, 2023, 5:53 p.m. OK PyPy 3-64 TESTS 11 109 8806400
196686466 Nipun_Jugran A March 9, 2023, 4:22 p.m. OK PyPy 3-64 TESTS 11 124 8192000
196720062 gardengnome A March 9, 2023, 10:06 p.m. OK PyPy 3-64 TESTS 11 124 8294400
196731624 Youarenotgood A March 10, 2023, 2:58 a.m. OK PyPy 3-64 TESTS 11 124 9318400
196729029 voicon A March 10, 2023, 1:55 a.m. OK PyPy 3-64 TESTS 11 139 8192000
196733181 phlai326 A March 10, 2023, 3:31 a.m. OK Python 3 TESTS 11 61 0
196720245 kvnyu A March 9, 2023, 10:10 p.m. OK Python 3 TESTS 11 61 0
196693161 Ismail03 A March 9, 2023, 5:14 p.m. OK Python 3 TESTS 11 62 0
196684914 Block_Cipher A March 9, 2023, 4:09 p.m. OK Python 3 TESTS 11 62 0
196681518 wladomar1964 A March 9, 2023, 3:43 p.m. OK Python 3 TESTS 11 62 0
196678971 wladomar1964 A March 9, 2023, 3:15 p.m. OK Python 3 TESTS 11 62 0
196676446 yatq A March 9, 2023, 2:56 p.m. OK Python 3 TESTS 11 62 0
196675689 Ysb04 A March 9, 2023, 2:51 p.m. OK Python 3 TESTS 11 62 0
196650913 Arshat_parvaes23 A March 9, 2023, 12:12 p.m. OK Python 3 TESTS 11 62 0
196655891 tutsogly A March 9, 2023, 12:27 p.m. OK Python 3 TESTS 11 62 102400

remove filters

Back to search problems