Codeforces Round 896 (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
1868 Codeforces Round 896 (Div. 1) FINISHED False 9000 42825263 Sept. 10, 2023, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1193 ) C Travel Plan PROGRAMMING combinatorics divide and conquer dp math trees

B'During the summer vacation after Zhongkao examination, Tom and Daniel are planning to go traveling. There are n cities in their country, numbered from 1 to n . And the traffic system in the country is very special. For each city i ( 1 <= i <= n ), there is Making a travel plan, Daniel chooses some integer value between 1 and m for each city, for the i -th city we denote it by a_i . Let s_{i,j} be the maximum value of cities in the simple ^ dagger path between cities i and j . The score of the travel plan is sum_{i=1}^n sum_{j=i}^n s_{i,j} . Tom wants to know the sum of scores of all possible travel plans. Daniel asks you to help him find it. You just need to tell him the answer modulo 998 ,244 ,353 . ^ dagger A simple path between cities x and y is a path between them that passes through each city at most once. The first line of input contains a single integer t ( 1 <= t <= 200 ) -- the number of test cases. The description of test cases follows. The only line of each test case contains two integers n and m ( 1 <= q n <= q 10^{18} , 1 <= q m <= q 10^5 ) -- the number of the cities and the maximum value of a city. It is guaranteed that the sum of m over all test cases does not exceed 10^5 . For each test case output one integer -- the sum of scores of all possible travel plans, modulo 998 ,244 ,353 . In the first test case, there is only one possible travel plan: Path 1 rightarrow 1 : s_{1,1}=a_1=1 . Path 1 rightarrow 2 : s_{1,2}= max(1,1)=1 . Path 1 rightarrow 3 : s_{1,3}= max(1,1)=1 . Path 2 rightarrow 2 : s_{2,2}=a_2=1 . Path 2 rightarrow 1 rightarrow 3 : s_{2,3}= max(1,1,1)=1 . Path 3 rightarrow 3 : s_{3,3}=a_3=1 . The score is 1+1+1+1+1+1=6 . In the second test case, there are four possible travel plans: Score of plan 1 : 1+1+1=3 . '...

Tutorials

