Dasha Code Championship - SPb Finals Round (only for onsite-finalists)

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
1210 Dasha Code Championship - SPb Finals Round (only for onsite-finalists) FINISHED False 9000 162680099 Sept. 22, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 408 ) E Wojtek and Card Tricks PROGRAMMING math 2700

B"Wojtek has just won a maths competition in Byteland! The prize is admirable -- a great book called 'Card Tricks for Everyone.' 'Great!' he thought, 'I can finally use this old, dusted deck of cards that's always been lying unused on my desk!' The first chapter of the book is 'How to Shuffle k Cards in Any Order You Want.' It's basically a list of n intricate methods of shuffling the deck of k cards in a deterministic way. Specifically, the i -th recipe can be described as a permutation (P_{i,1}, P_{i,2}, ... , P_{i,k}) of integers from 1 to k . If we enumerate the cards in the deck from 1 to k from top to bottom, then P_{i,j} indicates the number of the j -th card from the top of the deck after the shuffle. The day is short and Wojtek wants to learn only some of the tricks today. He will pick two integers l, r ( 1 <= l <= r <= n ), and he will memorize each trick from the l -th to the r -th, inclusive. He will then take a sorted deck of k cards and repeatedly apply random memorized tricks until he gets bored. He still likes maths, so he started wondering: how many different decks can he have after he stops shuffling it? Wojtek still didn't choose the integers l and r , but he is still curious. Therefore, he defined f(l, r) as the number of different decks he can get if he memorizes all the tricks between the l -th and the r -th, inclusive. What is the value of sum_{l=1}^n sum_{r=l}^n f(l, r)? The first line contains two integers n , k ( 1 <= n <= 200 ,000 , 1 <= k <= 5 ) -- the number of tricks and the number of cards in Wojtek's deck. Each of the following n lines describes a single trick and is described by k distinct integers P_{i,1}, P_{i,2}, ... , P_{i, k} ( 1 <= P_{i, j} <= k ). Output the value of the sum described in the statement. Consider the first sample: The firs"...

Tutorials

Dasha Code Championship Finals and Mirror Round 588 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
61219078 AuqaKyz E Sept. 24, 2019, 1:29 p.m. OK GNU C++11 TESTS 71 452 12185600 2700
61066254 cookiedoth E Sept. 22, 2019, 11:12 a.m. OK GNU C++14 TESTS 71 670 1433600 2700
62060541 LanrTabe E Oct. 7, 2019, 1:30 p.m. OK GNU C++14 TESTS 71 670 2457600 2700
61067152 niyaznigmatul E Sept. 22, 2019, 11:28 a.m. OK GNU C++14 TESTS 71 1263 1331200 2700
62616785 LODB---D E Oct. 15, 2019, 11:40 a.m. OK GNU C++14 TESTS 71 1372 1024000 2700
62617244 LODB---D E Oct. 15, 2019, 11:48 a.m. OK GNU C++14 TESTS 71 1404 1024000 2700
61719398 forgottencsc E Oct. 2, 2019, 1:24 p.m. OK GNU C++17 TESTS 71 998 52428800 2700
63082182 isaf27 E Oct. 21, 2019, 3:28 p.m. OK GNU C++17 TESTS 71 1138 1126400 2700
61064138 aid E Sept. 22, 2019, 10:27 a.m. OK GNU C++17 TESTS 71 1372 10035200 2700
61067289 Nebuchadnezzar E Sept. 22, 2019, 11:31 a.m. OK GNU C++17 TESTS 71 1637 1843200 2700
61067295 Arterm E Sept. 22, 2019, 11:31 a.m. OK GNU C++17 TESTS 71 2464 112844800 2700
61065204 BledDest E Sept. 22, 2019, 10:50 a.m. OK GNU C++17 TESTS 71 2496 2048000 2700
69597241 Slaaava E Jan. 27, 2020, 5:35 a.m. OK GNU C++17 TESTS 71 3150 12492800 2700
61067153 eatmore E Sept. 22, 2019, 11:28 a.m. OK Java 8 TESTS 71 638 0 2700
61066156 qwerty787788 E Sept. 22, 2019, 11:10 a.m. OK Java 8 TESTS 71 889 0 2700

remove filters

Back to search problems