数据结构与算法 算法 数据结构与算法分析 编程珠玑 剑指 Offer 操作系统 现代操作系统 深入理解计算机系统 鸟哥的 Linux 私房菜 Unix 环境高级编程 Unix/Linux 编程实践教程 Operating Systems: Three Easy Pieces (OSTEP) 计算机网 ...
分类:
其他好文 时间:
2018-10-10 14:34:40
阅读次数:
167
1、Iterator迭代器:(1)类型转换异常:ClassCastException;集合中存放的是多个对象时,在强转时会出现; 会出现以下异常: (2)添加泛型避免异常;在编译时期出现编译失败; 与上面对比: 效果如下: 当添加元素时:The method add(String) in the t ...
分类:
编程语言 时间:
2018-10-09 21:49:24
阅读次数:
237
Prime Permutation codeforces 123A You are given a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. The chara ...
分类:
其他好文 时间:
2018-10-08 00:46:31
阅读次数:
213
求a_i 在 [1,k]范围内,gcd(a_1,a_2...,a_n) = 1的a的数组个数。 F(x)表示gcd(a_1,a_2,...,a_n) = i的a的个数 f(x)表示gcd(a_1,a_2,...,a_n) = ki的a的个数(实际上就是i的倍数) f(x) = segma(x | d ...
分类:
其他好文 时间:
2018-10-07 16:48:24
阅读次数:
131
一、题目 Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there ...
分类:
其他好文 时间:
2018-10-06 16:45:27
阅读次数:
120
【链接】 "我是链接,点我呀:)" 【题意】 【题解】 首先,因为高度是h 所以肯定1下面有连续的h个点依次连成一条链。 用了h+1个点了 然后,考虑d这个约束。 会发现,形成d的这个路径,它一定是经过节点1比较好。 因为这条路径有两种可能 1.经过了1节点 2.没有经过1节点,那么肯定是1的某个子 ...
分类:
其他好文 时间:
2018-10-05 16:16:15
阅读次数:
159
【链接】 "我是链接,点我呀:)" 【题意】 【题解】 时刻维护一下前K大的数字就好。 因为k 【代码】 ...
分类:
其他好文 时间:
2018-10-05 16:05:21
阅读次数:
172
题意:$\sum_{i=1}^n\sum_{j=1}^ngcd(i,j)$ 题解:先枚举gcd,$\sum_{d=1}^n\sum_{i=1}^{\lfloor \frac{n}{d} \rfloor}\sum_{j=1}^{\lfloor \frac{n}{d} \rfloor}[(i,j)=1] ...
分类:
其他好文 时间:
2018-10-04 14:31:58
阅读次数:
213
题意:在a,b中(a,b<=n)(1 ≤ n ≤ 1014),有多少组(a,b) (a<b)满足lcm(a,b)==n; 先来看个知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en for i in range(1,n): ei 从0取到ei的所 ...
分类:
其他好文 时间:
2018-10-04 10:56:03
阅读次数:
144
198. House Robber 202. Happy Number 204. Count Primes 219. Contains Duplicate II 固定窗口滑动 219. Contains Duplicate II 固定窗口滑动 class Solution { public: boo ...
分类:
其他好文 时间:
2018-10-04 10:54:52
阅读次数:
131