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 |
---|---|---|---|---|---|---|
1540 | Codeforces Round 728 (Div. 1) | FINISHED | False | 8100 | 107187899 | June 25, 2021, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 472 ) | C2 | Converging Array (Hard Version) | PROGRAMMING | dp math |
B'This is the hard version of the problem. The only difference is that in this version 1 <= q <= 10^5 . You can make hacks only if both versions of the problem are solved. There is a process that takes place on arrays a and b of length n and length n-1 respectively. The process is an infinite sequence of operations. Each operation is as follows: It can be proven that array a converges, i. e. for each i there exists a limit a_i converges to. Let function F(a, b) return the value a_1 converges to after a process on a and b . You are given array b , but not array a . However, you are given a third array c . Array a is good if it contains only integers and satisfies 0 <= q a_i <= q c_i for 1 <= q i <= q n . Your task is to count the number of good arrays a where F(a, b) geq x for q values of x . Since the number of arrays can be very large, print it modulo 10^9+7 . The first line contains a single integer n ( 2 <= n <= 100 ). The second line contains n integers c_1, c_2 ldots, c_n ( 0 <= c_i <= 100 ). The third line contains n-1 integers b_1, b_2, ldots, b_{n-1} ( 0 <= b_i <= 100 ). The fourth line contains a single integer q ( 1 <= q <= 10^5 ). The fifth line contains q space separated integers x_1, x_2, ldots, x_q ( -10^5 <= x_i <= 10^5 ). Output q integers, where the i -th integer is the answer to the i -th query, i. e. the number of good arrays a where F(a, b) geq x_i modulo 10^9+7 . The following explanation assumes b = [2, 1] and c=[2, 3, 4] (as in the sample). Examples of arrays a that are not good: One possible good array a is [0, 2, 4] . We can show that no operation has any effect on this array, so F(a, b) = a_1 = 0 . Another possible good array a is [0, 1, 4]$$'... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
120602424 | idxcalcal | C2 | June 25, 2021, 5:28 p.m. | OK | GNU C++11 | TESTS | 28 | 202 | 5222400 | ||
120605039 | eecs | C2 | June 25, 2021, 5:36 p.m. | OK | GNU C++11 | TESTS | 28 | 374 | 6758400 | ||
120598713 | Argentina | C2 | June 25, 2021, 5:16 p.m. | OK | GNU C++11 | TESTS | 28 | 1014 | 17203200 | ||
120624628 | Marckess | C2 | June 25, 2021, 11:42 p.m. | OK | GNU C++14 | TESTS | 28 | 171 | 6246400 | ||
120574747 | peehs_moorhsum | C2 | June 25, 2021, 4:22 p.m. | OK | GNU C++14 | TESTS | 28 | 451 | 5324800 | ||
120593873 | ccf_n0i | C2 | June 25, 2021, 5:03 p.m. | OK | GNU C++14 | TESTS | 28 | 608 | 5017600 | ||
120579011 | Radewoosh | C2 | June 25, 2021, 4:30 p.m. | OK | GNU C++14 | TESTS | 28 | 1777 | 19660800 | ||
120613769 | hank55663 | C2 | June 25, 2021, 6:44 p.m. | OK | GNU C++17 | TESTS | 28 | 265 | 4403200 | ||
120612753 | sd0061 | C2 | June 25, 2021, 6:33 p.m. | OK | GNU C++17 | TESTS | 28 | 280 | 102400 | ||
120597687 | wudi2016 | C2 | June 25, 2021, 5:13 p.m. | OK | GNU C++17 | TESTS | 28 | 311 | 4710400 | ||
120607101 | Froggay | C2 | June 25, 2021, 5:43 p.m. | OK | GNU C++17 | TESTS | 28 | 327 | 819200 | ||
120592914 | gisp_zjz | C2 | June 25, 2021, 5:01 p.m. | OK | GNU C++17 | TESTS | 28 | 358 | 4300800 | ||
120637040 | BigBag | C2 | June 26, 2021, 5:22 a.m. | OK | GNU C++17 | TESTS | 28 | 373 | 921600 | ||
120603869 | liujingming | C2 | June 25, 2021, 5:32 p.m. | OK | GNU C++17 | TESTS | 28 | 561 | 1740800 | ||
120597136 | xtqqwq | C2 | June 25, 2021, 5:12 p.m. | OK | GNU C++17 | TESTS | 28 | 639 | 102400 | ||
120598287 | lezdzh | C2 | June 25, 2021, 5:15 p.m. | OK | GNU C++17 | TESTS | 28 | 685 | 4812800 | ||
120610956 | Shef | C2 | June 25, 2021, 6:16 p.m. | OK | GNU C++17 | TESTS | 28 | 763 | 1433600 | ||
120577744 | ecnerwala | C2 | June 25, 2021, 4:28 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 124 | 2150400 | ||
120608858 | alya_wow | C2 | June 25, 2021, 5:48 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 186 | 921600 | ||
120600012 | ainta | C2 | June 25, 2021, 5:20 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 202 | 4608000 | ||
120568544 | tourist | C2 | June 25, 2021, 4:12 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 234 | 1536000 | ||
120621468 | DreamingLeaf | C2 | June 25, 2021, 9:18 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 249 | 1740800 | ||
120614163 | tfg | C2 | June 25, 2021, 6:49 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 280 | 2764800 | ||
120626587 | p_b_p_b | C2 | June 26, 2021, 1:19 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 296 | 24166400 | ||
120612904 | heno239 | C2 | June 25, 2021, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 311 | 27852800 | ||
120624615 | Ormlis | C2 | June 25, 2021, 11:41 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 327 | 102400 | ||
120603768 | hitonanode | C2 | June 25, 2021, 5:32 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 358 | 102400 | ||
120611610 | Tlatoani | C2 | June 25, 2021, 6:22 p.m. | OK | Kotlin | TESTS | 28 | 920 | 1536000 |
Back to search problems