E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
10591
10591
- Happy Number
描述:判断是否循环就可以了#include#include#include#defineN10003intnum[N];intmain(){//freopen("a.txt","r",stdin);intn,x,count,m=0,flag;num[1]=1;scanf("%d",&n);while(m0){intc=x%10;x=x/10;flag=flag+c*c;}x=flag;if(x==
moyan_min
·
2020-08-10 18:47
uva
嘴写未来:不能自拍的人生,残缺 ,但,依旧值得记录!
第
10591
天初四的早晨,是一个没有阳光却有风的早晨,天色也暗淡,一看就知道天空爷爷的心情也不是很开心,蓝天白云的脸色已被不知不觉的拉下了,这两天再也看不见那朗朗的晴空,万里无云了。
嘴写未来
·
2020-02-22 01:23
html网页生成工具
resourceId=
10591
.初始化页面2.点击[通用字段]中的控件,控件会自动添加到中间的蓝色框3.选中中间控件,属性可以在右侧进行更改,例如宽度,默认值等
LG_227
·
2018-04-24 20:12
POJ 3258 River Hopscotch (二分经典)
RiverHopscotchTimeLimit:2000MSMemoryLimit:65536KTotalSubmissions:
10591
Accepted:4543DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrocktorocki
Calm微笑
·
2016-06-03 07:20
二分查找
UVA
10591
Happy Number
CODE: #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include < set> using namespace std;
·
2015-11-02 18:56
number
UVA -
10591
- Happy Number (STL)
UVA-
10591
HappyNumberTimeLimit: 3000MSMemoryLimit: Unknown64bitIOFormat: %lld&%lluSubmit StatusDescription
u014355480
·
2015-03-22 20:00
模拟
ACM
STL
uva
【索引】Hashing / Sets
PerfectHash10282-Babelfish10391-CompoundWords10125-Sumsets10887-ConcatenationofLanguages141-TheSpotGame
10591
HelloWorld10086
·
2014-09-06 15:00
索引
【索引】Hashing / Sets
PerfectHash10282-Babelfish10391-CompoundWords10125-Sumsets10887-ConcatenationofLanguages141-TheSpotGame
10591
kl28978113
·
2014-09-05 20:00
UVA
10591
- Happy Number
题目大意:将给出数各个位上的数字的平方和加起来得到新的数字,依次往下推新数字,直到得到得到数字1(Happy number)或是与之前重复的数字(unhappy number)解题思路:对应任何一个数,经过变换后的值最大为9*9*9,所以开一个800的数组就可以将所有情况标记(注意开始输入的值没有必要标记,也开不了那么大的数组),碰到已经出现过的数值就可以跳出,跳出后判断当前数字是否是1即可#in
kl28978113
·
2014-09-05 20:00
UVA -
10591
Happy Number(hash)
ProblemCHappyNumberTimeLimit1Second Letthesumofthesquareofthedigitsofapositiveinteger S0 berepresentedby S1. Inasimilarway,letthesumofthesquaresofthedigitsof S1 berepresentedby S2 andsoon.If Si =1fors
HelloWorld10086
·
2014-09-02 13:00
number
happy
uva
10591
uva
10591
Happy Number(判重)
description:ProblemCHappyNumberTimeLimit1Second Letthesumofthesquareofthedigitsofapositiveinteger S0 berepresentedby S1. Inasimilarway,letthesumofthesquaresofthedigitsof S1 berepresentedby S2 andsoon.
u012997373
·
2014-03-29 11:00
POJ 2411Mondriaan's Dream(类似hdu1992铺砖问题)
Mondriaan'sDreamTimeLimit: 3000MS MemoryLimit: 65536KTotalSubmissions:
10591
Accepted: 6163DescriptionSquaresandrectanglesfascinatedthefamousDutchpainterPietMondriaan.Onenight
opm777
·
2014-03-27 13:00
状压dp
【索引】Hashing / Sets
PerfectHash10282-Babelfish10391-CompoundWords10125-Sumsets10887-ConcatenationofLanguages141-TheSpotGame
10591
u011328934
·
2013-08-31 13:00
uva
10591
题意:最大数字也就81*9,不会很大,那就简单了#include #include #include usingnamespacestd; intsort(intx) { inty=0; while(x>0) { y=y+(x%10)*(x%10); x=x/10; } returny; } intmain() { intn,m,t,i,visit[1000]; scanf("%d",&t);
u011345136
·
2013-08-25 21:00
uva
10591
Happy Number(判重)
Description ProblemCHappyNumberTimeLimit1Second Letthesumofthesquareofthedigitsofapositiveinteger S0 berepresentedby S1. Inasimilarway,letthesumofthesquaresofthedigitsof S1 berepresentedby S2 andsoon.
u011328934
·
2013-08-15 22:00
为重负网络优化 Nginx 和 Node.js
mod=viewthread&tid=
10591
&fromuid=1为重负网络优化Nginx和Node.js在搭建高吞吐量web应用这个议题上,NginX和Node.js可谓是天生一对。
aircoder
·
2013-05-13 01:00
nginx
socket
工作
web
为重负网络优化 Nginx 和 Node.js
mod=viewthread&tid=
10591
&fromuid=1 为重负网络优化 Nginx 和 Node.js 在搭建高吞吐量web应用这个议题上,NginX和Node.js可谓是天生一对
aircoder
·
2013-05-13 01:00
nginx
工作
Web
socket
uva
10591
- Happy Number(快乐的数)
题意,给出一个数字,判断它是否是HappyNumer。条件: 对给出的数字S0的每一位求平方和,得到下一个数字S1,再次对得到的数字S1的每一位求平方和,若出现Sn=1情况,则原始数字是HappyNumber,否则就UnhappyNumber。这个题的技巧在于循环结束的条件,开始的时候我认为某一个状态等于1或者该数字在前面出现过是结束的标志。写个一个数组判重,结果程序跑了1s多,看到人家的代码只有
shankeliupo
·
2013-03-22 18:00
UVA
10591
Happy Number
大意略。。思路:照着模拟,然后用STL容器判断是否出现过即可。#include #include #include #include #include #include usingnamespacestd; typedeflonglongLL; setvis; intn; voidinit() { vis.clear(); } LLcal(intn) { LLs=0; while(n)
Wall_F
·
2013-01-23 13:00
uva-
10591
- Happy Number
这道题目的题意很简单,数据范围是1到10的9次方,看着有点大,实际上最大情况下数字是:999999999,把他们每一位的平方和为81*9=729;#include #include #include #include usingnamespacestd; intmap[1000]; intsure(intx) { intp=x; intvisit[1000]; memset(visit,0,siz
rowanhaoa
·
2012-10-19 20:00
UVa
10591
- Happy Number
题意:将给出数各个位上的数字的平方和加起来得到新的数字,依次往下推新数字,直到得到得到数字1(Happy number)或是与之前重复的数字(unhappy number)。利用哈希表查找判重或是直接打表,因为输入最大是10的9次方的数字,因此得出的数字最大为9*9*9 = 729。代码一(hash 0.020s):#include #include #include #include #incl
GooMaple
·
2012-10-07 14:00
insert
uva
10591
- Happy Number
ProblemCHappyNumberTimeLimit1Second LetthesumofthesquareofthedigitsofapositiveintegerS0berepresentedbyS1.Inasimilarway,letthesumofthesquaresofthedigitsofS1berepresentedbyS2andsoon.IfSi=1forsomei³1,the
Frankiller
·
2012-08-06 16:00
input
each
UVa
10591
- Happy Number
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1532类型:哈希表原题:LetthesumofthesquareofthedigitsofapositiveintegerS0berepresentedbyS1.Inasim
shuangde800
·
2012-07-28 00:00
UVa
10591
- Happy Number
题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1532 类型: 哈希表 原题: Let the sum of the square of the digits of a p
king_tt
·
2012-07-28 00:00
number
10591
- Happy Number
/* 简单题 题意:S0每位数字的平方之和为S1,一次推理,如果出现Si=1,输出p1。 不出现,输出p2。 思路:第一次做的时候超时,没计算出一个新的temp需要与前面的所有数字进行一次判断 使用hash做记录 */ #include #include inthash[10000]; boolcheck(intk,intn) { inttemp=0; while(k!=0) { inta=k%
lhshaoren
·
2012-02-15 23:00
UVa
10591
Happy Number
UVa
10591
HappyNumber迭代得到Si的值,同时用set记录已经计算过的Si。如果出现1,成功;如果出现了已经出现过一次的值,失败(因为之后也不会再出现1)。
心如止水
·
2011-05-07 16:00
如何将Linux配置为一个FAX服务器
www.webasp.net)--技术教程(http://www.webasp.net/article/)---如何将Linux配置为一个FAX服务器(http://www.webasp.net/article/11/
10591
nailwl
·
2010-01-04 19:00
linux
网络
服务器
Class
printing
postscript
上一页
1
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他