Codeforces Round 854 by cybercats (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
1799 Codeforces Round 854 by cybercats (Div. 1 + Div. 2) FINISHED False 10800 59757863 Feb. 27, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 815 ) G Count Voting PROGRAMMING combinatorics dp math

B"There are n people that will participate in voting. Each person has exactly one vote. i -th person has a team t_i ( 1 <= q t_i <= q n ) where t_i = t_j means i , j are in the same team. By the rules each person should vote for the person from the different team. Note that it automatically means that each person can't vote for himself. Each person knows the number of votes c_i he wants to get. How many possible votings exists, such that each person will get the desired number of votes? Due to this number can be big, find it by modulo 998 ,244 ,353 . The first line contains a single integer n ( 1 <= q n <= q 200 ) -- the number of people. The second line contains n integers c_1, c_2, ldots, c_n ( 0 <= q c_i <= q n ) -- desired number of votes. It is guaranteed, that sum limits_{i=1}^{n} c_i = n . The third line contains n integers t_1, t_2, ldots, t_n ( 1 <= q t_i <= q n ) -- team numbers. Print a single integer -- the number of possible votings by modulo 998 ,244 ,353 . In the first test there are two possible votings: (2, 3, 1) , (3, 1, 2) . In the third test there are five possible votings: (3, 3, 2, 2, 1) , (2, 3, 2, 3, 1) , (3, 3, 1, 2, 2) , (3, 1, 2, 3, 2) , (2, 3, 1, 3, 2) . "...

Tutorials

Codeforces Round #854 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
195187630 hhhh531889330 G Feb. 27, 2023, 5:26 p.m. OK GNU C++14 TESTS 57 15 0
195221893 Chinese_zjc_ G Feb. 28, 2023, 2:20 a.m. OK GNU C++14 TESTS 57 15 204800
195221614 realFZzzz G Feb. 28, 2023, 2:13 a.m. OK GNU C++14 TESTS 57 15 204800
195219764 glq_C G Feb. 28, 2023, 1:16 a.m. OK GNU C++14 TESTS 57 15 716800
195189727 stkwill G Feb. 27, 2023, 5:34 p.m. OK GNU C++14 TESTS 57 30 0
195218751 _Diu_ G Feb. 28, 2023, 12:42 a.m. OK GNU C++14 TESTS 57 31 204800
195175365 CoCl2_6H2O G Feb. 27, 2023, 4:31 p.m. OK GNU C++14 TESTS 57 31 307200
195189077 Bartol G Feb. 27, 2023, 5:32 p.m. OK GNU C++14 TESTS 57 31 512000
195183641 william556 G Feb. 27, 2023, 5:08 p.m. OK GNU C++14 TESTS 57 31 716800
195222272 hzr G Feb. 28, 2023, 2:29 a.m. OK GNU C++14 TESTS 57 31 1433600
195189261 square1001 G Feb. 27, 2023, 5:32 p.m. OK GNU C++17 TESTS 57 15 204800
195182654 Lightnessqwq G Feb. 27, 2023, 5:03 p.m. OK GNU C++17 TESTS 57 15 204800
195180362 jumpmelon G Feb. 27, 2023, 4:53 p.m. OK GNU C++17 TESTS 57 15 204800
195192639 DerekFeng G Feb. 27, 2023, 6:04 p.m. OK GNU C++17 TESTS 57 15 307200
195197280 AliShahali1382 G Feb. 27, 2023, 6:39 p.m. OK GNU C++17 TESTS 57 15 409600
195178034 gisp_zjz G Feb. 27, 2023, 4:42 p.m. OK GNU C++17 TESTS 57 15 12185600
195223365 Marckess G Feb. 28, 2023, 2:56 a.m. OK GNU C++17 TESTS 57 31 409600
195225373 vjudge2 G Feb. 28, 2023, 3:38 a.m. OK GNU C++17 TESTS 57 31 716800
195188519 liympanda G Feb. 27, 2023, 5:30 p.m. OK GNU C++17 TESTS 57 31 1126400
195189521 RiCHEPCPR G Feb. 27, 2023, 5:33 p.m. OK GNU C++17 TESTS 57 31 83558400
195226851 vjudge5 G Feb. 28, 2023, 4:05 a.m. OK GNU C++17 (64) TESTS 57 15 0
195224839 Giga_Cronos G Feb. 28, 2023, 3:28 a.m. OK GNU C++17 (64) TESTS 57 15 0
195221061 q-w-q-w-q G Feb. 28, 2023, 1:56 a.m. OK GNU C++17 (64) TESTS 57 15 0
195186720 Nyaan G Feb. 27, 2023, 5:22 p.m. OK GNU C++17 (64) TESTS 57 15 0
195185078 frokaikan G Feb. 27, 2023, 5:15 p.m. OK GNU C++17 (64) TESTS 57 15 0
195182753 BeyondHeaven G Feb. 27, 2023, 5:04 p.m. OK GNU C++17 (64) TESTS 57 15 0
195179240 triple__a G Feb. 27, 2023, 4:48 p.m. OK GNU C++17 (64) TESTS 57 15 0
195176781 Toxtricity G Feb. 27, 2023, 4:37 p.m. OK GNU C++17 (64) TESTS 57 15 0
195224383 Lynkcat G Feb. 28, 2023, 3:18 a.m. OK GNU C++17 (64) TESTS 57 15 102400
195192406 SPD_9X2 G Feb. 27, 2023, 6:04 p.m. OK GNU C++17 (64) TESTS 57 15 102400
195228132 Roundgod G Feb. 28, 2023, 4:30 a.m. OK GNU C++20 (64) TESTS 57 15 0
195223198 platelet G Feb. 28, 2023, 2:52 a.m. OK GNU C++20 (64) TESTS 57 15 0
195221014 kimoyami G Feb. 28, 2023, 1:54 a.m. OK GNU C++20 (64) TESTS 57 15 0
195188627 Asuka G Feb. 27, 2023, 5:30 p.m. OK GNU C++20 (64) TESTS 57 15 0
195188178 Kite_kuma G Feb. 27, 2023, 5:28 p.m. OK GNU C++20 (64) TESTS 57 15 0
195187618 Aus21 G Feb. 27, 2023, 5:26 p.m. OK GNU C++20 (64) TESTS 57 15 0
195186288 Golovanov399 G Feb. 27, 2023, 5:20 p.m. OK GNU C++20 (64) TESTS 57 15 0
195184510 Kapt G Feb. 27, 2023, 5:12 p.m. OK GNU C++20 (64) TESTS 57 15 0
195184307 risujiroh G Feb. 27, 2023, 5:11 p.m. OK GNU C++20 (64) TESTS 57 15 0
195182100 crazy_sea G Feb. 27, 2023, 5:01 p.m. OK GNU C++20 (64) TESTS 57 15 0
195213664 fetetriste G Feb. 27, 2023, 10:22 p.m. OK Java 8 TESTS 57 233 0
195178649 FastFreeTask G Feb. 27, 2023, 4:45 p.m. OK Kotlin 1.6 TESTS 57 233 409600
195181511 Beduardo G Feb. 27, 2023, 4:58 p.m. OK Kotlin 1.6 TESTS 57 249 921600
195217686 toam G Feb. 28, 2023, 12:10 a.m. OK PyPy 3-64 TESTS 57 93 10342400
195185537 chinerist G Feb. 27, 2023, 5:17 p.m. OK PyPy 3-64 TESTS 57 155 11161600
195171067 Egor G Feb. 27, 2023, 4:14 p.m. OK Rust 2021 TESTS 57 61 65126400

remove filters

Back to search problems