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.
Problems
B'Divan 's new cottage is finally complete! However, after a thorough inspection, it turned out that the workers had installed the insulation incorrectly, and now the temperature in the house directly depends on the temperature outside. More precisely, if the temperature in the house is P in the morning, and the street temperature is T , then by the next morning the temperature in the house changes according to the following rule: Divan is a very busy businessman, so sometimes he is not at home for long periods and does not know what the temperature is there now, so he hired you to find it. You will work for n days. In the beginning of the i -th day, the temperature outside T_i is first given to you. After that, on the i -th day, you will receive k_i queries. Each query asks the following: "if the temperature in the house was x_i at the morning of the first day, what would be the temperature in the house next morning (after day i )?" Please answer all the businessman 's queries. The first line of the input contains the number n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of days. The following is a description of n days in the following format. The first line of the description contains an integer T_i ( 0 <= q T_i <= q 10^9 ) -- the temperature on that day. The second line contains a non-negative integer k_i ( 0 <= k_i <= 2 cdot 10^5 ) -- the number of queries that day. The third line contains k integers x '_i ( 0 <= q x '_{i} <= q 10^9 ) -- the encrypted version of Divan 's queries. Let lastans = 0 initially. Divan 's actual queries are given by x_i = (x '_i + lastans) bmod (10^9 + 1) , where a bmod b is the reminder when a is divided by b . After answering the query, set lastans to the answer. It is guaranteed that the total number of queries (the sum of all k_i ) does not exceed 2 cdot 10^5 . For each query'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
137079800 |
XyzL |
E |
Nov. 27, 2021, 2:38 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
529 |
104652800 |
|
2600 |
137084146 |
thebighead |
E |
Nov. 27, 2021, 4:13 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
530 |
120217600 |
|
2600 |
137078957 |
wudengfendechengge |
E |
Nov. 27, 2021, 2:17 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
592 |
126873600 |
|
2600 |
137090094 |
playf |
E |
Nov. 27, 2021, 5:39 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
654 |
192409600 |
|
2600 |
137043474 |
Starlight237 |
E |
Nov. 26, 2021, 2:04 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
655 |
201318400 |
|
2600 |
137075357 |
sbzhangjianjun |
E |
Nov. 26, 2021, 11:57 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
670 |
500940800 |
|
2600 |
137061824 |
mehrzad_minaie |
E |
Nov. 26, 2021, 5:50 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
670 |
1001984000 |
|
2600 |
137042971 |
Eric_hooo |
E |
Nov. 26, 2021, 2:01 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
701 |
407347200 |
|
2600 |
137081720 |
Baiyu0123 |
E |
Nov. 27, 2021, 3:20 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
732 |
801587200 |
|
2600 |
137091495 |
zhuzhirui2005 |
E |
Nov. 27, 2021, 5:56 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
779 |
256512000 |
|
2600 |
137052103 |
zxyoi |
E |
Nov. 26, 2021, 3:35 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
530 |
124416000 |
|
2600 |
137074937 |
kdh |
E |
Nov. 26, 2021, 11:33 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
561 |
151347200 |
|
2600 |
137076329 |
kdh |
E |
Nov. 27, 2021, 12:47 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
655 |
120217600 |
|
2600 |
137076268 |
kdh |
E |
Nov. 27, 2021, 12:45 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
655 |
120217600 |
|
2600 |
137079313 |
skcwky |
E |
Nov. 27, 2021, 2:26 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
763 |
480972800 |
|
2600 |
137075845 |
WildFlower |
E |
Nov. 27, 2021, 12:25 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
826 |
240435200 |
|
2600 |
137046611 |
Saturn_Naruto |
E |
Nov. 26, 2021, 2:34 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
873 |
801587200 |
|
2600 |
137041758 |
yuBai0123 |
E |
Nov. 26, 2021, 1:54 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
873 |
801587200 |
|
2600 |
137044117 |
glancing_back |
E |
Nov. 26, 2021, 2:09 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
904 |
488960000 |
|
2600 |
137043941 |
sigland |
E |
Nov. 26, 2021, 2:08 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
904 |
488960000 |
|
2600 |
137055430 |
lt123456 |
E |
Nov. 26, 2021, 4:19 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
358 |
643379200 |
|
2600 |
137082380 |
Nero |
E |
Nov. 27, 2021, 3:34 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
530 |
159641600 |
|
2600 |
137033386 |
newbie_wrz |
E |
Nov. 26, 2021, 1:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
576 |
387891200 |
|
2600 |
137079355 |
Archer_ |
E |
Nov. 27, 2021, 2:27 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
654 |
480972800 |
|
2600 |
137049879 |
GSHgsh |
E |
Nov. 26, 2021, 3:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
686 |
320614400 |
|
2600 |
137045373 |
kostia244 |
E |
Nov. 26, 2021, 2:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
748 |
77312000 |
|
2600 |
137075892 |
QwQcOrZ |
E |
Nov. 27, 2021, 12:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
779 |
240435200 |
|
2600 |
137082709 |
KillerX |
E |
Nov. 27, 2021, 3:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
826 |
19353600 |
|
2600 |
137090148 |
playf |
E |
Nov. 27, 2021, 5:40 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
826 |
192409600 |
|
2600 |
137075112 |
zykmd |
E |
Nov. 26, 2021, 11:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
842 |
401612800 |
|
2600 |
137046217 |
qwaszxwillwinioi2022 |
E |
Nov. 26, 2021, 2:30 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
826 |
357478400 |
|
2600 |
137074960 |
ToToMI |
E |
Nov. 26, 2021, 11:35 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
842 |
801587200 |
|
2600 |
137074934 |
ToToMI |
E |
Nov. 26, 2021, 11:33 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
889 |
801587200 |
|
2600 |
137052133 |
Howarli |
E |
Nov. 26, 2021, 3:35 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
904 |
241049600 |
|
2600 |
137042128 |
fishcathu. |
E |
Nov. 26, 2021, 1:56 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
967 |
280576000 |
|
2600 |
137029727 |
Huah |
E |
Nov. 26, 2021, 12:50 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
1060 |
360652800 |
|
2600 |
137073063 |
Bench0310 |
E |
Nov. 26, 2021, 9:58 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
1138 |
479027200 |
|
2600 |
137052052 |
Howarli |
E |
Nov. 26, 2021, 3:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
1263 |
723148800 |
|
2600 |
137080953 |
bkifhr10 |
E |
Nov. 27, 2021, 3:03 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
1325 |
256512000 |
|
2600 |
137066317 |
p3rfect |
E |
Nov. 26, 2021, 7:05 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
1326 |
626278400 |
|
2600 |
remove filters
Back to search problems