Educational Codeforces Round 163 (Rated for 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
1948 Educational Codeforces Round 163 (Rated for Div. 2) FINISHED False 7200 26666663 March 15, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1376 ) F Rare Coins PROGRAMMING combinatorics math probabilities

B'There are n bags numbered from 1 to n , the i -th bag contains a_i golden coins and b_i silver coins. The value of a gold coin is 1 . The value of a silver coin is either 0 or 1 , determined for each silver coin independently ( 0 with probability frac{1}{2} , 1 with probability frac{1}{2} ). You have to answer q independent queries. Each query is the following: The first line contains two integers n and q ( 1 <= n, q <= 3 cdot 10^5 ) -- the number of bags and the number of queries, respectively. The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= 10^6 ) -- the number of gold coins in the i -th bag. The third line contains n integers b_1, b_2, ... , b_n ( 0 <= b_i <= 10^6 ) -- the number of silver coins in the i -th bag. Next q lines contain queries. The j -th of the next q lines contains two integers l_j and r_j ( 1 <= l_j <= r_j <= n ) -- the description of the j -th query. Additional constraints on the input: For each query, print one integer -- the probability that the total value of coins in bags from l to r is strictly greater than the total value in all other bags, taken modulo 998244353 . Formally, the probability can be expressed as an irreducible fraction frac{x}{y} . You have to print the value of x cdot y^{-1} bmod 998244353 , where y^{-1} is an integer such that y cdot y^{-1} bmod 998244353 = 1 . In both queries from the first example, the answer is frac{1}{4} . '...

Tutorials

Educational Codeforces Round 163 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
251592712 karamkontar F March 16, 2024, 12:38 a.m. OK C# 10 TESTS 37 1404 84684800
251598904 Dreiton F March 16, 2024, 2:21 a.m. OK C++14 (GCC 6-32) TESTS 37 405 26521600
251561536 honey F March 15, 2024, 6:48 p.m. OK C++14 (GCC 6-32) TESTS 37 405 40038400
251596493 TrendBattles F March 16, 2024, 1:44 a.m. OK C++14 (GCC 6-32) TESTS 37 420 14438400
251601656 luogu_bot3 F March 16, 2024, 3 a.m. OK C++14 (GCC 6-32) TESTS 37 420 32051200
251613778 EasonLiang F March 16, 2024, 5:16 a.m. OK C++14 (GCC 6-32) TESTS 37 420 34508800
251594263 duyipeng F March 16, 2024, 1:05 a.m. OK C++14 (GCC 6-32) TESTS 37 467 28876800
251618210 flying_saucer F March 16, 2024, 5:44 a.m. OK C++14 (GCC 6-32) TESTS 37 514 36864000
251598791 Grammar_hbw F March 16, 2024, 2:20 a.m. OK C++14 (GCC 6-32) TESTS 37 608 64102400
251599064 Grammar_hbw F March 16, 2024, 2:23 a.m. OK C++14 (GCC 6-32) TESTS 37 639 64102400
251592302 LeoChan2022 F March 16, 2024, 12:30 a.m. OK C++14 (GCC 6-32) TESTS 37 670 56115200
251603402 xiaoziyao F March 16, 2024, 3:22 a.m. OK C++17 (GCC 7-32) TESTS 37 389 28057600
251599590 yangsonghan F March 16, 2024, 2:31 a.m. OK C++17 (GCC 7-32) TESTS 37 389 28057600
251566359 UnstoppableChillMachine F March 15, 2024, 7:28 p.m. OK C++17 (GCC 7-32) TESTS 37 405 16793600
251609288 dqstz F March 16, 2024, 4:36 a.m. OK C++17 (GCC 7-32) TESTS 37 405 20070400
251552579 ttamx F March 15, 2024, 5:41 p.m. OK C++17 (GCC 7-32) TESTS 37 405 21299200
251569973 sh1ziku F March 15, 2024, 7:58 p.m. OK C++17 (GCC 7-32) TESTS 37 405 26419200
251595397 A_G F March 16, 2024, 1:25 a.m. OK C++17 (GCC 7-32) TESTS 37 420 10444800
251582817 abeker F March 15, 2024, 9:49 p.m. OK C++17 (GCC 7-32) TESTS 37 420 10444800
251602132 Hex-willappear F March 16, 2024, 3:06 a.m. OK C++17 (GCC 7-32) TESTS 37 420 14438400
251600988 Captainfly F March 16, 2024, 2:51 a.m. OK C++17 (GCC 7-32) TESTS 37 420 14745600
251606074 nguyenquocthao00 F March 16, 2024, 3:56 a.m. OK Go TESTS 37 358 57958400
251556286 dzhi F March 15, 2024, 6:07 p.m. OK Java 21 TESTS 37 701 35840000
251556041 dzhi F March 15, 2024, 6:05 p.m. OK Java 21 TESTS 37 717 36454400
251548603 Non-origination F March 15, 2024, 5:16 p.m. OK PyPy 3-64 TESTS 37 545 81510400
251599015 Little_Sheep_Yawn F March 16, 2024, 2:23 a.m. OK PyPy 3-64 TESTS 37 561 68300800
251600234 smilences F March 16, 2024, 2:41 a.m. OK PyPy 3-64 TESTS 37 561 85811200
251564470 OLOGY F March 15, 2024, 7:13 p.m. OK PyPy 3-64 TESTS 37 592 105472000
251602514 smilences F March 16, 2024, 3:11 a.m. OK PyPy 3-64 TESTS 37 608 83865600
251554197 yuki_keshiki F March 15, 2024, 5:52 p.m. OK PyPy 3-64 TESTS 37 717 99328000
251546755 hushbek_2009 F March 15, 2024, 5:06 p.m. OK PyPy 3-64 TESTS 37 717 110387200
251545334 Prashanth_KPY F March 15, 2024, 4:59 p.m. OK PyPy 3-64 TESTS 37 717 110387200
251545617 hushbek_2009 F March 15, 2024, 5 p.m. OK PyPy 3-64 TESTS 37 780 110387200
251571043 OLOGY F March 15, 2024, 8:07 p.m. OK PyPy 3-64 TESTS 37 858 157286400
251588667 kost F March 15, 2024, 11:17 p.m. OK Rust 2021 TESTS 37 374 41676800
251545429 andrey.m F March 15, 2024, 5 p.m. OK Rust 2021 TESTS 37 483 21811200

remove filters

Back to search problems