![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
文章平均质量分 56
蒲公英之殇
前Acmer,现实习,在操作系统,主要linuxC
展开
-
cf713-G-狄利克雷前缀和(模板题,求一个数所有质因子之和)
Dirichlet前缀和原创 2021-04-11 10:01:31 · 186 阅读 · 0 评论 -
关于数论的一点整理(看心情更新)
一、欧拉函数的求法欧拉函数表示一个数的简化剩余系的元素数。对于一个数p,它的欧拉函数值即为[1,p)内与p互质的数的个数1、O(√n)求φ(n)int zch(int x) { int ret=x; for(int i=2;i*i<=x;i++){ if(x%i==0) ret-=ret/i; while(x%i==0) x/=i; } if(x>1) ret-=ret/x; return ret;}2、O(n)求φ(1)~φ(n)const int maxn=原创 2020-07-22 21:05:56 · 193 阅读 · 0 评论 -
UPC D: Gone Fishing(三角函数)
题目描述It is getting dark and the mosquitoes are attacking Fisherman Floyd. Floyd decides to throw his circular net one last time and wants to make the most out of the last throw.Given the size (radius) of Floyd’s net and positions (x,y) of a set of fish,原创 2020-10-13 19:58:20 · 319 阅读 · 0 评论 -
ldu-自测二E、F
E. CoolGuang’s Division(Easy Version)Description纳新开始了一大批的学妹学弟们将来到实验室接下来就面临一个非常棘手的问题,位置怎么分配呢现在来抽象化这个问题:有N个学生,其中每个学生都有一个位置ai起初每个位置可以有多个人,但是最终每个位置只能有一个人所以CoolGuang的决策有很重要的作用,CoolGuang每次只可以使得一个人向前移动一位但是呢,学弟学妹们是有 讨厌度的,每次让第i个向前移动一次就要花费bi问CoolGuang怎样分配,原创 2020-10-11 21:51:42 · 264 阅读 · 0 评论 -
ldu-自测二-A,B(位运算符+位运算线段树(32树))
自测二的题都是数论,推出来题就很简单,推不出就发呆吧。淦!众所周知,int范围内,搞位运算符一般开到32就够了。A题给定一个长为n的数组,求解1到n内所有子集的位运算与之和mod(109+7),与即为c++中的&Input第一行为n,n<=1e5,接下来n个数为a[i]<=1e9Output输出结果取余(1e9+7)input31 2 3output9input32 3 3output17首先,我们很容易想到去对二进制下每一位分别讨论。枚举当前位k原创 2020-10-11 20:59:03 · 826 阅读 · 0 评论 -
数论——容斥及例题(待更新)
容斥摘要,出题类型原创 2020-10-10 22:22:28 · 125 阅读 · 0 评论 -
UPC训练赛十八:H-High Load Database
题目描述Henry profiles a high load database migration script. The script is the list of n transactions. The i-th transaction consists of ai queries. Henry wants to split the script to the minimum possible number of batches, where each batch contains either one原创 2020-10-10 22:19:40 · 290 阅读 · 0 评论 -
全排列与逆序数的组合
我也没想到逆序数可以这么难原创 2020-10-09 21:42:39 · 994 阅读 · 0 评论 -
数位dp入门刷题记录
记录一些数位dp的入门题,dp种类之一原创 2020-10-01 21:13:47 · 149 阅读 · 0 评论 -
矩阵乘法回顾
常用矩阵加速,和其它知识点结合原创 2020-09-29 20:54:56 · 5039 阅读 · 0 评论