自己太水了—HDOJ_2212
Problem Description
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
Output
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的更多相关文章
- hdu 4940 数据太水...
http://acm.hdu.edu.cn/showproblem.php?pid=4940 给出一个有向强连通图,每条边有两个值分别是破坏该边的代价和把该边建成无向边的代价(建立无向边的前提是删除该 ...
- hdoj 4272 LianLianKan 数据太水
LianLianKan Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- Python进阶【第六篇】内置函数中好玩的几个(今天写的太水)
zip()函数 两个参数一一对应,参数是序列类型,序列包括列表,元组,字符串,当两个序列不等长时,按公共最长部分匹配,形似“拉链”. max()和min()函数 以max()为例,min()类似,只是 ...
- POJ 2528(线段树+离散化+特殊离散化)网上博客很少有人真正写对!!! 是POJ数据太水...
Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral electio ...
- CF 332A Down the Hatch! 超级水题。。不过题目太长了
A. Down the Hatch! time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- hdu4950 Monster (水题)
4950 Monster Monster Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others ...
- 【codevs 1296】营业额统计 水~~
今天下午先写一个Splay水题来复习一下Splay模板.是不是有点太水了做这种水题我有点良心不安. 可笑的是一开始我竟然WA了一组,看来是我低估水题的数据范围了,我是空节点直接返回inf或-inf,明 ...
- 【BZOJ】2761: [JLOI2011]不重复数字(set+巨水题+超坑题)
http://www.lydsy.com/JudgeOnline/problem.php?id=2761 太水了,不说了. 但是这格式错误我已经没话说了....行末不能有空格 #include < ...
- 【wikioi】1191 数轴染色(线段树+水题)
http://wikioi.com/problem/1191/ 太水的线段树了,敲了10分钟就敲完了,但是听说还有一种并查集的做法?不明觉厉. #include <cstdio> #inc ...
随机推荐
- python模块datetime
1. 日期输出格式化 datetime => string import datetime now = datetime.datetime.now() now.strftime('%Y-%m-% ...
- TypeScript完全解读(26课时)_15.模块和命名空间
新建文件夹ts-modules 并新建index.ts 在根index.ts内引入 新建a.ts文件 ts在1.5之前有两个概念一个是内部模块,一个是外部模块,因为在1.5之前es6的标准还没有提出 ...
- (2)ASP.NET Core 依赖关系注入(服务)
1.前言 面向对象设计(OOD)里有一个重要的思想就是依赖倒置原则(DIP),并由该原则牵引出依赖注入(DI).控制反转(IOC)及其容器等老生常谈的概念,初学者很容易被这些概念搞晕(包括我在内),在 ...
- 升级到Angular6后对老版本的RXJS代码做相应的调整
还没有了解过RXJS6的童鞋,可以查看我的另外一篇博文,此篇博文主要是对于RXJS5升级到RXJS6的代码调整示例 RXJS5版本 在RXJS5上我们是这样写请求的 import 'rxjs/add/ ...
- lightoj1001【简单题】
题意: 一个人的值不能超过10: #include<stdio.h> #include<queue> #include<string.h> #include< ...
- CodeForces 653A【水】
sort一发,去重 #include<cstdio> #include<iostream> #include<queue> #include<string.h ...
- Proteomes of paired human cerebrospinal fluid and plasma: Relation to blood-brain barrier permeability in older adults (文献分享一组-潘火珍)
题目:Proteomes of paired human cerebrospinal fluid and plasma: Relation to blood-brain barrier permeab ...
- 【POJ - 3040】Allowance(贪心)
Allowance 原文是English,这里就放Chinese了 Descriptions: 作为创纪录的牛奶生产的奖励,农场主约翰决定开始给Bessie奶牛一个小的每周津贴.FJ有一套硬币N种(1 ...
- 自然语言处理(二)——PTB数据集的预处理
参考书 <TensorFlow:实战Google深度学习框架>(第2版) 首先按照词频顺序为每个词汇分配一个编号,然后将词汇表保存到一个独立的vocab文件中. #!/usr/bin/en ...
- Ibatis相关
XML中的#和$的区别 http://shenzhenchufa.blog.51cto.com/730213/254561 poolMaximumActiveConnections和poolMaxim ...