CF1605F.PalindORme

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

An integer array aa of length nn is said to be a PalindORme if ( a1a_{1} | $a_{2} $ | $ \ldots $ | $ a_{i}) = (a_{{n - i + 1}} $ | $ \ldots $ | $ a_{{n - 1}} $ | $ a_{n}) $ for all $ 1 \leq i \leq n$ , where | denotes the bitwise OR operation.

An integer array aa of length nn is considered to be good if its elements can be rearranged to form a PalindORme. Formally, array aa is good if there exists a permutation p1,p2,pnp_1, p_2, \ldots p_n (an array where each integer from 11 to nn appears exactly once) for which ap1,ap2,apna_{p_1}, a_{p_2}, \ldots a_{p_n} is a PalindORme.

Find the number of good arrays of length nn , consisting only of integers in the range [0,2k1][0, 2^{k} - 1] , and print it modulo some prime mm .

Two arrays a1,a2,,ana_1, a_2, \ldots, a_n and b1,b2,,bnb_1, b_2, \ldots, b_n are considered to be different if there exists any ii (1in)(1 \leq i \leq n) such that aibia_i \ne b_i .

输入格式

The first and only line of the input contains three integers nn , kk and mm ( 1n,k801 \leq n,k \leq 80 , 108<m<10910^8 \lt m \lt 10^9 ). It is guaranteed that mm is prime.

输出格式

Print a single integer — the number of good arrays modulo mm .

输入输出样例

  • 输入#1

    1 1 998244353

    输出#1

    2
  • 输入#2

    3 2 999999733

    输出#2

    40
  • 输入#3

    7 3 796735397

    输出#3

    1871528
  • 输入#4

    2 46 606559127

    输出#4

    177013

说明/提示

In the first sample, both the possible arrays [0][0] and [1][1] are good.

In the second sample, some examples of good arrays are:

  • [2,1,2][2, 1, 2] because it is already PalindORme.
  • [1,1,0][1, 1, 0] because it can rearranged to [1,0,1][1, 0, 1] which is PalindORme

Note that [1,1,0][1, 1, 0] , [1,0,1][1, 0, 1] and [0,1,1][0, 1, 1] are all good arrays and are considered to be different according to the definition in the statement.

In the third sample, an example of a good array is [1,0,1,4,2,5,4][1, 0, 1, 4, 2, 5, 4] . It can be rearranged to an array b=[1,5,0,2,4,4,1]b = [1, 5, 0, 2, 4, 4, 1] which is a PalindORme because:

  • OR(1,1)\mathrm{OR}(1, 1) = OR(7,7)\mathrm{OR}(7, 7) = 11
  • OR(1,2)\mathrm{OR}(1, 2) = OR(6,7)\mathrm{OR}(6, 7) = 55
  • OR(1,3)\mathrm{OR}(1, 3) = OR(5,7)\mathrm{OR}(5, 7) = 55
  • OR(1,4)\mathrm{OR}(1, 4) = OR(4,7)\mathrm{OR}(4, 7) = 77
  • OR(1,5)\mathrm{OR}(1, 5) = OR(3,7)\mathrm{OR}(3, 7) = 77
  • OR(1,6)\mathrm{OR}(1, 6) = OR(2,7)\mathrm{OR}(2, 7) = 77
  • OR(1,7)\mathrm{OR}(1, 7) = OR(1,7)\mathrm{OR}(1, 7) = 77

Here OR(l,r)\mathrm{OR}(l, r) denotes blb_{l} | $b_{l+1} $ | $ \ldots $ | $ b_{r}$

首页