提交时间:2023-03-30 12:31:33
运行 ID: 19821
#include <iostream> //#include <bits/stdc++.h> #define int long long using namespace std; int ans[20] = {0, 1, 0, 0, 2, 14, 90, 646, 5242, 47622, 479306, 5296790, 63779034, 831283558, 11661506218, 175203184374}; int n, M; int dp[1008][1008][2]; signed main() { while(cin >> n >> M) { if(n <= 15) { cout << ans[n] % M << endl; continue; } } return 0; }