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 |
---|---|---|---|---|---|---|
1089 | 2018-2019 ICPC, NEERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 188088899 | Dec. 2, 2018, 7:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 382 ) | I | Interval-Free Permutations | PROGRAMMING | 2800 |
B'Consider a permutation p_1, p_2, ... p_n of integers from 1 to n . We call a sub-segment p_l, p_{l+1}, ... , p_{r-1}, p_{r} of the permutation an interval if it is a reordering of some set of consecutive integers. For example, the permutation (6,7,1,8,5,3,2,4) has the intervals (6,7) , (5,3,2,4) , (3,2) , and others. Each permutation has some trivial intervals -- the full permutation itself and every single element. We call a permutation interval-free if it does not have non-trivial intervals. In other words, interval-free permutation does not have intervals of length between 2 and n - 1 inclusive. Your task is to count the number of interval-free permutations of length n modulo prime number p . In the first line of the input there are two integers t ( 1 <= t <= 400 ) and p ( 10^8 <= p <= 10^9 ) -- the number of test cases to solve and the prime modulo. In each of the next t lines there is one integer n ( 1 <= n <= 400 ) -- the length of the permutation. For each of t test cases print a single integer -- the number of interval-free permutations modulo p . For n = 1 the only permutation is interval-free. For n = 4 two interval-free permutations are (2,4,1,3) and (3,1,4,2) . For n = 5 -- (2,4,1,5,3) , (2,5,3,1,4) , (3,1,5,2,4) , (3,5,1,4,2) , (4,1,3,5,2) , and (4,2,5,1,3) . We will not list all 28146 for n = 9 , but for example (4,7,9,5,1,8,2,6,3) , (2,4,6,1,9,7,3,8,5) , (3,6,9,4,1,5,8,2,7) , and (8,4,9,1,3,6,2,7,5) are interval-free. The exact value for n = 20 is 264111424634864638. '... |
T |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
46654498 | psaini | I | Dec. 5, 2018, 3:37 p.m. | OK | GNU C11 | TESTS | 8 | 15 | 0 | 2800 | |
46654232 | psaini | I | Dec. 5, 2018, 3:29 p.m. | OK | GNU C11 | TESTS | 8 | 15 | 0 | 2800 | |
48654601 | ReaLNero1 | I | Jan. 21, 2019, 1:40 a.m. | OK | GNU C11 | TESTS | 8 | 31 | 0 | 2800 | |
52632075 | ezhjw | I | April 12, 2019, 7:41 a.m. | OK | GNU C++11 | TESTS | 8 | 93 | 716800 | 2800 | |
52880791 | ql_wpc | I | April 16, 2019, 11:51 p.m. | OK | GNU C++11 | TESTS | 8 | 93 | 819200 | 2800 | |
49121505 | nhho | I | Jan. 28, 2019, 7:34 p.m. | OK | GNU C++11 | TESTS | 8 | 93 | 1331200 | 2800 | |
46926618 | samjia2000 | I | Dec. 12, 2018, 9:06 a.m. | OK | GNU C++11 | TESTS | 8 | 93 | 1331200 | 2800 | |
46532357 | yasugongshang | I | Dec. 3, 2018, 6:38 a.m. | OK | GNU C++11 | TESTS | 8 | 93 | 1331200 | 2800 | |
52623125 | was_n | I | April 12, 2019, 12:06 a.m. | OK | GNU C++11 | TESTS | 8 | 109 | 1024000 | 2800 | |
46928604 | lyh | I | Dec. 12, 2018, 10:20 a.m. | OK | GNU C++11 | TESTS | 8 | 140 | 614400 | 2800 | |
46815782 | zhouyuyang | I | Dec. 9, 2018, 12:28 p.m. | OK | GNU C++11 | TESTS | 8 | 140 | 716800 | 2800 | |
54475101 | wbs501 | I | May 22, 2019, 7:59 a.m. | OK | GNU C++11 | TESTS | 8 | 140 | 716800 | 2800 | |
46907919 | jiangshibiao | I | Dec. 11, 2018, 3:15 p.m. | OK | GNU C++11 | TESTS | 8 | 140 | 1024000 | 2800 | |
56969099 | yhx-12243 | I | July 13, 2019, 9:28 a.m. | OK | GNU C++14 | TESTS | 8 | 31 | 204800 | 2800 | |
66989827 | Motarack | I | Dec. 15, 2019, 7:46 p.m. | OK | GNU C++14 | TESTS | 8 | 78 | 614400 | 2800 | |
47724110 | IrvinSpence | I | Dec. 30, 2018, 1:14 p.m. | OK | GNU C++14 | TESTS | 8 | 78 | 716800 | 2800 | |
62421631 | lxlxl | I | Oct. 12, 2019, 1:08 p.m. | OK | GNU C++14 | TESTS | 8 | 93 | 716800 | 2800 | |
46505322 | chemthan dai Trans | I | Dec. 2, 2018, 11:01 a.m. | OK | GNU C++14 | TESTS | 8 | 109 | 1331200 | 2800 | |
46545802 | Maripium | I | Dec. 3, 2018, 2:34 p.m. | OK | GNU C++14 | TESTS | 8 | 109 | 1331200 | 2800 | |
46474043 | MiFaFaOvO TLE FizzyDavid | I | Dec. 2, 2018, 7:56 a.m. | OK | GNU C++14 | TESTS | 8 | 124 | 21401600 | 2800 | |
66991245 | Motarack | I | Dec. 15, 2019, 8:33 p.m. | OK | GNU C++14 | TESTS | 8 | 140 | 614400 | 2800 | |
46852188 | NiroBC | I | Dec. 10, 2018, 12:52 p.m. | OK | GNU C++14 | TESTS | 8 | 140 | 1331200 | 2800 | |
46509749 | yashChandnani | I | Dec. 2, 2018, 12:44 p.m. | OK | GNU C++14 | TESTS | 8 | 140 | 2662400 | 2800 | |
46487714 | 1919810 whzzt apiadu | I | Dec. 2, 2018, 9:40 a.m. | OK | GNU C++17 | TESTS | 8 | 31 | 0 | 2800 | |
46506527 | kb. Merkurev Tinsane | I | Dec. 2, 2018, 11:26 a.m. | OK | GNU C++17 | TESTS | 8 | 93 | 716800 | 2800 | |
69407654 | hjk1030 | I | Jan. 23, 2020, 11:30 a.m. | OK | GNU C++17 | TESTS | 8 | 140 | 716800 | 2800 | |
46893948 | FizzyDavid | I | Dec. 11, 2018, 8:02 a.m. | OK | GNU C++17 | TESTS | 8 | 140 | 27238400 | 2800 | |
58183016 | maximumSHOT | I | Aug. 2, 2019, 3:58 p.m. | OK | GNU C++17 | TESTS | 8 | 156 | 716800 | 2800 | |
46580452 | RedTea | I | Dec. 4, 2018, 11 a.m. | OK | GNU C++17 | TESTS | 8 | 156 | 1331200 | 2800 | |
46743854 | vjudge4 | I | Dec. 8, 2018, 5:38 a.m. | OK | GNU C++17 | TESTS | 8 | 171 | 716800 | 2800 | |
47347633 | romanasa | I | Dec. 21, 2018, 9:27 p.m. | OK | GNU C++17 | TESTS | 8 | 171 | 716800 | 2800 | |
46743828 | vjudge4 | I | Dec. 8, 2018, 5:37 a.m. | OK | GNU C++17 | TESTS | 8 | 171 | 819200 | 2800 | |
46584606 | Fedosik kefaa2 gepardo | I | Dec. 4, 2018, 12:40 p.m. | OK | GNU C++17 | TESTS | 8 | 233 | 1331200 | 2800 | |
46497038 | eatmore | I | Dec. 2, 2018, 10:23 a.m. | OK | Java 8 | TESTS | 8 | 530 | 0 | 2800 | |
46712024 | I | Dec. 7, 2018, 9:06 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 2800 | ||
46711269 | I | Dec. 7, 2018, 9:06 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 2800 |
Back to search problems