#include <bits/stdc++.h>
#define Mo 1000000007
#define MAXN 50
#define MAXK 10
using namespace std;
int dp[*MAXN+][<<MAXK];
class AlienAndSetDiv2 {
public:
int N, K;
int calc(int n, int unmatched)
{
int res = ;
if (- != dp[n][unmatched]) {
return dp[n][unmatched];
} if (n == * N + ) {
if ( == unmatched) {
res = ;
}
} else {
if ( == unmatched) {
res += ( * calc(n + , ) ) % Mo;
} else {
int newset = unmatched;
int i = ;
for (i = ; (newset & 0x80000000 ) == ; newset = ( newset << ), ++i) {
}
int mx = - i;
res += calc(n + , (unmatched - ( << mx)) << );
res %= Mo; if (mx != K - ) {
newset = unmatched;
newset = ( (newset << ) | );
res += calc(n + , newset);
res %= Mo;
}
}
}
dp[n][unmatched] = res;
return res;
}

最新文章

  1. java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
  2. java 多线程(wait/notify/notifyall)
  3. 在移动端如何选择字体大小和布局的单位,px或dp?
  4. ASIO插件 真的能提升 音质?(听音乐者必看)
  5. Linux open函数
  6. 无法定位序数XX于动态链接库XX.dll的解决的方法
  7. 教你Mac OS系统四种改动Hosts文件的方法
  8. TatukGIS - GisDefs - ChangeDir 函数
  9. 应用Oracle(解锁内置用户)
  10. mysql一个表中多个字段对应另一个表的id如何查询?
  11. [网络] SOCKET, TCP/UDP, HTTP, FTP
  12. asp.net 分页类
  13. winform无边框窗口拖动
  14. keeplived日志位置指定
  15. hihocoder #1159 : 扑克牌
  16. SpriteKit中节点的z-position
  17. 语音活性检测器py-webrtcvad安装使用
  18. 【C语言程序】让用户输入一句话,输出这句话中每个单词含有多少个字母
  19. java技术突破要点
  20. python学习 day19 configparser模块 os模块 subprocess模块

热门文章

  1. 头文件带和不带.h的区别
  2. 高并发之API接口限流
  3. 在 Ubuntu14.04 上搭建 Spark 2.3.1(latest version)
  4. 使用python库xlsxwriter库来输出各种xlsx文件
  5. React Native &amp; Google &amp; Proxy
  6. 学习 Spring (十六) AOP API
  7. 中断MSI INTA
  8. servlet篇 之 生命周期
  9. MySQL官方教程及各平台的安装教程和配置详解入口
  10. Spring 使用介绍(六)—— AOP(二)