Codeforces Round 564 (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
1172 Codeforces Round 564 (Div. 1) FINISHED False 7200 177530087 June 7, 2019, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 871 ) C2 Nauuo and Pictures (hard version) PROGRAMMING dp probabilities 2700

B'The only difference between easy and hard versions is constraints. Nauuo is a girl who loves random picture websites. One day she made a random picture website by herself which includes n pictures. When Nauuo visits the website, she sees exactly one picture. The website does not display each picture with equal probability. The i -th picture has a non-negative weight w_i , and the probability of the i -th picture being displayed is frac{w_i}{ sum_{j=1}^nw_j} . That is to say, the probability of a picture to be displayed is proportional to its weight. However, Nauuo discovered that some pictures she does not like were displayed too often. To solve this problem, she came up with a great idea: when she saw a picture she likes, she would add 1 to its weight; otherwise, she would subtract 1 from its weight. Nauuo will visit the website m times. She wants to know the expected weight of each picture after all the m visits modulo 998244353 . Can you help her? The expected weight of the i -th picture can be denoted by frac {q_i} {p_i} where gcd(p_i,q_i)=1 , you need to print an integer r_i satisfying 0 <= r_i<998244353 and r_i cdot p_i equiv q_i pmod{998244353} . It can be proved that such r_i exists and is unique. The first line contains two integers n and m ( 1 <= n <= 2 cdot 10^5 , 1 <= m <= 3000 ) -- the number of pictures and the number of visits to the website. The second line contains n integers a_1,a_2, ldots,a_n ( a_i is either 0 or 1 ) -- if a_i=0 , Nauuo does not like the i -th picture; otherwise Nauuo likes the i -th picture. It is guaranteed that there is at least one picture which Nauuo likes. The third line contains n positive integers w_1,w_2, ldots,w_n ( w_i geq 1 ) -- the initial weights of the pictures. It is guaranteed that the sum of all the initial weights does not'...

Tutorials

