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
题意:$\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
“少壮不努力,AK IOI。”—— "RLD" 2018/8/10 "Prime Distance On Tree" 和 "聪聪可可" 一样是点分治的计数题 但是合并信息是$ O( n ^ 2 ) $的,会炸,FFT可以加速。 2018/8/13 tset49 T1 还以为是polya定理,结果还是 ...
分类:
系统相关 时间:
2018-10-04 10:09:33
阅读次数:
350
这道题写了接近两个小时。思路很容易想,但是bug不好调,尤其是这种暴搜的题。没看紫书解析,这道题独立做的。 bug出在下面几个方面 1.由于没有完全搞明白参数的意义,所以递归函数的参数多了1。本应该搜索sech(1,n 1),刚开始我一直搜索成了sech(1,n)。这是因为,第一个参数意为已确定的序 ...
分类:
其他好文 时间:
2018-10-03 00:35:59
阅读次数:
141
Output the k-th prime number. k≤10000 The k-th prime number. ...
分类:
其他好文 时间:
2018-10-02 17:35:29
阅读次数:
161