poj 1775 Sum of Factorials 枚举子集
来源:互联网 发布:梦里花落知多少全文txt 编辑:程序博客网 时间:2024/05/16 18:24
//poj 1775//sep9#include <iostream>using namespace std;const int MAXN=1000024;int f[20];int d[MAXN+10];int main(){int n;f[0]=f[1]=1;for(int i=2;i<=9;++i)f[i]=f[i-1]*i;memset(d,0,sizeof(d));for(int s=0;s<(1<<10);++s){int sum=0;for(int i=0;i<10;++i){if((s>>i)&1)sum+=f[i];if(sum<MAXN)d[sum]=1;}}d[0]=0;while(scanf("%d",&n)==1&&n>=0)printf("%s\n",d[n]==1?"YES":"NO");return 0;}
0 0
- poj 1775 Sum of Factorials 枚举子集
- poj 1775 Sum of Factorials
- poj 1775 Sum of Factorials
- POJ 1775 Sum of Factorials
- POJ 1775 Sum of Factorials DFS 贪心
- zoj 2358 || poj 1775 Sum of Factorials
- poj 1775(Sum of Factorials)
- POJ 1775 Sum of Factorials 二分模板
- POJ 1775 Sum of Factorials (ZOJ 2358)
- poj 1775&&zoj 2358 Sum of Factorials
- poj 1775 && zoj 2358 Sum of Factorials
- POJ 1775 Sum of Factorials(数论)
- POJ 1775 Sum of Factorials 笔记
- poj 1775 -- Sum of Factorials ( 够坑 )
- Poj.1775 Sum of Factorials【略坑】 2015/10/12
- POJ 1775 (ZOJ 2358) Sum of Factorials
- POJ 1775 FZU 1106 LightOJ 1189 Sum of Factorials
- Sum of Factorials
- yii2 advanced版本dev和pro配置
- BH&BF&O的区别
- android截屏代码
- iOS9开发--(Content Blocker)Safari广告拦截详解
- 再次认识mvc,面试常用(2015年10月19日)
- poj 1775 Sum of Factorials 枚举子集
- sql语法练习(一)
- Android 如何隐藏应用程序的图标
- spring中IOC容器中的xml加载过程
- bootstrap-datetimepicker在ie8下报对象不支持"indexOf"属性或方法
- android 加密存储
- Redhat Enterprise Linux 6 (RHEL 6) YUM源切换至阿里云的CentOS 6 YUM源
- Android 自定义View (四) 视频音量调控
- Xutil 中BitmapUtils的全面注释