Codeforces Round 853 (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
1789 Codeforces Round 853 (Div. 2) FINISHED False 7200 59845163 Feb. 25, 2023, 2:20 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 840 ) E Serval and Music Game PROGRAMMING brute force combinatorics implementation math number theory

B'Serval loves playing music games. He meets a problem when playing music games, and he leaves it for you to solve. You are given n positive integers s_1 < s_2 < ldots < s_n . f(x) is defined as the number of i ( 1 <= q i <= q n ) that exist non-negative integers p_i, q_i such that: s_i=p_i <= ft lfloor{s_n over x} right rfloor + q_i <= ft lceil{s_n over x} right rceil Find out sum_{x=1}^{s_n} x cdot f(x) modulo 998 ,244 ,353 . As a reminder, lfloor x rfloor denotes the maximal integer that is no greater than x , and lceil x rceil denotes the minimal integer that is no less than x . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). The description of the test cases follows. The first line of each test cases contains a single integer n ( 1 <= q n <= q 10^6 ). The second line of each test case contains n positive integers s_1,s_2, ldots,s_n ( 1 <= q s_1 < s_2 < ldots < s_n <= q 10^7 ). It is guaranteed that the sum of n over all test cases does not exceed 10^6 , and the sum of s_n does not exceed 10^7 . For each test case, print a single integer in a single line -- the sum of x cdot f(x) over all possible x modulo 998 ,244 ,353 . For the first test case, s_n=4 , f(x) are calculated as followings: Therefore, the answer is sum_{x=1}^4 x cdot f(x) = 1 cdot 1 + 2 cdot 2 + 3 cdot 3 + 4 cdot 3 = 26 . For the second test case: For example, when x=3 we have f(3)=1 because there exist p_4 and q_4 : 9 = 1 cdot <= ft lfloor{9 over 3} right rfloor + 2 cdot <= ft lceil{9 over 3} right rceil It can be shown that it is impossible to find p_1,p_2,p_3 and q_1,q_2,q_3 that satisfy the conditions. When x=5 we have f(5)=4 because there exist p_i and q_i as followings: 1 = 1 '...

Tutorials

