Bubble Cup 14 - Finals Online Mirror (Unrated, ICPC Rules, Teams Preferred, Div. 1)

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
1599 Bubble Cup 14 - Finals Online Mirror (Unrated, ICPC Rules, Teams Preferred, Div. 1) FINISHED False 14400 98052899 Oct. 9, 2021, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 67 ) E Two Arrays PROGRAMMING data structures matrices

B'You are given two integer arrays of length N , A1 and A2 . You are also given Q queries of 4 types: 1 k l r x: set Ak_i:=min(Ak_i, x) for each l <= q i <= q r . 2 k l r x: set Ak_i:=max(Ak_i, x) for each l <= q i <= q r . 3 k l r x: set Ak_i:=Ak_i+x for each l <= q i <= q r . 4 l r: find the ( sum_{i=l}^r F(A1_i+A2_i)) % (10^9+7) where F(k) is the k -th Fibonacci number ( F(0)=0, F(1)=1, F(k)=F(k-1)+F(k-2) ), and x % y denotes the remainder of the division of x by y . You should process these queries and answer each query of the fourth type. The first line contains two integers N and Q . ( 1 <= q N, Q <= q 5 x 10^4 ) The second line contains N integers, array A1_1, A1_2, ... A1_N . ( 0 <= q A1_i <= q 10^6 ) The third line contains N integers, array A2_1, A2_2, ... A2_N . ( 0 <= q A2_i <= q 10^6 ) The next Q lines describe the queries. Each line contains 5 or 3 integers, where the first integer denotes the type of the query. ( k in {1, 2 } , 1 <= q l <= q r <= q N ) For queries of type 1 and 2, 0 <= q x <= q 10^9 holds. For queries of type 3, xe2 x88 x9210^6 <= q x <= q 10^6 holds. It is guaranteed that after every query each number in arrays A1 and A2 will be nonnegative. Print the answer to each query of the fourth type, in separate lines. In the first example: The answer for the first query is F(1 + 2) + F(0 + 1) + F(2 + 0) = F(3) + F(1) + F(2) = 2 + 1 + 1 = 4 . After the second query, the array A2 changes to [2, 4, 0] . After the third query, the array A1 changes to [0, 0, 0] . The answer for the fourth query is F(0 + 2) + F(0 + 4) + F(0 + 0) = F(2) + F(4) + F(0) = 1 + 3 + 0 = 4 . In the second example: The answer for the first query is F(1 + 4) + F(3 + 2) + F(5 + 1) = F(5) + F(5) + F(6) = 5 + 5 + 8 = 18 . The answer for the second q'...

Tutorials

BubbleCup2021.pdf

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131324168 davidberard E Oct. 9, 2021, 12:08 p.m. OK GNU C++17 (64) TESTS 30 639 13824000
131334963 xay5421 E Oct. 9, 2021, 1:53 p.m. OK GNU C++17 (64) TESTS 30 701 81715200
131329762 Denisson ShadowLight DmitryGrigorev E Oct. 9, 2021, 1:01 p.m. OK GNU C++17 (64) TESTS 30 3462 197529600

remove filters

Back to search problems