Codeforces Round 896 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
222757083 KumaTachiRen C Sept. 10, 2023, 2:55 p.m. OK C# 8 TESTS 63 467 15155200
222804549 Gassa C Sept. 10, 2023, 4:34 p.m. OK D TESTS 63 1528 153600000
222824996 MCPlayer542 C Sept. 10, 2023, 7:42 p.m. OK GNU C++14 TESTS 63 234 409600
222783498 xuanxuan001 C Sept. 10, 2023, 3:50 p.m. OK GNU C++14 TESTS 63 265 0
222793505 D_F_S C Sept. 10, 2023, 4:08 p.m. OK GNU C++14 TESTS 63 436 131481600
222779162 _Guoyh_ C Sept. 10, 2023, 3:40 p.m. OK GNU C++14 TESTS 63 452 0
222804347 amano_hina C Sept. 10, 2023, 4:33 p.m. OK GNU C++14 TESTS 63 483 108339200
222789948 wutongchun C Sept. 10, 2023, 4:01 p.m. OK GNU C++14 TESTS 63 561 0
222783144 yyyyxh C Sept. 10, 2023, 3:49 p.m. OK GNU C++14 TESTS 63 592 95948800
222778216 KevinYao C Sept. 10, 2023, 3:38 p.m. OK GNU C++14 TESTS 63 639 0
222844317 dengziyue C Sept. 11, 2023, 2:17 a.m. OK GNU C++14 TESTS 63 655 113766400
222823882 Hypercube07 C Sept. 10, 2023, 7:30 p.m. OK GNU C++14 TESTS 63 748 97894400
222794942 brianhsu7476 C Sept. 10, 2023, 4:11 p.m. OK GNU C++17 TESTS 63 171 1228800
222838129 sharaelong C Sept. 10, 2023, 11:57 p.m. OK GNU C++17 TESTS 63 311 102195200
222797648 gabrielwu C Sept. 10, 2023, 4:18 p.m. OK GNU C++17 TESTS 63 312 512000
222794741 Ilya_MSU C Sept. 10, 2023, 4:11 p.m. OK GNU C++17 TESTS 63 312 10854400
222835977 ZPAYAUR C Sept. 10, 2023, 10:53 p.m. OK GNU C++17 TESTS 63 374 512000
222766928 hos.lyric C Sept. 10, 2023, 3:13 p.m. OK GNU C++17 TESTS 63 389 307200
222766442 potato167 C Sept. 10, 2023, 3:13 p.m. OK GNU C++17 TESTS 63 468 614400
222798667 Ant_Man C Sept. 10, 2023, 4:21 p.m. OK GNU C++17 TESTS 63 499 10854400
222769633 Nachia C Sept. 10, 2023, 3:19 p.m. OK GNU C++17 TESTS 63 499 49254400
222837796 geruome C Sept. 10, 2023, 11:47 p.m. OK GNU C++17 TESTS 63 546 921600
222793718 tute7627 C Sept. 10, 2023, 4:08 p.m. OK GNU C++17 (64) TESTS 63 78 102400
222778091 Warriors_fsy C Sept. 10, 2023, 3:37 p.m. OK GNU C++17 (64) TESTS 63 78 6041600
222839745 wangyian2022 C Sept. 11, 2023, 12:39 a.m. OK GNU C++17 (64) TESTS 63 108 65024000
222756124 amiya C Sept. 10, 2023, 2:53 p.m. OK GNU C++17 (64) TESTS 63 124 6348800
222751686 Geothermal C Sept. 10, 2023, 2:46 p.m. OK GNU C++17 (64) TESTS 63 124 10752000
222839534 wangyian2022 C Sept. 11, 2023, 12:35 a.m. OK GNU C++17 (64) TESTS 63 124 128000000
222810807 Siberian C Sept. 10, 2023, 5:35 p.m. OK GNU C++17 (64) TESTS 63 139 6451200
222810846 Siberian C Sept. 10, 2023, 5:35 p.m. OK GNU C++17 (64) TESTS 63 140 6144000
222763920 1004535809 C Sept. 10, 2023, 3:07 p.m. OK GNU C++17 (64) TESTS 63 155 102400
222760340 YamadaRyo C Sept. 10, 2023, 3:01 p.m. OK GNU C++17 (64) TESTS 63 155 31027200
222834195 maxplus C Sept. 10, 2023, 10:08 p.m. OK GNU C++20 (64) TESTS 63 62 204800
222775741 Egor.Lifar C Sept. 10, 2023, 3:32 p.m. OK GNU C++20 (64) TESTS 63 62 6963200
222782739 grass8sheep C Sept. 10, 2023, 3:48 p.m. OK GNU C++20 (64) TESTS 63 78 819200
222790597 Daniel777 C Sept. 10, 2023, 4:02 p.m. OK GNU C++20 (64) TESTS 63 78 921600
222764056 Ormlis C Sept. 10, 2023, 3:08 p.m. OK GNU C++20 (64) TESTS 63 78 6144000
222772300 Nyaan C Sept. 10, 2023, 3:25 p.m. OK GNU C++20 (64) TESTS 63 78 6348800
222832064 rowechen C Sept. 10, 2023, 9:23 p.m. OK GNU C++20 (64) TESTS 63 93 0
222778415 Brovko C Sept. 10, 2023, 3:38 p.m. OK GNU C++20 (64) TESTS 63 93 409600
222830620 czhang2718 C Sept. 10, 2023, 8:57 p.m. OK GNU C++20 (64) TESTS 63 93 512000
222830490 czhang2718 C Sept. 10, 2023, 8:55 p.m. OK GNU C++20 (64) TESTS 63 93 614400
222822398 golions C Sept. 10, 2023, 7:14 p.m. OK Java 8 TESTS 63 1637 132198400
222766914 FastFreeTask C Sept. 10, 2023, 3:13 p.m. OK Kotlin 1.6 TESTS 63 1871 241356800
222763392 conqueror_of_tourist C Sept. 10, 2023, 3:06 p.m. OK PyPy 3-64 TESTS 63 343 17408000
222757238 chinerist C Sept. 10, 2023, 2:55 p.m. OK PyPy 3-64 TESTS 63 638 26316800
222799589 misorin C Sept. 10, 2023, 4:23 p.m. OK PyPy 3-64 TESTS 63 810 9728000
222831143 codicon C Sept. 10, 2023, 9:05 p.m. OK PyPy 3-64 TESTS 63 982 9728000
222830932 codicon C Sept. 10, 2023, 9:02 p.m. OK PyPy 3-64 TESTS 63 998 9625600
222830809 codicon C Sept. 10, 2023, 9 p.m. OK PyPy 3-64 TESTS 63 1013 9728000
222831047 codicon C Sept. 10, 2023, 9:04 p.m. OK PyPy 3-64 TESTS 63 1014 9932800
222789370 whatshisbucket C Sept. 10, 2023, 4 p.m. OK PyPy 3-64 TESTS 63 1138 58368000
222762673 toam C Sept. 10, 2023, 3:05 p.m. OK PyPy 3-64 TESTS 63 1326 140288000
222800026 bronze_coder C Sept. 10, 2023, 4:24 p.m. OK PyPy 3-64 TESTS 63 1465 179200000

remove filters

Back to search problems