Codeforces Round 502 (in memory of Leopoldo Taravilse, Div. 1 + 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
1017 Codeforces Round 502 (in memory of Leopoldo Taravilse, Div. 1 + Div. 2) FINISHED False 9600 198086099 Aug. 8, 2018, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 147 ) H The Films PROGRAMMING brute force 3300

B'In "The Man in the High Castle" world, there are m different film endings. Abendsen owns a storage and a shelf. At first, he has n ordered films on the shelf. In the i -th month he will do: Answer all Abendsen 's questions. Let the probability be fraction P_i . Let 's say that the total number of ways to take n films from the storage for i -th month is A_i , so P_i cdot A_i is always an integer. Print for each month P_i cdot A_i pmod {998244353} . 998244353 is a prime number and it is equal to 119 cdot 2^{23} + 1 . It is guaranteed that there will be only no more than 100 different k values. The first line contains three integers n , m , and q ( 1 <= n, m, q <= 10^5 , n+q <= q 10^5 ) -- the number of films on the shelf initially, the number of endings, and the number of months. The second line contains n integers e_1, e_2, ldots, e_n ( 1 <= q e_i <= q m ) -- the ending of the i -th film on the shelf. Each of the next q lines contains three integers l_i , r_i , and k_i ( 1 <= l_i <= r_i <= n, 0 <= k_i <= 10^5 ) -- the i -th query. It is guaranteed that there will be only no more than 100 different k values. Print the answer for each question in a separate line. In the first sample in the second query, after adding 2 cdot m films into the storage, the storage will look like this: {1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 } . There are 26730 total ways of choosing the films so that e_l, e_{l+1}, ldots, e_r will not be changed, for example, [1, 2, 3, 2, 2] and [1, 2, 3, 4, 3] are such ways. There are 2162160 total ways of choosing the films, so you 're asked to print ( frac{26730}{2162160} cdot 2162160) mod 998244353 = 26730 . '...

Tutorials

Разбор (англ.)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
69201088 hos.lyric H Jan. 20, 2020, 4:33 p.m. OK D TESTS 58 2198 23244800 3300
69201184 hos.lyric H Jan. 20, 2020, 4:35 p.m. OK D TESTS 58 2277 23244800 3300
41421251 samjia2000 H Aug. 10, 2018, 7:15 a.m. OK GNU C++ TESTS 58 2059 91648000 3300
41421420 samjia2000 H Aug. 10, 2018, 7:19 a.m. OK GNU C++ TESTS 58 2293 91648000 3300
41421028 samjia2000 H Aug. 10, 2018, 7:10 a.m. OK GNU C++ TESTS 58 3556 91648000 3300
43287857 zhouyuyang H Sept. 23, 2018, 9:09 a.m. OK GNU C++11 TESTS 58 592 5632000 3300
43288581 zhouyuyang H Sept. 23, 2018, 9:30 a.m. OK GNU C++11 TESTS 58 624 4812800 3300
57869051 lopare H July 27, 2019, 11:53 p.m. OK GNU C++11 TESTS 58 1263 4198400 3300
57738011 py_ultron H July 25, 2019, 10:33 a.m. OK GNU C++11 TESTS 58 1294 4198400 3300
42815167 goldgenius H Sept. 13, 2018, 12:48 a.m. OK GNU C++11 TESTS 58 1699 13107200 3300
42166249 krijgertje H Aug. 27, 2018, 5:01 p.m. OK GNU C++11 TESTS 58 1731 272896000 3300
41411747 krigan H Aug. 9, 2018, 8:58 p.m. OK GNU C++11 TESTS 58 1903 3993600 3300
42783929 Anson529 H Sept. 12, 2018, 1:41 a.m. OK GNU C++11 TESTS 58 2106 8294400 3300
45137352 yasugongshang H Oct. 31, 2018, 12:57 p.m. OK GNU C++11 TESTS 58 2136 46592000 3300
45136964 yasugongshang H Oct. 31, 2018, 12:47 p.m. OK GNU C++11 TESTS 58 2261 46592000 3300
41397800 DEMOPON H Aug. 9, 2018, 12:02 p.m. OK GNU C++14 TESTS 58 1388 4710400 3300
42721550 ReaLNero1 H Sept. 10, 2018, 2:10 a.m. OK GNU C++14 TESTS 58 1404 4403200 3300
41388366 consecutivelimit H Aug. 9, 2018, 7:11 a.m. OK GNU C++14 TESTS 58 1435 4403200 3300
41398137 DEMOPON H Aug. 9, 2018, 12:11 p.m. OK GNU C++14 TESTS 58 1450 4710400 3300
69200771 hos.lyric H Jan. 20, 2020, 4:27 p.m. OK GNU C++14 TESTS 58 1466 7475200 3300
42157886 DEMOPON H Aug. 27, 2018, 4 p.m. OK GNU C++14 TESTS 58 1512 4403200 3300
41373585 wakaka H Aug. 8, 2018, 6:58 p.m. OK GNU C++14 TESTS 58 1778 12800000 3300
41606966 teapotd H Aug. 15, 2018, 3:26 a.m. OK GNU C++14 TESTS 58 1949 3174400 3300
41546966 cz_xuyixuan H Aug. 13, 2018, 5:53 a.m. OK GNU C++14 TESTS 58 1965 8806400 3300
41606077 chemthan H Aug. 15, 2018, 2:32 a.m. OK GNU C++14 TESTS 58 1965 12492800 3300
69707535 gongsuidashen H Jan. 29, 2020, 5:28 a.m. OK GNU C++17 TESTS 58 514 5632000 3300
41515697 gepardo H Aug. 12, 2018, 5:56 a.m. OK GNU C++17 TESTS 58 780 5222400 3300
62835407 majorabdo12 H Oct. 17, 2019, 10:05 p.m. OK GNU C++17 TESTS 58 1278 4403200 3300
41607119 teapotd H Aug. 15, 2018, 3:36 a.m. OK GNU C++17 TESTS 58 1933 3174400 3300
41802380 fsouza H Aug. 18, 2018, 7:26 p.m. OK GNU C++17 TESTS 58 1965 5222400 3300
41607180 teapotd H Aug. 15, 2018, 3:38 a.m. OK GNU C++17 TESTS 58 2012 3276800 3300
41400744 Dance_Of_Faith H Aug. 9, 2018, 1:30 p.m. OK GNU C++17 TESTS 58 2854 9625600 3300
41367702 Benq H Aug. 8, 2018, 4:21 p.m. OK GNU C++17 TESTS 58 3025 10035200 3300
41400639 Dance_Of_Faith H Aug. 9, 2018, 1:26 p.m. OK GNU C++17 TESTS 58 3151 9625600 3300
41430573 Himadri-nath H Aug. 10, 2018, 12:22 p.m. OK GNU C++17 TESTS 58 3462 252620800 3300
41946414 AbdelRahmanEmara H Aug. 21, 2018, 7:02 p.m. OK Java 8 TESTS 58 4867 614400 3300

remove filters

Back to search problems