欧拉筛求素数模版 public class Prime { //欧拉筛的时间复杂度O(n),每个数只筛一次,使用最小的质因子去筛 [埃氏筛法有重复筛同一个数,时间复杂度为O(n*log(log(n)))] public static boolean[] visit; //true代表不是素数,fal ...
分类:
其他好文 时间:
2020-04-30 13:54:50
阅读次数:
72
#include <iostream> #include <cmath> using namespace std; const int n = 10000; int isPrime(int n); int main() { for(int i = 2; i < n;++ i) {//产生10000个 ...
分类:
编程语言 时间:
2020-04-30 13:16:25
阅读次数:
77
正则表达式语法: a|b 匹配 a 或 b gr(a|e)y 匹配 gray 或 grey . 匹配任一字符 [abc] 匹配任一字符: a 或 b 或 c [^abc] 匹配任一字符, 但不包括 a, b, c [a-z] 匹配从 a 到 z 之间的任一字符 [a-zA-Z] 匹配从 a 到 z, ...
分类:
其他好文 时间:
2020-04-30 09:34:56
阅读次数:
58
It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if y ...
分类:
其他好文 时间:
2020-04-29 21:35:39
阅读次数:
64
在很多应用场景中, 马尔可夫决策过程 的状态转移概率 $p(s^ {\prime}|s,a)$ 和奖励函数 $r\left( {s,a,s^{\prime}} \right)$ 都是未知的。这种情况一般需要智能体与环境交互,然后收集一些样本,然后再根据这些样本来求解最优策略,这种基于采样的学习方法称 ...
分类:
其他好文 时间:
2020-04-27 17:53:23
阅读次数:
80
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×105 with ...
分类:
其他好文 时间:
2020-04-27 11:23:14
阅读次数:
43
1 package test_1_2; 2 3 public class PrimeNum { 4 5 public static void main(String[] args) { 6 7 /** 判断101-200之间有多少个质数,并输出所有质数。 */ 8 9 int count = 0; ...
分类:
编程语言 时间:
2020-04-26 18:57:28
阅读次数:
68
You are given two integers aa and bb. You can perform a sequence of operations: during the first operation you choose one of these numbers and increas ...
分类:
其他好文 时间:
2020-04-26 10:35:56
阅读次数:
78
Given a set of N (>) positive integers, you are supposed to partition them into two disjoint sets A?1?? and A?2?? of n?1?? and n?2?? numbers, respecti ...
分类:
其他好文 时间:
2020-04-25 19:10:09
阅读次数:
59
Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400 points ps:我发现一个很有趣的问题,long long和int 一起使用时,数据过大可能会出现错误,比如下面。所以最好还是统一用long long。 Problem Statement ...
分类:
其他好文 时间:
2020-04-25 12:36:28
阅读次数:
66