Codeforces Round #853 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
195005200 Z-301 E Feb. 26, 2023, 1:18 a.m. OK GNU C++14 TESTS 68 608 80281600
194962685 stkwill E Feb. 25, 2023, 3:49 p.m. OK GNU C++14 TESTS 68 670 40038400
195011639 liaopengfei E Feb. 26, 2023, 4:09 a.m. OK GNU C++14 TESTS 68 733 44134400
194959369 CoCl2_6H2O E Feb. 25, 2023, 3:38 p.m. OK GNU C++14 TESTS 68 779 80179200
195010840 lprdsb E Feb. 26, 2023, 3:48 a.m. OK GNU C++14 TESTS 68 779 120217600
195013210 Xu_Hongxi E Feb. 26, 2023, 4:44 a.m. OK GNU C++14 TESTS 68 810 164352000
195009794 Illumina_ E Feb. 26, 2023, 3:21 a.m. OK GNU C++14 TESTS 68 842 124313600
195007822 wzc_IOI_czw E Feb. 26, 2023, 2:28 a.m. OK GNU C++14 TESTS 68 857 164352000
194981562 2022lishujia E Feb. 25, 2023, 6:03 p.m. OK GNU C++14 TESTS 68 857 168345600
194969536 mwzqwq E Feb. 25, 2023, 4:15 p.m. OK GNU C++14 TESTS 68 889 84172800
194975465 muxingchengfeng E Feb. 25, 2023, 5:10 p.m. OK GNU C++17 TESTS 68 592 80793600
194999380 FzArK E Feb. 25, 2023, 10:21 p.m. OK GNU C++17 TESTS 68 686 40038400
194969150 qjatn0120 E Feb. 25, 2023, 4:14 p.m. OK GNU C++17 TESTS 68 686 44441600
194977630 ghoul932 E Feb. 25, 2023, 5:27 p.m. OK GNU C++17 TESTS 68 686 84377600
194983865 zhanxufeng E Feb. 25, 2023, 6:28 p.m. OK GNU C++17 TESTS 68 732 44134400
194966959 Marckess E Feb. 25, 2023, 4:05 p.m. OK GNU C++17 TESTS 68 732 80179200
195009606 Falcon__ E Feb. 26, 2023, 3:15 a.m. OK GNU C++17 TESTS 68 733 124211200
194979100 Mtaylor E Feb. 25, 2023, 5:40 p.m. OK GNU C++17 TESTS 68 779 44134400
194980262 ovd0312 E Feb. 25, 2023, 5:52 p.m. OK GNU C++17 TESTS 68 780 164352000
194960890 NegaTeeF E Feb. 25, 2023, 3:43 p.m. OK GNU C++17 TESTS 68 795 84172800
194973943 kotatsugame E Feb. 25, 2023, 5:01 p.m. OK GNU C++17 (64) TESTS 68 467 84377600
194974405 UltramanDecker E Feb. 25, 2023, 5:04 p.m. OK GNU C++17 (64) TESTS 68 639 44441600
194969240 Kude E Feb. 25, 2023, 4:14 p.m. OK GNU C++17 (64) TESTS 68 795 84172800
194961594 MateoCV E Feb. 25, 2023, 3:46 p.m. OK GNU C++17 (64) TESTS 68 811 88166400
194963057 rniya E Feb. 25, 2023, 3:51 p.m. OK GNU C++17 (64) TESTS 68 998 84377600
194960059 deepak_sriram E Feb. 25, 2023, 3:40 p.m. OK GNU C++17 (64) TESTS 68 1013 44134400
195006663 enslaved E Feb. 26, 2023, 1:59 a.m. OK GNU C++17 (64) TESTS 68 1013 85401600
194974403 blienware E Feb. 25, 2023, 5:04 p.m. OK GNU C++17 (64) TESTS 68 1028 44134400
195012703 Cxny E Feb. 26, 2023, 4:34 a.m. OK GNU C++17 (64) TESTS 68 1107 164352000
194973828 DmitryLzr E Feb. 25, 2023, 5:01 p.m. OK GNU C++17 (64) TESTS 68 1169 104243200
194974501 Hassan111 E Feb. 25, 2023, 5:04 p.m. OK GNU C++20 (64) TESTS 68 405 54579200
194979153 Fysty E Feb. 25, 2023, 5:40 p.m. OK GNU C++20 (64) TESTS 68 436 44134400
194968393 pac_needs_more_happiness E Feb. 25, 2023, 4:11 p.m. OK GNU C++20 (64) TESTS 68 467 44134400
194994117 huangxiaohua E Feb. 25, 2023, 8:46 p.m. OK GNU C++20 (64) TESTS 68 468 134963200
195015685 jinmingli E Feb. 26, 2023, 5:27 a.m. OK GNU C++20 (64) TESTS 68 483 44134400
195007675 1205691775 E Feb. 26, 2023, 2:24 a.m. OK GNU C++20 (64) TESTS 68 483 44134400
195005984 A_G E Feb. 26, 2023, 1:41 a.m. OK GNU C++20 (64) TESTS 68 514 84172800
194976178 MridulAhi E Feb. 25, 2023, 5:15 p.m. OK GNU C++20 (64) TESTS 68 514 164352000
194973545 nifeshe E Feb. 25, 2023, 4:59 p.m. OK GNU C++20 (64) TESTS 68 514 168652800
194968508 nifek E Feb. 25, 2023, 4:12 p.m. OK GNU C++20 (64) TESTS 68 514 168652800
194980321 blue_ice_yj E Feb. 25, 2023, 5:52 p.m. OK Go TESTS 68 1013 91750400
195015105 dzhi E Feb. 26, 2023, 5:18 a.m. OK Java 11 TESTS 68 1887 59187200
195015289 dzhi E Feb. 26, 2023, 5:21 a.m. OK Java 11 TESTS 68 1903 59187200
194970830 misorin E Feb. 25, 2023, 4:19 p.m. OK PyPy 3-64 TESTS 68 1325 159232000
194988586 zouyu9631 E Feb. 25, 2023, 7:24 p.m. OK PyPy 3-64 TESTS 68 1357 158310400
194999105 SugoiTurtle E Feb. 25, 2023, 10:15 p.m. OK PyPy 3-64 TESTS 68 1403 158822400
195011413 ZrjaK E Feb. 26, 2023, 4:03 a.m. OK PyPy 3-64 TESTS 68 1419 132403200
194964037 hxu10 E Feb. 25, 2023, 3:54 p.m. OK PyPy 3-64 TESTS 68 1700 157696000
194988528 zouyu9631 E Feb. 25, 2023, 7:23 p.m. OK PyPy 3-64 TESTS 68 1902 158617600
194988428 zouyu9631 E Feb. 25, 2023, 7:22 p.m. OK PyPy 3-64 TESTS 68 1949 158822400
194987205 zouyu9631 E Feb. 25, 2023, 7:06 p.m. OK PyPy 3-64 TESTS 68 1949 158822400
194988179 zouyu9631 E Feb. 25, 2023, 7:19 p.m. OK PyPy 3-64 TESTS 68 1949 159641600

remove filters

Back to search problems