Good Bye 2019

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
1270 Good Bye 2019 FINISHED False 10800 154194899 Dec. 29, 2019, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 785 ) H Number of Components PROGRAMMING data structures 3200

B"Suppose that we have an array of n distinct numbers a_1, a_2, ... , a_n . Let's build a graph on n vertices as follows: for every pair of vertices i < j let's connect i and j with an edge, if a_i < a_j . Let's define weight of the array to be the number of connected components in this graph. For example, weight of array [1, 4, 2] is 1 , weight of array [5, 4, 3] is 3 . You have to perform q queries of the following form -- change the value at some position of the array. After each operation, output the weight of the array. Updates are not independent (the change stays for the future). The first line contains two integers n and q ( 1 <= n, q <= 5 cdot 10^5 ) -- the size of the array and the number of queries. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ) -- the initial array. Each of the next q lines contains two integers pos and x ( 1 <= pos <= n , 1 <= x <= 10^6, x ne a_{pos} ). It means that you have to make a_{pos}=x . It's guaranteed that at every moment of time, all elements of the array are different. After each query, output the weight of the array. After the first query array looks like [25, 40, 30, 20, 10] , the weight is equal to 3 . After the second query array looks like [25, 40, 45, 20, 10] , the weight is still equal to 3 . After the third query array looks like [48, 40, 45, 20, 10] , the weight is equal to 4 . "...

Tutorials

Разбор Goodbye 2019

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67931310 FizzyDavid H Dec. 29, 2019, 6:07 p.m. OK GNU C++11 TESTS 67 764 50278400 3200
68025754 FizzyDavid H Jan. 1, 2020, 5:33 a.m. OK GNU C++11 TESTS 68 779 42291200 3200
67927407 FizzyDavid H Dec. 29, 2019, 4:58 p.m. OK GNU C++11 TESTS 67 920 42291200 3200
68116030 Fuyuki H Jan. 3, 2020, 11:29 a.m. OK GNU C++11 TESTS 68 1278 42086400 3200
68066958 cjy2003 H Jan. 2, 2020, 8:21 a.m. OK GNU C++11 TESTS 68 1372 96256000 3200
68036235 ilnil H Jan. 1, 2020, 12:11 p.m. OK GNU C++11 TESTS 68 1434 34099200 3200
68490599 yasugongshang H Jan. 10, 2020, 11:34 a.m. OK GNU C++11 TESTS 68 1543 27238400 3200
68017955 eriksuenderhauf H Dec. 31, 2019, 7:58 p.m. OK GNU C++11 TESTS 68 1544 54067200 3200
68017974 eriksuenderhauf H Dec. 31, 2019, 7:59 p.m. OK GNU C++11 TESTS 68 1574 54067200 3200
68116284 Fuyuki H Jan. 3, 2020, 11:34 a.m. OK GNU C++11 TESTS 68 1606 41881600 3200
68161567 tmwilliamlin168 H Jan. 4, 2020, 11:05 a.m. OK GNU C++14 TESTS 68 1216 31436800 3200
68547666 srividya_0103 H Jan. 10, 2020, 3:59 p.m. OK GNU C++14 TESTS 68 1747 41984000 3200
68025614 BSBandme H Jan. 1, 2020, 5:26 a.m. OK GNU C++14 TESTS 68 1808 86220800 3200
68155123 zhongyuwei H Jan. 4, 2020, 8:40 a.m. OK GNU C++14 TESTS 68 2214 56115200 3200
69007075 ffffxk H Jan. 18, 2020, 12:38 a.m. OK GNU C++14 TESTS 68 2323 58163200 3200
67984577 O--O H Dec. 30, 2019, 9:25 p.m. OK GNU C++14 TESTS 68 2355 41676800 3200
68101952 dai H Jan. 3, 2020, 4:03 a.m. OK GNU C++14 TESTS 68 2371 74342400 3200
67950607 idxcalcal H Dec. 30, 2019, 7:29 a.m. OK GNU C++14 TESTS 68 2464 53350400 3200
68072839 AuqaKyz H Jan. 2, 2020, 11:09 a.m. OK GNU C++14 TESTS 68 2729 52121600 3200
67938141 cuom1999 H Dec. 29, 2019, 9:44 p.m. OK GNU C++14 TESTS 67 3025 50073600 3200
67987290 neal H Dec. 31, 2019, 12:23 a.m. OK GNU C++17 TESTS 68 1232 51712000 3200
67987244 neal H Dec. 31, 2019, 12:19 a.m. OK GNU C++17 TESTS 68 1294 51712000 3200
67924241 yosupo H Dec. 29, 2019, 4:38 p.m. OK GNU C++17 TESTS 67 1403 50380800 3200
67938539 ecnerwala H Dec. 29, 2019, 10:04 p.m. OK GNU C++17 TESTS 67 1528 60416000 3200
68149123 dragonslayerintraining H Jan. 4, 2020, 6:07 a.m. OK GNU C++17 TESTS 68 1544 58060800 3200
67939576 paulica H Dec. 29, 2019, 11:03 p.m. OK GNU C++17 TESTS 67 1668 27238400 3200
67987216 neal H Dec. 31, 2019, 12:16 a.m. OK GNU C++17 TESTS 68 1699 51712000 3200
68472430 xz153531 H Jan. 10, 2020, 2:57 a.m. OK GNU C++17 TESTS 68 1856 70144000 3200
68953885 saketh H Jan. 16, 2020, 7:09 p.m. OK GNU C++17 TESTS 68 1918 30617600 3200
68389758 A_Fan_of_the_AK_King--lk H Jan. 8, 2020, 8:02 a.m. OK GNU C++17 TESTS 68 1934 52121600 3200
68743624 vjudge5 H Jan. 14, 2020, 3:04 a.m. OK MS C++ TESTS 68 3322 70246400 3200

remove filters

Back to search problems