CodeTON Round 8 (Div. 1 + Div. 2, Rated, Prizes!)

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
1942 CodeTON Round 8 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 10800 20013899 March 30, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 453 ) G Bessie and Cards PROGRAMMING combinatorics math

B'Bessie has recently started playing a famous card game. In the game, there is only one deck of cards, consisting of a "draw 0 " cards, b "draw 1 " cards, c "draw 2 " cards, and 5 special cards. At the start of the game, all cards are in the randomly shuffled deck. Bessie starts the game by drawing the top 5 cards of the deck. She may then play "draw x " cards from the hand to draw the next x cards from the top of the deck. Note that every card can only be played once, special cards cannot be played, and if Bessie uses a "draw 2 " card when there is only 1 card remaining in the deck, then she simply draws that remaining card. Bessie wins if she draws all 5 special cards. Since Bessie is not very good at math problems, she wants you to find the probability that she wins, given that the deck is shuffled randomly over all (a + b + c + 5)! possible orderings. It can be shown that this answer can always be expressed as a fraction frac{p}{q} where p and q are coprime integers. Output p cdot q^{-1} modulo 998 ,244 ,353 . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case contains three integers a , b , and c ( 0 <= a, b, c <= 2 cdot 10^5 ) xe2 x80 x93 the number of draw 0 cards, draw 1 cards, and draw 2 cards, respectively. It is guaranteed that the sum of a over all test cases does not exceed 2 cdot 10^5 , the sum of b over all test cases does not exceed 2 cdot 10^5 , and the sum of c over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the probability that Bessie wins, modulo 998 ,244 ,353 . In the first case, we have 1 of each type of "draw" card and 5 special cards. There are 30 ,720 starting decks where Bessie will win by drawing the top 5 '...

Tutorials

CodeTON Round 8 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
254202542 jinqihao2026 G March 30, 2024, 6:26 p.m. OK C++14 (GCC 6-32) TESTS 47 62 7987200
254203923 alice_ssoi G March 30, 2024, 6:35 p.m. OK C++14 (GCC 6-32) TESTS 47 78 7372800
254196907 ppltn G March 30, 2024, 5:31 p.m. OK C++14 (GCC 6-32) TESTS 47 155 48128000
254244012 wzc_IOI_czw G March 31, 2024, 4:50 a.m. OK C++17 (GCC 7-32) TESTS 47 62 9728000
254218944 Kilani G March 30, 2024, 9:09 p.m. OK C++17 (GCC 7-32) TESTS 47 77 4915200
254191851 spaceN G March 30, 2024, 5:15 p.m. OK C++17 (GCC 7-32) TESTS 47 77 8089600
254202333 Ormlis G March 30, 2024, 6:25 p.m. OK C++17 (GCC 7-32) TESTS 47 77 15564800
254187855 Potassium G March 30, 2024, 5:02 p.m. OK C++17 (GCC 7-32) TESTS 47 78 16076800
254203428 zlc1114_v2 G March 30, 2024, 6:32 p.m. OK C++17 (GCC 7-32) TESTS 47 78 19251200
254214583 yutabi G March 30, 2024, 8:17 p.m. OK C++17 (GCC 7-32) TESTS 47 92 24166400
254202625 zhangjianjuncd G March 30, 2024, 6:27 p.m. OK C++17 (GCC 7-32) TESTS 47 108 12902400
254195845 alireza_kaviani G March 30, 2024, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 47 124 24064000
254197192 never_giveup G March 30, 2024, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 47 140 8396800
254195039 Sugar_fan G March 30, 2024, 5:26 p.m. OK C++20 (GCC 13-64) TESTS 47 31 6451200
254247262 flying G March 31, 2024, 5:27 a.m. OK C++20 (GCC 13-64) TESTS 47 31 12083200
254196690 PinkieRabbit G March 30, 2024, 5:31 p.m. OK C++20 (GCC 13-64) TESTS 47 31 12083200
254188876 RobertoFirmino G March 30, 2024, 5:06 p.m. OK C++20 (GCC 13-64) TESTS 47 31 16793600
254241093 JCY_ G March 31, 2024, 4:08 a.m. OK C++20 (GCC 13-64) TESTS 47 46 5632000
254244878 yaoxi G March 31, 2024, 5:02 a.m. OK C++20 (GCC 13-64) TESTS 47 46 8089600
254225113 AmirAli-Asgari G March 30, 2024, 10:53 p.m. OK C++20 (GCC 13-64) TESTS 47 46 9625600
254204007 A_G G March 30, 2024, 6:36 p.m. OK C++20 (GCC 13-64) TESTS 47 61 3276800
254234736 return20071007 G March 31, 2024, 2:20 a.m. OK C++20 (GCC 13-64) TESTS 47 61 8089600
254243021 propane G March 31, 2024, 4:37 a.m. OK C++20 (GCC 13-64) TESTS 47 61 8806400
254203112 rainboy G March 30, 2024, 6:30 p.m. OK GNU C11 TESTS 47 93 5120000
254186188 bronze_coder G March 30, 2024, 4:57 p.m. OK PyPy 3-64 TESTS 47 826 41984000
254185572 sansen G March 30, 2024, 4:55 p.m. OK Rust 2021 TESTS 47 108 7680000

remove filters

Back to search problems