Codeforces Round 797 (Div. 3)

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
1690 Codeforces Round 797 (Div. 3) FINISHED False 8100 82653863 June 7, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3497 ) G Count the Trains PROGRAMMING binary search data structures sortings 2000

B'There are n of independent carriages on the rails. The carriages are numbered from left to right from 1 to n . The carriages are not connected to each other. The carriages move to the left, so that the carriage with number 1 moves ahead of all of them. The i -th carriage has its own engine, which can accelerate the carriage to a_i km/h, but the carriage cannot go faster than the carriage in front of it. See example for explanation. All carriages start moving to the left at the same time, and they naturally form trains. We will call trains -- consecutive moving carriages having the same speed. For example, we have n=5 carriages and array a = [10, 13, 5, 2, 6] . Then the final speeds of the carriages will be [10, 10, 5, 2, 2] . Respectively, 3 of the train will be formed. There are also messages saying that some engine has been corrupted: Messages arrive sequentially, the processing of the next message takes into account the changes from all previous messages. After each message determine the number of formed trains. The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) --the number of input test cases. This is followed by descriptions of the test cases. The first line of each test case is empty. The second line of the test case contains two integers n and m ( 1 <= n,m <= 10^5 ) --the number of carriages and the number of messages to slow down the carriage, respectively. The third line contains n integers: a_1, a_2, ... , a_n ( 0 <= a_i <= 10^9 ) -- the number a_i means that the carriage with number i can reach a speed of a_i km/h. The next m lines contain two integers k_j and d_j ( 1 <= k_j <= n , 0 <= d_j <= a_{k_j} ) --this is the message that the speed of the carriage with number k_j has decreased by d_j . In other words, there has been a change in its maximum'...

Tutorials