Codeforces Round #564 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
55255812 hos.lyric C2 June 7, 2019, 12:48 p.m. OK D TESTS 90 404 102912000 2700
55699194 liuzhangfeiabc C2 June 18, 2019, 2:28 a.m. OK GNU C++11 TESTS 90 202 73728000 2700
56469836 yukuai26 C2 July 3, 2019, 10:35 a.m. OK GNU C++11 TESTS 90 218 74035200 2700
55259307 _rqy C2 June 7, 2019, 1:11 p.m. OK GNU C++11 TESTS 90 233 76083200 2700
55610599 ReaLNero1 C2 June 16, 2019, 5:26 a.m. OK GNU C++11 TESTS 90 234 75059200 2700
55426535 maxtir C2 June 11, 2019, 9:16 a.m. OK GNU C++11 TESTS 90 234 75059200 2700
55277295 dazade_8 C2 June 7, 2019, 8:05 p.m. OK GNU C++11 TESTS 90 249 154521600 2700
55257436 ywwyww C2 June 7, 2019, 12:58 p.m. OK GNU C++11 TESTS 90 265 42291200 2700
58250044 Sooke C2 Aug. 4, 2019, 7:25 a.m. OK GNU C++11 TESTS 90 265 73830400 2700
55256476 panole C2 June 7, 2019, 12:52 p.m. OK GNU C++11 TESTS 90 280 38809600 2700
55303952 ROUC C2 June 8, 2019, 1:17 p.m. OK GNU C++11 TESTS 90 280 74240000 2700
55325397 MegaOwIer C2 June 9, 2019, 7:44 a.m. OK GNU C++14 TESTS 90 249 1638400 2700
55524610 zhou888 C2 June 13, 2019, 10:30 a.m. OK GNU C++14 TESTS 90 249 1740800 2700
55708467 zsyzsy C2 June 18, 2019, 8:57 a.m. OK GNU C++14 TESTS 90 264 37785600 2700
55281580 shdut C2 June 8, 2019, 1:34 a.m. OK GNU C++14 TESTS 90 265 1638400 2700
55432995 mayaohua2003 C2 June 11, 2019, 12:26 p.m. OK GNU C++14 TESTS 90 265 37273600 2700
55264372 DmitryGrigorev C2 June 7, 2019, 1:49 p.m. OK GNU C++14 TESTS 90 280 1638400 2700
55258339 orbitingflea C2 June 7, 2019, 1:04 p.m. OK GNU C++14 TESTS 90 295 37785600 2700
62115549 melancholic_fat_otaku C2 Oct. 8, 2019, 1:17 p.m. OK GNU C++14 TESTS 90 295 40140800 2700
55423681 Newusers C2 June 11, 2019, 7:54 a.m. OK GNU C++14 TESTS 90 296 37785600 2700
55270194 amnesiac_dusk C2 June 7, 2019, 4:03 p.m. OK GNU C++14 TESTS 90 296 37785600 2700
55283213 whzzt C2 June 8, 2019, 3 a.m. OK GNU C++17 TESTS 90 249 41984000 2700
64481590 Lucina C2 Nov. 7, 2019, 4:08 p.m. OK GNU C++17 TESTS 90 265 37376000 2700
55264920 GuessYCB C2 June 7, 2019, 1:53 p.m. OK GNU C++17 TESTS 90 265 39424000 2700
58221391 krijgertje C2 Aug. 3, 2019, 12:40 p.m. OK GNU C++17 TESTS 90 280 38502400 2700
55260348 JOHNKRAM C2 June 7, 2019, 1:19 p.m. OK GNU C++17 TESTS 90 280 38604800 2700
55483998 Shanru C2 June 12, 2019, 6:56 a.m. OK GNU C++17 TESTS 90 280 76697600 2700
55369035 Ilya_MSU C2 June 9, 2019, 4:22 p.m. OK GNU C++17 TESTS 90 295 3276800 2700
55259217 aid C2 June 7, 2019, 1:10 p.m. OK GNU C++17 TESTS 90 295 37888000 2700
55288606 Jiangkangping C2 June 8, 2019, 6:30 a.m. OK GNU C++17 TESTS 90 296 6656000 2700
55544356 CMXRYNP C2 June 13, 2019, 11:49 p.m. OK GNU C++17 TESTS 90 296 37785600 2700
55284882 dalt C2 June 8, 2019, 4:09 a.m. OK Java 8 TESTS 90 982 140288000 2700
56775573 Suzukaze C2 July 10, 2019, 2:25 a.m. OK Java 8 TESTS 90 1279 143360000 2700
57434032 Darth_Jar_Jar_Binks C2 July 21, 2019, 3:33 a.m. OK Java 8 TESTS 90 1840 64000000 2700
55265332 uwi C2 June 7, 2019, 1:56 p.m. OK Java 8 TESTS 90 2432 0 2700
57433924 Darth_Jar_Jar_Binks C2 July 21, 2019, 3:29 a.m. OK Java 8 TESTS 90 3743 63795200 2700
57726278 Spheniscine C2 July 25, 2019, 7:15 a.m. OK Kotlin TESTS 90 1154 17100800 2700
57724559 Spheniscine C2 July 25, 2019, 6:44 a.m. OK Kotlin TESTS 90 1200 17100800 2700
57727653 Spheniscine C2 July 25, 2019, 7:38 a.m. OK Kotlin TESTS 90 1216 17100800 2700
57723205 Spheniscine C2 July 25, 2019, 6:19 a.m. OK Kotlin TESTS 90 1216 17203200 2700
58254580 Spheniscine C2 Aug. 4, 2019, 9:23 a.m. OK Kotlin TESTS 90 1341 17100800 2700
57882235 Spheniscine C2 July 28, 2019, 8:19 a.m. OK Kotlin TESTS 90 1372 17100800 2700
57809605 Helli.code C2 July 26, 2019, 4:39 p.m. OK PyPy 2 TESTS 90 3431 19660800 2700
55281321 Kiri8128 C2 June 8, 2019, 1:17 a.m. OK PyPy 3 TESTS 90 1840 21606400 2700
55273985 EbTech C2 June 7, 2019, 5:53 p.m. OK Rust TESTS 90 295 5529600 2700
55275137 EbTech C2 June 7, 2019, 6:31 p.m. OK Rust TESTS 90 327 5529600 2700
55274842 EbTech C2 June 7, 2019, 6:20 p.m. OK Rust TESTS 90 327 5529600 2700
67516336 gearjack C2 Dec. 24, 2019, 10:58 a.m. OK Rust TESTS 90 436 150016000 2700
55275319 kobae964 C2 June 7, 2019, 6:39 p.m. OK Rust TESTS 90 592 147148800 2700
55266237 EbTech C2 June 7, 2019, 2:01 p.m. OK Rust TESTS 90 3010 5529600 2700

remove filters

Back to search problems