码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
HDU 4148 Length of S(n)(规律题)
Problem Description A number sequence is defined as following: S(1)=1, S(2)=11, S(3)=21, S(4)=1211, S(5)=111221, S(6)=312211, …… Now, we need you to calculate the length of S(n). Inp...
分类:其他好文   时间:2015-01-09 12:38:37    阅读次数:145
leetcode 【 Reverse Nodes in k-Group 】 python 实现
原题:Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen lef...
分类:编程语言   时间:2015-01-09 12:22:41    阅读次数:160
BZOJ3858: Number Transformation
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3858题解:设第i个数为i*a;第i+1个数为(i+1)*b。则(i+1)*b>i*a;b>a-(a/(i+1));那么如果a 2 3 #include 4 5 #include 6 7 #...
分类:其他好文   时间:2015-01-09 12:03:33    阅读次数:168
LeetCode--3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact...
分类:其他好文   时间:2015-01-09 09:19:26    阅读次数:176
[Leetcode][JAVA] Distinct Subsequences
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:编程语言   时间:2015-01-09 06:56:19    阅读次数:239
猜随机生成数
计算机随机生成一个1-100之内的数字,在7次之内币可以猜中packagehello; importjava.util.Scanner; publicclassCaishu{ /** *@paramargs */ publicstaticvoidmain(String[]args){ //TODOAuto-generatedmethodstub Scannerin=newScanner(System.in); intnumber=(in..
分类:其他好文   时间:2015-01-09 01:42:59    阅读次数:152
[Hackerrank] Prime Number Less Than N
static int getNumberOfPrimes(int N) { int n = N+1;//to include 0 as the first number for easy index operations later final boolean a[] =...
分类:其他好文   时间:2015-01-09 01:31:29    阅读次数:458
华为机试—寻找丑数 && 九度OJ 1214
题目1214:丑数 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1733 解决:771 题目描述: 把只包含因子2、3和5的数称作丑数(Ugly Number)。例如6、8都是丑数,但14不是,因为它包含因子7。 习惯上我们把1当做是第一个丑数。求按从小到大的顺序的第N个丑数。 输入: 输入包括一个整数N(1...
分类:其他好文   时间:2015-01-09 00:18:46    阅读次数:295
[LeetCode] Factorial Trailing Zeroes 阶乘末尾0
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf...
分类:其他好文   时间:2015-01-09 00:00:03    阅读次数:531
js-数据类型
最近在看视频学习,把相关的知识记录,汇总一下,js的原始数据类型包含五种:number、string、boolean、null、undefined还有一个大家常见到的也就是object(Date、Function、Array等)如何判断类型,主要有以下几种:typeof、instanceof、Obj...
分类:Web程序   时间:2015-01-08 23:57:59    阅读次数:449
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!