075 Sort Colors这道题最偷懒的方法当时是 counting sort. 但是显然这道题不是考这个, 而且那样需要扫描2便。 真正的解法是 one scan, 设置一头一尾 加上 Current一共三个指针进行 swapclass Solution: # @param {integ...
分类:
其他好文 时间:
2015-07-19 14:53:44
阅读次数:
75
题目如下:
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N being 12, there a...
分类:
其他好文 时间:
2015-07-19 13:28:24
阅读次数:
131
It is possible to write five as a sum in exactly six different ways:
4 + 1
3 + 2
3 + 1 + 1
2 + 2 + 1
2 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1
How many different ways can one hundred be written as a su...
分类:
其他好文 时间:
2015-07-18 18:41:52
阅读次数:
94
git clone时,出现这个错误.
remote: Counting objects: 4592517, done.
remote: Compressing objects: 100% (1140430/1140430), done.
error: RPC failed; result=56, HTTP code = 2008.82 MiB | 4.72 MiB/s
f...
分类:
其他好文 时间:
2015-07-18 18:38:55
阅读次数:
118
题目描述背景大家都知道,sheep有两只可爱的宠物(一只叫神牛,一只叫神菜)。有一天,sheep带着两只宠物到狗狗家时,这两只可爱的宠物竟然迷路了……描述狗狗的家因为常常遭到猫猫的攻击,所以不得不把家里前院的路修得非常复杂。狗狗家前院有N个连通的分叉结点,且只有N-1条路连接这N个节点,节点的编号是...
分类:
其他好文 时间:
2015-07-17 22:15:22
阅读次数:
143
Consider the fraction, n/d, where n and d are positive integers. If nd and HCF(n,d)=1, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d ≤ 8 in ascending or...
分类:
其他好文 时间:
2015-07-17 16:24:15
阅读次数:
121
Pleasant sheep and big big wolf
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2372 Accepted Submission(s): 989
Problem Description
...
分类:
其他好文 时间:
2015-07-17 14:11:15
阅读次数:
117
主要参考 http://www.zhihu.com/question/29580448/answer/45218281https://projecteuler.net/thread=10;page=5 Lucy_Hedgehog的代码如果不用map,自己写hash函数会更快// 计算 Π(n-1)c...
分类:
其他好文 时间:
2015-07-16 19:35:37
阅读次数:
166
转载请注明出处:viewmode=contents">http://blog.csdn.net/u012860063?viewmode=contents题目链接:http://poj.org/problem?id=1562---------------------------------------...
分类:
其他好文 时间:
2015-07-16 16:06:45
阅读次数:
98
1.什么是ARCAutomatic Reference Counting,自动引用计数,即ARC,可以说是WWDC2011和iOS5所引入 的最大的变革和最激动人心的变化。ARC是新的LLVM 3.0编译器的一项特性,使用ARC,可以说一 举解决了广大iOS开发者所憎恨的手动内存管理的麻烦。在工程中...
分类:
其他好文 时间:
2015-07-15 20:47:06
阅读次数:
136