Codeforces Round #797 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
159927989 Kzos_017 G June 8, 2022, 10:53 a.m. OK GNU C++14 TESTS 157 61 9728000 2000
159954827 HaPpY1213 G June 8, 2022, 4:11 p.m. OK GNU C++14 TESTS 157 108 3788800 2000
159985520 ZSH1H G June 9, 2022, 4:35 a.m. OK GNU C++14 TESTS 157 109 3788800 2000
159909159 _jsgnt G June 8, 2022, 7:05 a.m. OK GNU C++14 TESTS 157 109 3788800 2000
159972515 lockdown G June 8, 2022, 8:52 p.m. OK GNU C++14 TESTS 157 124 3788800 2000
159943275 Arnob G June 8, 2022, 1:45 p.m. OK GNU C++14 TESTS 157 124 3891200 2000
159936695 Justforyourself G June 8, 2022, 12:31 p.m. OK GNU C++14 TESTS 157 124 3993600 2000
159958820 vsriram1012 G June 8, 2022, 5:05 p.m. OK GNU C++14 TESTS 157 124 4096000 2000
159989543 lkjhgfertyul G June 9, 2022, 5:53 a.m. OK GNU C++14 TESTS 157 124 4198400 2000
159988913 Sadid_005 G June 9, 2022, 5:43 a.m. OK GNU C++14 TESTS 157 124 4198400 2000
159906064 e3c8f1a924 G June 8, 2022, 6:31 a.m. OK GNU C++17 TESTS 157 31 14438400 2000
159925532 Abdelmohaymn G June 8, 2022, 10:24 a.m. OK GNU C++17 TESTS 157 108 3891200 2000
159922322 AIYY G June 8, 2022, 9:47 a.m. OK GNU C++17 TESTS 157 109 3891200 2000
159911516 paxaq G June 8, 2022, 7:33 a.m. OK GNU C++17 TESTS 157 109 4198400 2000
159953000 PrafulSinghal G June 8, 2022, 3:48 p.m. OK GNU C++17 TESTS 157 109 5017600 2000
159928780 propane G June 8, 2022, 11:03 a.m. OK GNU C++17 TESTS 157 109 14540800 2000
159976907 patient G June 8, 2022, 11:46 p.m. OK GNU C++17 TESTS 157 124 3788800 2000
159972991 bugdone G June 8, 2022, 9:07 p.m. OK GNU C++17 TESTS 157 124 3788800 2000
159956136 original_name153 G June 8, 2022, 4:29 p.m. OK GNU C++17 TESTS 157 124 3788800 2000
159954591 lniiwuw_y G June 8, 2022, 4:08 p.m. OK GNU C++17 TESTS 157 124 3788800 2000
159948536 e3c8f1a924 G June 8, 2022, 2:48 p.m. OK GNU C++17 (64) TESTS 157 31 14438400 2000
159908304 Freedom__King G June 8, 2022, 6:56 a.m. OK GNU C++17 (64) TESTS 157 46 11468800 2000
159987875 OTTFF G June 9, 2022, 5:24 a.m. OK GNU C++17 (64) TESTS 157 77 5324800 2000
159948427 houghstc G June 8, 2022, 2:47 p.m. OK GNU C++17 (64) TESTS 157 78 5324800 2000
159985201 sugmedic G June 9, 2022, 4:27 a.m. OK GNU C++17 (64) TESTS 157 93 5324800 2000
159983026 sgly33 G June 9, 2022, 3:30 a.m. OK GNU C++17 (64) TESTS 157 93 5324800 2000
159973957 Maram G June 8, 2022, 9:36 p.m. OK GNU C++17 (64) TESTS 157 93 5324800 2000
159914859 joker_pisces G June 8, 2022, 8:27 a.m. OK GNU C++17 (64) TESTS 157 93 5324800 2000
159919881 Hanasaki G June 8, 2022, 9:20 a.m. OK GNU C++17 (64) TESTS 157 93 5734400 2000
159907543 shadownb G June 8, 2022, 6:47 a.m. OK GNU C++17 (64) TESTS 157 93 5734400 2000
159933303 VenomInVein G June 8, 2022, 11:52 a.m. OK GNU C++20 (64) TESTS 157 62 2457600 2000
159932629 VenomInVein G June 8, 2022, 11:46 a.m. OK GNU C++20 (64) TESTS 157 62 2457600 2000
159976132 RockSnow G June 8, 2022, 11:06 p.m. OK GNU C++20 (64) TESTS 157 77 5324800 2000
159920389 yukito8069 G June 8, 2022, 9:25 a.m. OK GNU C++20 (64) TESTS 157 77 5324800 2000
159940600 Bananana. G June 8, 2022, 1:15 p.m. OK GNU C++20 (64) TESTS 157 78 2457600 2000
159986379 abc3 G June 9, 2022, 4:55 a.m. OK GNU C++20 (64) TESTS 157 78 5324800 2000
159986320 abc3 G June 9, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 157 78 5324800 2000
159975250 F1zik G June 8, 2022, 10:25 p.m. OK GNU C++20 (64) TESTS 157 78 5324800 2000
159961098 Leokkk17 G June 8, 2022, 5:33 p.m. OK GNU C++20 (64) TESTS 157 78 5324800 2000
159949848 Restarted_lghhh G June 8, 2022, 3:06 p.m. OK GNU C++20 (64) TESTS 157 78 5324800 2000
159977672 jiomart G June 9, 2022, 12:24 a.m. OK Java 11 TESTS 157 311 0 2000
159970427 dunkingdonuts G June 8, 2022, 8 p.m. OK Java 11 TESTS 157 312 0 2000
159959437 NO__OB G June 8, 2022, 5:12 p.m. OK Java 11 TESTS 157 389 3481600 2000
159928993 eshan18.09 G June 8, 2022, 11:05 a.m. OK Java 11 TESTS 157 421 5836800 2000
159979962 JunBinLiang G June 9, 2022, 1:55 a.m. OK Java 8 TESTS 157 327 7168000 2000
159964010 LeoPro G June 8, 2022, 6:11 p.m. OK Kotlin 1.5 TESTS 157 514 4915200 2000
159946350 YMSeah G June 8, 2022, 2:19 p.m. OK PyPy 3 TESTS 157 451 17612800 2000
159915312 SophieHatter G June 8, 2022, 8:31 a.m. OK PyPy 3-64 TESTS 157 577 37785600 2000
159917070 SophieHatter G June 8, 2022, 8:51 a.m. OK PyPy 3-64 TESTS 157 607 39936000 2000
159923082 abhijeet.panihar.cse20 G June 8, 2022, 9:55 a.m. OK PyPy 3-64 TESTS 157 717 23244800 2000
159922770 tryharda G June 8, 2022, 9:52 a.m. OK PyPy 3-64 TESTS 157 717 23244800 2000
159943870 SoleProprietor G June 8, 2022, 1:51 p.m. OK PyPy 3-64 TESTS 157 1029 17408000 2000
159921939 aayush_chhabra G June 8, 2022, 9:43 a.m. OK PyPy 3-64 TESTS 157 1856 40038400 2000
159909914 hxu10 G June 8, 2022, 7:14 a.m. OK Python 3 TESTS 157 1918 17510400 2000
159906184 xuhao95 G June 8, 2022, 6:32 a.m. OK Python 3 TESTS 157 1918 17510400 2000
159919983 robostac G June 8, 2022, 9:21 a.m. OK Rust 2021 TESTS 157 78 10752000 2000

remove filters

Back to search problems