Problem Description

A DFS(digital factorial sum) number is found by summing the factorial of every digit of a positive integer.

For example ,consider the positive integer 145 = 1!+4!+5!, so it's a DFS number.

Now you should find out all the DFS numbers in the range of int( [1, 2147483647] ).

There is no input for this problem. Output all the DFS numbers in
increasing order. The first 2 lines of the output are shown below.

Input

no input

Output

Output all the DFS number in increasing order.

Sample Output

1
2
...... 题意是 求各位阶乘之和是否等于自己:
//拿到题的时候真的一脸茫然不懂 看这标题dfs 我自己就在哪里想怎么用广搜。。。。还是太蠢
//题目给的数据真是循环超时 啊
//最可笑的不是我不懂超时 而是我不懂。。。0!=??? 等于1啊笨蛋。
//循环上界2147483647是十位数 a[9]是6位数 哪怕10个九也是七位数。。所以上界设为10*a[9]
//写题 好像不百度就不会写哎 蠢哭了 要像比赛一样去做题
#include <stdio.h>
int a[];
int main()
{
int s=;
a[]=;
for(int i=;i<;i++)
{
s*=i;
a[i]=s;
}
int t,sum;
for(int i=;i<=*a[];i++)
{
t=i,sum=;
while(t)
{
sum+=a[t%];
t/=;
}
if(sum==i)
printf("%d\n",i);
}
return ;
}

第二次看题居然还是一点思路都没有 说明根本不理解啊。。。

自己太水了—HDOJ_2212的更多相关文章

  1. hdu 4940 数据太水...

    http://acm.hdu.edu.cn/showproblem.php?pid=4940 给出一个有向强连通图,每条边有两个值分别是破坏该边的代价和把该边建成无向边的代价(建立无向边的前提是删除该 ...

  2. hdoj 4272 LianLianKan 数据太水

    LianLianKan Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  3. Python进阶【第六篇】内置函数中好玩的几个(今天写的太水)

    zip()函数 两个参数一一对应,参数是序列类型,序列包括列表,元组,字符串,当两个序列不等长时,按公共最长部分匹配,形似“拉链”. max()和min()函数 以max()为例,min()类似,只是 ...

  4. POJ 2528(线段树+离散化+特殊离散化)网上博客很少有人真正写对!!! 是POJ数据太水...

    Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral electio ...

  5. CF 332A Down the Hatch! 超级水题。。不过题目太长了

    A. Down the Hatch! time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  6. hdu4950 Monster (水题)

    4950 Monster Monster Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others ...

  7. 【codevs 1296】营业额统计 水~~

    今天下午先写一个Splay水题来复习一下Splay模板.是不是有点太水了做这种水题我有点良心不安. 可笑的是一开始我竟然WA了一组,看来是我低估水题的数据范围了,我是空节点直接返回inf或-inf,明 ...

  8. 【BZOJ】2761: [JLOI2011]不重复数字(set+巨水题+超坑题)

    http://www.lydsy.com/JudgeOnline/problem.php?id=2761 太水了,不说了. 但是这格式错误我已经没话说了....行末不能有空格 #include < ...

  9. 【wikioi】1191 数轴染色(线段树+水题)

    http://wikioi.com/problem/1191/ 太水的线段树了,敲了10分钟就敲完了,但是听说还有一种并查集的做法?不明觉厉. #include <cstdio> #inc ...

随机推荐

  1. python使用xlrd操作Excel文件

    一.xlrd读取Excel文件 用xlrd进行读取比较方便,流程和平常手动操作Excel一样,打开工作簿(Workbook),选择工作表(sheets),然后操作单元格(cell). 例子:要打开当前 ...

  2. java的环境变量classpath中加点号 ‘.’ 的作用

    java的环境变量classpath中加点号 ‘.’ 的作用 “.”表示当前目录,就是编译或者执行程序时,你的.class文件所在的目录: 当找.class文件时,先去“.”路径下找,找不到的话,在去 ...

  3. 20个Flutter实例视频教程-第06节: 酷炫的路由动画-2

    博客地址: https://jspang.com/post/flutterDemo.html#toc-94f 视频地址: https://jspang.com/post/flutterDemo.htm ...

  4. AttributeCollection.Add(String, String) Method

    <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Trans ...

  5. E20180607-hm

    duplicate v. 重复; 复制; 复印;  adj. 复制的; 副本的; 完全一样的;        n. 副本; 完全一样的东西; 复制品; adjacent adj. 相邻; 邻近的,毗邻 ...

  6. laravel 布局 详解(实例)

    在resources/views里创建layouts,并在layouts里创建app.blade.php, 这个php文件放的就是你的页面框架,也就是多页面公用的内容,如下 <!DOCTYPE ...

  7. Mol Cell Proteomics. |王欣然| 基于微粒的蛋白聚合物捕获技术让能满足多种不同需求的蛋白质组学样品制备方法成为可能

    大家好,本周分享的是发表在Molecular & Cellular Proteomics. 上的一篇关于蛋白质组学样本质谱分析前处理方法改进的文章,题目是Protein aggregation ...

  8. 51 Nod 1640 天气晴朗的魔法( Kruskall )

    #include <bits/stdc++.h> typedef long long LL; using namespace std; ; struct node{ LL u,v,w; n ...

  9. [題解]TYVJ_2032(搜索/最短路)

    搜索:https://www.cnblogs.com/SiriusRen/p/6532506.html?tdsourcetag=s_pctim_aiomsg 來自 SiriusRen 數據範圍小,考慮 ...

  10. javascript高级程序设计学习笔记

    javascript高级程序设计,当枕头书已经好久了~zz  现在觉得自己在js的开发上遇到了一些瓶颈,归根究底还是基础太薄弱,所以重新刷一遍js高程希望有更新的认识. 一.javascript简介 ...