Codeforces Round 837 (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
1771 Codeforces Round 837 (Div. 2) FINISHED False 7200 66493463 Dec. 11, 2022, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1220 ) F Hossam and Range Minimum Query PROGRAMMING binary search bitmasks data structures hashing probabilities strings trees

B'Hossam gives you a sequence of integers a_1, , a_2, , ... , , a_n of length n . Moreover, he will give you q queries of type (l, , r) . For each query, consider the elements a_l, , a_{l + 1}, , ... , , a_r . Hossam wants to know the smallest number in this sequence, such that it occurs in this sequence an odd number of times. You need to compute the answer for each query before process the next query. The first line of the input contains one integer n ( 1 <= n <= 2 cdot 10^5 ), the length of the sequence. The second line contains n integers a_1, , a_2, , ... , , a_n ( 1 <= a_i <= 10^9 ). The third line contains one integer q ( 1 <= q <= 2 cdot 10^5 ), the number of queries. Each of the next q lines contains two integers a and b ( 0 <= a, , b <= 2 cdot 10^9 ), the numbers used to encode the queries. Let mathrm{ans}_i be the answer on the i -th query, and mathrm{ans}_0 be zero. Then l_i = a_i oplus mathrm{ans}_{i - 1}, r_i = b_i oplus mathrm{ans}_{i - 1}, where l_i, , r_i are parameters of the i -th query and oplus means the bitwise exclusive or operation. It is guaranteed that 1 <= l <= r <= n . For each query, print the smallest number that occurs an odd number of times on the given segment of the sequence. If there is no such number, print 0 . In the example, l_1 = 1, , r_1 = 2, l_2 = 1, , r_2 = 3, l_3 = 2, , r_3 = 4, l_4 = 1, , r_4 = 4, l_5 = 2, , r_5 = 2, l_6 = 1, , r_6 = 5. '...

Tutorials

Codeforces Round #837 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
184841482 Yuki991 F Dec. 12, 2022, 4:03 a.m. OK GNU C++14 TESTS 73 374 76185600
184837453 Wangxueyi F Dec. 12, 2022, 2:58 a.m. OK GNU C++14 TESTS 73 420 210124800
184833259 zltzlt F Dec. 12, 2022, 1:35 a.m. OK GNU C++14 TESTS 73 482 209305600
184843656 JR_wan F Dec. 12, 2022, 4:36 a.m. OK GNU C++14 TESTS 73 482 251596800
184819823 Potassium F Dec. 11, 2022, 8:39 p.m. OK GNU C++14 TESTS 73 483 84480000
184839060 Pointy F Dec. 12, 2022, 3:24 a.m. OK GNU C++14 TESTS 73 499 104243200
184849349 i_love_derivative F Dec. 12, 2022, 5:54 a.m. OK GNU C++14 TESTS 73 529 103731200
184843701 JR_wan F Dec. 12, 2022, 4:37 a.m. OK GNU C++14 TESTS 73 545 248729600
184849380 i_love_derivative F Dec. 12, 2022, 5:55 a.m. OK GNU C++14 TESTS 73 546 103833600
184840830 LNCYZ F Dec. 12, 2022, 3:52 a.m. OK GNU C++14 TESTS 73 560 248524800

remove filters

Back to search problems