原题 挂个链接 "CodeForces" 题目大意:给定k个质数,求出约数中只有由这几个数组合一下(可以多次用一个数)的第k个值 Solution 分析: 我们看到n是16,然后如果爆搜n/2是可以过的.所以考虑Meeting In The Middle 他让我们求第k个数,理所应当地想到二分答案. ...
分类:
其他好文 时间:
2018-10-11 00:00:36
阅读次数:
226
Description The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number t ...
分类:
其他好文 时间:
2018-10-10 20:11:26
阅读次数:
175
数据结构与算法 算法 数据结构与算法分析 编程珠玑 剑指 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
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7 ...
分类:
其他好文 时间:
2018-10-06 23:08:57
阅读次数:
205
一、题目 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
Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less tha ...
分类:
其他好文 时间:
2018-10-06 00:04:54
阅读次数:
166
题意:$\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