[hdu-6608] Fansblog 威尔逊定理 质数的密度分布 2019 多校 3
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6608 题目大意:给一个质数P (1e9≤p≤1e14),找比它小的最大质数Q,求Q! Module P 1.质数密度分布:质数分布的比较密,在p周围100内应该能遇到质数,所以q可以从大到小枚举 2.判断10^14 内数x是否为质数,只用提前筛出1^7 内质数看是否有x因子 3.威尔逊定理 (p−1)!≡−1(mod p) 当p是质数时 ,实际上就是 (p-1)! mod p =p-1 求Q!
CMD命令开发小技巧
1.代码补全 win+r打输入regedit 打开注册表 进入HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar,双击CompletionChar, 将值改为9,选择十进制,点击确定 以后运行CMD的时候 输入首字母按住 TAB键就能自动补全输入的命令了。
golang 2 ways to delete an element from a slice
2 ways to delete an element from a slice yourbasic.org/golang Fast version (changes order) a := []string{"A", "B", "C", "D", "E"}
i := 2
// Remove the element at index i from a.
a[i] = a[len(a)-1] // Copy last element to index i.
a[len(a)-1] =
springboot08(springmvc自动配置原理)
MVC WebMvcAutoConfiguration.java @ConditionalOnMissingBean(name = "viewResolver", value = ContentNegotiatingViewResolver.class)
public ContentNegotiatingViewResolver viewResolver(BeanFactory beanFactory) {
ContentNegotiatingViewResolver resolver
多线程之小米商店APP爬虫
#今日目标
**多线程之小米商店APP爬虫**
爬取小米商店所有社交APP
```
import requests
import time
from threading import Thread
from queue import Queue
import json
class XiaoAppSpider(object):
def __init__(self):
self.url='http://app.mi.com/catego
springboot10(docker)
一 Docker 1 what's the Docker? Docker是一个开源的应用容器引擎,轻量级容器技术。 Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。 容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app),更重要的是容器性能开销极低。 2 Docker的应用场景 Web 应用的自动化打包和发布。 自动化测试和持续集成、发布。 在服务型环境中部署和调整数据库或其他
springboot12(rabbitmq)
RabbitAutoConfiguration @Configuration
@ConditionalOnClass({ RabbitTemplate.class, Channel.class })
@EnableConfigurationProperties(RabbitProperties.class)
@Import(RabbitAnnotationDrivenConfiguration.class)
public class RabbitAutoConfiguration {
Redmine添加插件
Plugins Plugin list A full list of available Redmine plugins can be found at the Plugin Directory. More plugins (some in very early development), which are not listed at the Plugin Directory but are publicly available on GitHub can be found using a
linux 操作系统-进程控制类命令
1. ps [参数] ps命令是用来显示系统瞬间的进程信息,它可以显示出在用户输入ps命令时系统的进程及进程的相关信息; 参数: l : 长格式输出 u :按用户名和启动时间的顺序来显示进程 j : 用树形格式来显示进程
python find和index的区别
如果找不到目标元素,index会报错,find会返回-1 >>> s="hello world"
>>> s.find("llo")
2
>>> s.index("llo")
2
>>> s.index("llos")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: substring not found
>>> s.find("llos")
-1
>
springboot11(springboot-redis)
一、Redis集群简介 1、RedisCluster概念 Redis的分布式解决方案,在3.0版本后推出的方案,有效地解决了Redis分布式的需求,当一个服务宕机可以快速的切换到另外一个服务。redis cluster主要是针对海量数据+高并发+高可用的场景。 2、Redis环境搭建 Linux系统:Centos7搭建Redis单台和集群环境 二、与SpringBoot2.0整合 1、核心依赖 <dependency>
<groupId>org.springframework.boot
[转帖]docker容器保持运行不退出
docker容器保持运行不退出 2019年01月20日 23:21:22 chvalrous 阅读数 1511 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chivalrousli/article/details/86567809 最近 进行一项工作 需要给docker 里面安装mono
之前也写了一下 如何安装 但是 不知道如何检查.
今天看了下 最简单的办法
docker run -it imagename:imag
Vuex状态管理总结
一、什么是 Vuex 1、Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式 2、Vuex 采用集中式存储和管理应用中所有组件的状态 3、Vuex 应用的核心是 store(仓库)-- 包含 state(组件中的共享状态)和 mutations(改变状态的方法) 二、Vuex 的安装 1、在项目根目录终端引入: npm install vuex --save 2、在 main.js 中加入: import store from './store' 三、Vuex 核心概念 1、Sta
Matplotlib 绘图与可视化 一些控件的介绍和属性,反正就是乱七八糟的
这个链接里有下面这个图(图里还有超链接):https://matplotlib.org/3.1.1/api/artist_api.html#matplotlib.artist.Artist figure: 可以理解为画板(还有一个大写的Figure) 参考链接:https://matplotlib.org/3.1.1/api/figure_api.html?highlight=figure#module-matplotlib.figure 是个module,提供了top-level
JavaScript 数组操作方法(一)
javascript的数组是值的有序集合,每一个值叫一个元素,而每个元素在数组中都有一个位置,以数字表示吊做索引。在javascript中数组是无类型的,数组的元素可以任意类型,并且同一个数组中的不同元素也可能有不同的类型。在声明的时候也不必固定数组的大小长度,它是动态的,而且也可以是稀疏的,因为数组的元素的索引不一定要连续。
[LeetCode] 907. Sum of Subarray Minimums 子数组最小值之和
Given an array of integers A, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, return the answer modulo 10^9 + 7. Example 1: Input: [3,1,2,4]
Output: 17
Explanation: Subarrays are [3], [1],
selenium之京东商品爬虫
#今日目标
**selenium之京东商品爬虫**
自动打开京东首页,并输入你要搜索的东西,进入界面进行爬取信息
```
from selenium import webdriver
import time
class JdSpider(object):
def __init__(self):
self.browser=webdriver.Chrome()
self.url='http://www.jd.com/'
[lua]紫猫lua教程-命令宝典-L1-03-01. 闭包
L1[闭包]01. 函数的传递赋值 没什么说的 1.函数作为变量来看 可以轻松的声明 相互赋值 2.函数变量本质是 一个内存指针 所以函数变量的相互赋值不是传递的函数本身 而是指向这个函数的内存地址 L1[闭包]02. 修改print函数功能 小知识:函数变量相互赋值的一个容易混淆的问题 函数后面的括号问题 function test()
print("执行了test函数")
end
aa=test--不加括号只是函数变量之间的赋值
bb=test()--加了括号表示要执行这个函数
今日推荐
周排行