程序员修炼之道读书笔记 第五周 这周继续读了《程序员修炼之道》,终于看完了这本书,结合最近的团队项目经历和上课讲的内容,来写一个总的读书笔记。 当时刚买回来的时候粗略翻过后面的内容,现在看,又有了新的感悟,越发感觉到了这本书的perfect! 我们的大部分程序员文化都建立在完美代码的理想基础之上:代 ...
分类:
其他好文 时间:
2018-04-05 14:26:48
阅读次数:
171
题目如下: 解题思路:因为n的最大值是1e8,所以暴力计算是不行的。首先,我们可以排除掉素数,因为素数的整数因子只有1和自己本身,所以累加的和肯定是1。对于非素数,我们首先找到它的最小整数因子,例如28,最小整数因子是2,表示[2,14]是其中一对整数因子;接下来对较大的那个整数因子继续做最小整数因 ...
分类:
其他好文 时间:
2018-04-04 12:32:48
阅读次数:
142
Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M <= m * p where M and m are ...
分类:
其他好文 时间:
2018-03-29 13:28:37
阅读次数:
134
Trie树。 要求字典序最小,所以由前到后贪心的选择。建一个trie树维护b数列。 #include #include #include using namespace std; const int maxn = 300000*(20+5) ; const int maxm = 30 + 10; i... ...
分类:
其他好文 时间:
2018-03-25 19:53:51
阅读次数:
183
一、python介绍 python的创始人为吉多·范罗苏姆(Guido van Rossum)。1989年的圣诞节期间,Guido开始写Python语言的编译器。Python这个名字,来自Guido所挚爱的电视剧Monty Python’s Flying Circus。他希望这个新的叫做Python ...
分类:
编程语言 时间:
2018-03-22 19:20:13
阅读次数:
156
```c++ include using namespace std; define fi first define se second define mp make_pair define pb push_back define rep(i, a, b) for(int i=(a); i pii; ...
分类:
其他好文 时间:
2018-03-19 00:29:57
阅读次数:
297
介绍 旋转或编码器是一个角度測量装置. 他用作精确測量电机的旋转角度或者用来控制控制轮子(能够无限旋转,而电位器只能旋转到特定位置)。其中有一些还安装了一个能够在轴上按的button,就像音乐播放器的控制button。Some of them are also equipped with a pus ...
分类:
Web程序 时间:
2018-03-17 21:37:35
阅读次数:
671
---title: 博弈论 斯坦福game theory stanford week 4-0tags: notenotebook: 6- 英文课程-15-game theory--- # 博弈论 斯坦福game theory stanford week 4-0 ## perfect informat... ...
分类:
其他好文 时间:
2018-03-13 22:49:47
阅读次数:
237
1 Summary The present perfect is an important verb tense in English. It is used to talk about things that happened at unspecified times in the past. T ...
分类:
其他好文 时间:
2018-03-13 12:14:46
阅读次数:
191
【题目】C. Perfect Security 【题意】给定长度为n的非负整数数组A和数组B,要求将数组B重排列使得A[i]^B[i]的字典序最小。n<=3*10^5,time=3.5s。 【算法】异或Trie 【题解】对一个数组O(n log n)建立异或Trie,就能O(log n)判断任意一个 ...
分类:
其他好文 时间:
2018-03-11 21:03:11
阅读次数:
311