"C. Perun, Ult!" 分析 首先对于每个敌人单独预处理时间线(即在什么时候可以杀死这个敌人,什么时候杀不死了),然后通过一个总时间线去更新答案。 code "E. Prime Gift" 分析 二分答案 $ans$,问题转化成小于等于 $ans$ 的有多少个数。 dfs 暴力枚举素因子构 ...
分类:
其他好文 时间:
2018-02-01 00:06:44
阅读次数:
237
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 p2^k2 … pm^km. Input Specifica ...
分类:
其他好文 时间:
2018-01-27 13:49:53
阅读次数:
135
912E - Prime Gift 思路: 折半枚举+二分check 将素数分成两个集合(最好按奇偶位置来,保证两集合个数相近),这样每个集合枚举出来的小于1e18的积个数小于1e6。 然后二分答案,check时枚举其中一个集合,然后找到另外一个集合小于mid/该元素的元素有多少个,这里用到一个双指 ...
分类:
其他好文 时间:
2018-01-25 20:46:00
阅读次数:
176
/*时间:2018.1.25作者:小岛的水*/#include<iostream>using namespace std;//验证哥德巴赫猜想:任何一个大于六的偶数可以表示为两个素数之和int main(){ int gotbaha(int n); int prime(int n); cout << ...
分类:
编程语言 时间:
2018-01-25 14:09:44
阅读次数:
139
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians ...
分类:
其他好文 时间:
2018-01-25 13:13:52
阅读次数:
169
思路:一开始想用贪心来着,发现贪心有缺陷,然后就用了最小生成树来写,这里用了prime算法,首先,先建个图,两点之间的边的权值就是两个点的距离,然后直接prime模板 代码 ...
分类:
其他好文 时间:
2018-01-24 22:09:51
阅读次数:
141
Pandigital prime Problem 41 We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 ...
分类:
其他好文 时间:
2018-01-24 13:55:17
阅读次数:
151
Problem Miracle Corporations has a number of system services running in a distributed computer system which is a prime target for hackers. The system ...
分类:
其他好文 时间:
2018-01-23 22:04:29
阅读次数:
163
素数 prime,又称为质数,是指,除了1和它本身,没有其他因数的数。 素数的定理: 1)在一个大于1的数a和它的2倍之间必定存在至少一个素数; 素数的性质: 1)在所有的大于10的质数中,个位数,只有1,3,5,9; 素数还没有自己的生成函数,只能通过素数检测函数,进行循环判断; C的基本判断函数 ...
分类:
其他好文 时间:
2018-01-23 20:37:46
阅读次数:
758
素数 知识点:判断一个数n是素数的方法就是如果从2到sqtr(n)之间没有一个数能整除n,那么n就是素数。 例题:http://acm.hdu.edu.cn/showproblem.php?pid=1262 分析:首先输入一个数n然后从n/2(m)开始往下判断是否是素数,如果是则进一步判断n-m是否 ...
分类:
其他好文 时间:
2018-01-21 00:05:28
阅读次数:
145