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 intege ...
分类:
移动开发 时间:
2016-04-12 15:56:40
阅读次数:
218
下面还有静态代理和动态代理 1.构造注入 lib包: 在entity包下新建一个实体类User 代码: 1 package cn.happy.entity; 2 3 public class User { 4 private Integer id; 5 private String name; 6 ...
分类:
其他好文 时间:
2016-04-09 16:53:58
阅读次数:
117
题目链接:https://leetcode.com/problems/happy-number/ 题目理解:实现isHappy函数,判断一个正整数是否为happy数 happy数:计算要判断的数的每一位的平方和,平方和为1则为happy数,不为1则将原数替换为此平方和,继续上述步骤,直到等于1(为h ...
分类:
移动开发 时间:
2016-04-08 14:30:14
阅读次数:
173
HDU 5234 题目大意:给定n,m,k,以及n*m(n行m列)个数,k为背包容量,从(1,1)开始只能往下走或往右走,求到达(m,n)时能获得的最大价值 解题思路:dp[i][j][k]表示在位置(i,j)有一个容量为k的背包所能获得的最大价值 决策:a[i][j]处的数是否选取 不选取: dp ...
分类:
移动开发 时间:
2016-04-06 07:03:26
阅读次数:
190
题目描述 请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 Solution 1: class Solution { public: void replaceSpace(char *str, i ...
分类:
其他好文 时间:
2016-04-05 10:51:40
阅读次数:
112
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 intege ...
分类:
移动开发 时间:
2016-04-01 06:25:32
阅读次数:
177
#import <Foundation/Foundation.h> #import "Student.h" //引入runtime底层框架 #import <objc/runtime.h> #import "Student+EnglishName.h" //动态添加的方法的声名 void happy ...
分类:
其他好文 时间:
2016-03-28 18:31:23
阅读次数:
162
首先我们要搭建三个窗体。 FrmLogin FrmRegister FrmMain 2.我们先看一下第一个窗体的代码 首先我们先双击窗体进入代码页面 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 public Use ...
分类:
移动开发 时间:
2016-03-27 12:37:54
阅读次数:
487
题目描述: 请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 此类型的算法可以适用于很多方面,像数组的合并。思想是从数组的后边向前合并,而不是从前向后。
分类:
其他好文 时间:
2016-03-21 11:55:30
阅读次数:
166
http://poj.org/problem?id=2773 说实话这道题。。一点都不Happy好吗 似乎还可以用欧拉函数来解这道题,但正好刚学了容斥原理和二分,就用这个解法吧。 题解:要求输出[1,m]中与m互质的第k个数,先打表,找到m的所有质因数,然后用二分实现,最开始区间为[1,2^60],...
分类:
移动开发 时间:
2016-03-18 21:40:58
阅读次数:
207