
大二上
SadSummerHoliday
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
give gandies(数学题)
传送门:https://nanti.jisuanke.com/t/31716题意:求2的n次方(10^1000000)mod 1e9+7思路:利用费马小定理,a^(p-1)=1(mod p),然后求出次方模1e9+6的结果。求次方模1e9+6的方法是还原过程中每次mod 1e9+6#include <bits/stdc++.h>using namespace std;...原创 2018-09-16 09:47:17 · 176 阅读 · 0 评论 -
线性素数筛
来源:https://www.jianshu.com/p/f16d318efe9b最low两个星期之前,如果你让我筛一下素数,我会告诉你很简单,然后一顿敲#define SIZE 1000000int main(){ int check[SIZE]; int prime[SIZE] = {0}; int pos; int flag; fo...转载 2018-09-23 21:21:34 · 204 阅读 · 0 评论 -
线性筛(欧拉函数)(莫比乌斯函数)
原文:https://www.cnblogs.com/Paul-Guderian/p/7723031.html在这里提供三种线性筛的讲解,它们分别是:素数筛,欧拉筛和莫比乌斯筛。 筛法正确性的重要理论依据: 上述函数均为积性函数。积性函数的性质为:若f(x)是一个积性函数,那么对于任意素数a,b,满足f(ab)=f(a)*f(b) ·一些可爱的要点(有助于理解筛法...转载 2018-09-23 21:52:53 · 2391 阅读 · 0 评论 -
C Halt Problem
C Halting ProblemIn computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program, whether the program will finish running (i.e., halt)...原创 2018-09-22 20:50:30 · 314 阅读 · 0 评论 -
Jurassic Remains LA 2965(中途相遇法)
【中途相遇法】:首先,如果将每种状态用位表示,就是2^24种状态,1表示奇数个,0表示偶数个。利用异或运算的特殊性,模二加,奇数与奇数异或是偶数。所以我们的目的是找出m个数异或,使他们的结果为0。到这里为止,已经保证了编码的简便性。但是,复杂度任然是难以支撑。朴素的算法为2^24(==16000000)种情况,超时。书中提供“中途相遇法”,将考虑的情况分为两半,一边是2^12(==4096...原创 2018-10-06 19:43:47 · 317 阅读 · 0 评论 -
priority_queue的用法(含自定义排序方式)
转载自https://www.cnblogs.com/Deribs4/p/5657746.htmlpriority_queue本质是一个堆。1. 头文件是#include<queue>2. 关于priority_queue中元素的比较 模板申明带3个参数:priority_queue<Type, Container, Functional>,其中Type ...转载 2018-11-03 10:10:10 · 1615 阅读 · 0 评论 -
toj 1224 HTML(字符串处理)(输入输出格式)
F. HTMLTime Limit: 1.0 Seconds Memory Limit: 65536KIf you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to instal...原创 2018-12-25 12:03:50 · 417 阅读 · 0 评论 -
toj 1196 Web Navigation(模拟)(字符串处理)
D. Web NavigationTime Limit: 1.0 Seconds Memory Limit: 65536K Multiple test filesStandard web browsers contain features to move backward and forward among the pages recently visited. One wa...原创 2018-12-25 12:10:46 · 234 阅读 · 0 评论