Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of i...
分类:
移动开发 时间:
2015-06-10 08:58:42
阅读次数:
128
1 class Solution { 2 public: 3 bool isHappy(int n) { 4 int dig[1000],cnt,ans; 5 memset(dig,0,sizeof(dig)); 6 while(1) 7 ...
分类:
移动开发 时间:
2015-06-09 21:36:03
阅读次数:
140
Heavy TransportationTime Limit: 3000MSMemory Limit: 30000KTotal Submissions: 22796Accepted: 6053DescriptionBackground Hugo Heavy is happy. After the ....
分类:
编程语言 时间:
2015-06-09 19:09:48
阅读次数:
126
很有意思的贪心:
Let's reformulate the condition in terms of a certain height the towers, which will be on the stairs. Then an appropriate amount of money of a person in the queue is equal to the hei...
分类:
移动开发 时间:
2015-06-09 00:56:31
阅读次数:
361
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:
移动开发 时间:
2015-06-08 22:55:02
阅读次数:
153
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:
移动开发 时间:
2015-06-07 20:06:50
阅读次数:
154
题意:一个钟的三个指针在不停的转动,他们厌烦了这样,当他们互相的距离角度大于等于D时,他们会很开心,问一天之中他们happy的时间占总时间的百分比。
分析:只要找到某一分钟内,他们happy的时间,然后钟每过12个小时相当于43200秒复原一次。因此总时间就是43200秒,只要求出在这43200的happy时间,即可求出百分比。枚举12*60分钟,看一分钟内有多少秒是happy的时间,一分钟内解...
分类:
其他好文 时间:
2015-06-07 15:56:17
阅读次数:
141
水题代码:#include #include using namespace std;const int MAXN=105;int w[MAXN][MAXN];int dp[MAXN][MAXN][MAXN];int n,m,kk;int max(int a,int b){ if(a>n>>m>>k...
分类:
移动开发 时间:
2015-06-07 12:24:32
阅读次数:
145
使用说明:
1. 先运行app,app会在内存卡创建目录 happy/mp3 和happy/ksc 等文件夹,然后将工程assets 里两个文件,分别放到内存卡里 haplayer【app运行后会自动创建】对应的文件目录下,扫描歌曲,并找到那首歌词,点击播放,就可以显示歌词了。目前歌词文件一定要放到ksc目录下面且和歌词的文件名要一样,才可以搜索到歌词。...
分类:
其他好文 时间:
2015-06-05 15:49:51
阅读次数:
163
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of ...
分类:
移动开发 时间:
2015-05-31 12:29:50
阅读次数:
146