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 |
---|---|---|---|---|---|---|
1081 | Avito Cool Challenge 2018 | FINISHED | False | 9000 | 192554723 | Dec. 16, 2018, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 406 ) | G | Mergesort Strikes Back | PROGRAMMING | math probabilities | 3000 |
B'Chouti thought about his very first days in competitive programming. When he had just learned to write merge sort, he thought that the merge sort is too slow, so he restricted the maximum depth of recursion and modified the merge sort to the following: Chouti found his idea dumb since obviously, this "merge sort" sometimes cannot sort the array correctly. However, Chouti is now starting to think of how good this "merge sort" is. Particularly, Chouti wants to know for a random permutation a of 1, 2, ldots, n the expected number of inversions after calling MergeSort(a, 1, n, k). It can be proved that the expected number is rational. For the given prime q , suppose the answer can be denoted by frac{u}{d} where gcd(u,d)=1 , you need to output an integer r satisfying 0 <= r<q and rd equiv u pmod q . It can be proved that such r exists and is unique. The first and only line contains three integers n, k, q ( 1 <= q n, k <= q 10^5, 10^8 <= q q <= q 10^9 , q is a prime). The first and only line contains an integer r . In the first example, all possible permutations are [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1] . With k=1 , MergeSort(a, 1, n, k) will only return the original permutation. Thus the answer is 9/6=3/2 , and you should output 499122178 because 499122178 x 2 equiv 3 pmod {998244353} . In the second example, all possible permutations are [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1] and the corresponding outputs of MergeSort(a, 1, n, k) are [1,2,3],[1,2,3],[2,1,3],[1,2,3],[2,3,1],[1,3,2] respectively. Thus the answer is 4/6=2/3 , and you should output 665496236 because 665496236 x 3 equiv 2 pmod {998244353} . '... |
63888 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
57735219 | py_ultron | G | July 25, 2019, 9:45 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 614400 | 3000 | |
66840153 | luogu_bot4 | G | Dec. 14, 2019, 11:24 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
61822872 | zxyoi | G | Oct. 4, 2019, 3:12 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
61529891 | ymz | G | Sept. 30, 2019, 2:13 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
55561200 | Miracle_2001 | G | June 14, 2019, 12:45 p.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
54502790 | luogu_bot2 | G | May 23, 2019, 12:18 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
54502762 | 207M | G | May 23, 2019, 12:15 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
47183471 | yasugongshang | G | Dec. 18, 2018, 12:43 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 819200 | 3000 | |
47259878 | Feeey | G | Dec. 19, 2018, 11:56 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 1228800 | 3000 | |
50270802 | orzwaz | G | Feb. 21, 2019, 7:10 a.m. | OK | GNU C++11 | TESTS | 128 | 31 | 1638400 | 3000 | |
47624130 | tmwilliamlin168 | G | Dec. 28, 2018, 2:14 p.m. | OK | GNU C++14 | TESTS | 128 | 30 | 1638400 | 3000 | |
47188655 | yfzcsc | G | Dec. 18, 2018, 10:59 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 409600 | 3000 | |
48655307 | ReaLNero1 | G | Jan. 21, 2019, 2:10 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 819200 | 3000 | |
47518807 | zjsdut | G | Dec. 26, 2018, 11:45 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 819200 | 3000 | |
47158863 | gaurav_pandey | G | Dec. 17, 2018, 8:36 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 819200 | 3000 | |
47148938 | djq_cpp | G | Dec. 17, 2018, 5:24 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 819200 | 3000 | |
47524497 | krijgertje | G | Dec. 26, 2018, 3:04 p.m. | OK | GNU C++14 | TESTS | 128 | 31 | 1843200 | 3000 | |
47711232 | Toxel | G | Dec. 30, 2018, 3:43 a.m. | OK | GNU C++14 | TESTS | 128 | 31 | 2457600 | 3000 | |
54882343 | cloudsky01 | G | May 31, 2019, 3:03 p.m. | OK | GNU C++14 | TESTS | 128 | 46 | 819200 | 3000 | |
47289396 | consecutivelimit | G | Dec. 20, 2018, 8:15 a.m. | OK | GNU C++14 | TESTS | 128 | 46 | 819200 | 3000 | |
54505290 | CMXRYNP | G | May 23, 2019, 3:10 a.m. | OK | GNU C++17 | TESTS | 128 | 31 | 819200 | 3000 | |
50709144 | zhaimingshuzms | G | March 3, 2019, 5:57 a.m. | OK | GNU C++17 | TESTS | 128 | 31 | 819200 | 3000 | |
54700995 | hbi1998 | G | May 26, 2019, 11:25 p.m. | OK | GNU C++17 | TESTS | 128 | 31 | 921600 | 3000 | |
56060378 | Isonan | G | June 26, 2019, 5:04 a.m. | OK | GNU C++17 | TESTS | 128 | 46 | 1638400 | 3000 | |
47726319 | jonofarc | G | Dec. 30, 2018, 2:27 p.m. | OK | GNU C++17 | TESTS | 128 | 62 | 1433600 | 3000 | |
47263745 | AwD | G | Dec. 19, 2018, 1:27 p.m. | OK | GNU C++17 | TESTS | 128 | 62 | 2048000 | 3000 | |
54785030 | HirasawaaYui | G | May 29, 2019, 3:02 a.m. | OK | GNU C++17 | TESTS | 128 | 93 | 819200 | 3000 | |
62608271 | sigma425 | G | Oct. 15, 2019, 8:42 a.m. | OK | GNU C++17 | TESTS | 128 | 93 | 1433600 | 3000 | |
47180257 | majk | G | Dec. 17, 2018, 8:11 p.m. | OK | GNU C++17 | TESTS | 128 | 93 | 1638400 | 3000 | |
47123603 | V--o_o--V | G | Dec. 16, 2018, 3:29 p.m. | OK | GNU C++17 | TESTS | 128 | 93 | 2662400 | 3000 |
Back to search problems