一道水题,只要会复制粘贴就好! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 #define P...
分类:
其他好文 时间:
2014-09-18 23:42:34
阅读次数:
176
题目地址:Round Numbers题目大意: “Round Numbers” 是一个十进制的数转化为二进制,如果在二进制中 “0”的个数不小于“1”的个数,就称为“Round Numbers” 。本题求出n到m区间(闭区间)的“Round Numbers” 有多少个。解题思路: 排列组合的公式.....
分类:
其他好文 时间:
2014-09-18 22:04:04
阅读次数:
145
第一个问题可以抽象为这样:给定一个数组A,和一个数t,用数组里的一些数求和得到t,数组里的数可以重复使用,写一个算法,使得使用A中最少的数来表示t。比如:[2,4,6,9],18==>[9,9]dfs问题//numbers要从大到小,一个sort搞定,result存放结果bool dfs(vecto...
分类:
其他好文 时间:
2014-09-18 22:02:24
阅读次数:
162
题意讲某个二进制按照规则每一位对应斐波那契数生成新的数字,然后2个数字求和。再求由该规则生成的二进制串。并且要求尽量用更大项的fib数(题目提示不能由连续的1就是2个连续的1(11)不如100更优)用大数处理出100项fib。然后模拟交替置位位0或者1,输出#include #include #in...
分类:
其他好文 时间:
2014-09-18 14:31:53
阅读次数:
199
【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[...
分类:
其他好文 时间:
2014-09-18 11:29:23
阅读次数:
201
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:
其他好文 时间:
2014-09-18 05:24:13
阅读次数:
195
第04章:字典 当索引不好用时
Python唯一的内建的映射类型,无序,但都存储在一个特定的键中,键可以使字符,数字,或者是元祖.
------
字典使用:
表征游戏棋盘的状态,每个键都是由坐标值组成的元祖
存储文件修改的次数,文件名作为键
数字电话/地址薄
函数传递值def func(x,*args,**args):
如果要建公司员工与座机号的列表,如果要获得Alice的座机只能这么找
>>> names = ['Alice','Bob','Tom']
>>> numbers = ['1234','7...
分类:
编程语言 时间:
2014-09-17 23:26:13
阅读次数:
589
简单的素数打表,然后枚举。开始没注意n读到0结束,TLE了回。。下次再认真点。A过后讨论里面有个暴力打表过的,给跪了! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #inc...
分类:
其他好文 时间:
2014-09-16 23:38:11
阅读次数:
331
Peter has a sequence of integers a1,?a2,?...,?an. Peter wants all numbers in the sequence to equal
h. He can perform the operation of "adding one on the segment
[l,?r]": add one to all elements of t...
分类:
其他好文 时间:
2014-09-16 14:18:20
阅读次数:
259
HDU 1492 The number of divisors(约数) about Humble Numbers(数学题)...
分类:
其他好文 时间:
2014-09-15 19:32:29
阅读次数:
190