数学
文章平均质量分 83
yyPurpose_forever
FIGHTING
展开
-
codeforces662a(线性基)
A. Gambling Nimtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputAs you know, the game of "Nim" is played with n piles of stones, ...原创 2019-02-12 23:56:49 · 260 阅读 · 0 评论 -
codeforces612e(置换)
E. Square Root of Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA permutation of length n is an array containing each integer from 1 ...原创 2018-05-11 21:37:08 · 220 阅读 · 0 评论 -
codeforces 963a(等比数列求和 逆元 快速幂)
A. Alternating Sumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers aa and bb. M原创 2018-04-19 14:47:07 · 298 阅读 · 0 评论 -
codeforces698f(数学)
F. Coprime Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo positive integers are coprime if原创 2018-04-12 15:00:36 · 219 阅读 · 0 评论 -
hdu6069(大区间素数)
Counting DivisorsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 3713 Accepted Submission(s): 1366Problem DescriptionIn ma原创 2018-04-03 19:35:34 · 503 阅读 · 0 评论 -
牛客练习赛15-D(杨辉三角,组合数,逆元)
链接:https://www.nowcoder.com/acm/contest/83/D来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述有n(n≤500000) 个人排成一列,把他们解散后重排,使得"重排后前方" 跟"原排列前方" 一样的人不超过k(k<n) 个,问有几种方法数,...原创 2018-04-14 15:41:15 · 284 阅读 · 0 评论 -
poj2893 & zoj2004(八数码是否有解 树状数组)
M × N PuzzleTime Limit: 4000MS Memory Limit: 131072KTotal Submissions: 4206 Accepted: 1163DescriptionThe Eight Puzzle, among other sliding-tile puzzles, is on原创 2018-03-21 19:47:50 · 274 阅读 · 0 评论 -
poj3358(欧拉定理)
Period of an Infinite Binary ExpansionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3670 Accepted: 1033DescriptionLet {x} = 0.a1a2a3... be the binar原创 2018-03-13 00:14:23 · 246 阅读 · 0 评论 -
poj3517 & poj1781(约瑟夫环)
And Then There Was OneTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 5329 Accepted: 2894DescriptionLet’s play a stone removing game.Initially, n st原创 2018-03-20 20:49:54 · 354 阅读 · 0 评论 -
poj1026 & poj1721 & poj3128 & poj3590(置换)
CipherTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 22855 Accepted: 6357DescriptionBob and Alice started to use a brand-new encoding scheme. Surpris原创 2018-03-02 19:58:19 · 199 阅读 · 0 评论 -
hdu4767(bell数+矩阵快速幂+中国剩余定理)
BellTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 893 Accepted Submission(s): 400Problem DescriptionWhat? MMM is learning C原创 2018-02-25 22:41:45 · 256 阅读 · 0 评论 -
zoj4006 & ZOJ 2018三月月赛C(扩展欧几里德,lucas定理)
151 - ZOJ Monthly, March 2018 - CTravel along the LineTime Limit: 1 Second Memory Limit: 65536 KBBaoBao is traveling along a line with infinite length.At the beginning of his trip,原创 2018-03-10 18:50:46 · 289 阅读 · 0 评论 -
hdu2973 & hdu5391(威尔逊定理)
威尔逊定理:当且仅当p为质数时:( p -1 )! ≡ -1 ( mod p )或者这么写( p -1 )! ≡ p-1 ( mod p )或者说若p为质数,则p能被(p-1)!+1整除hdu2973YAPTCHATime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/原创 2018-02-18 20:52:42 · 286 阅读 · 0 评论 -
lindström–gessel–viennot lemma应用
对于一张无边权的DAG图,给定n个起点和对应的n个终点,这n条不相交路径的方案数为det() (该矩阵的行列式)其中e(a,b)为图上a到b的方案数 codeforces 348D[给定一张n*m带障碍的图,求从左上角到右下角不相交两条路径的方案][a1=(1,2) a2=(2,1) b1=(n-1,m) b2=(n,m-1) 应用该定理即可]#include&...原创 2018-07-20 20:38:25 · 878 阅读 · 0 评论 -
指数循环节问题学习&&补题
参考:https://blog.csdn.net/acdreamers/article/details/8236942今天来学习一个新的东西---指数循环节。在有些题目中我们需要对指数进行降幂处理才能计算。比如计算 其中和 这里由于很大,所以需要进行降幂。那么实际上有如下降幂公式 有了上述公式,很多题目就可以迎刃而解了。...原创 2018-07-31 16:26:38 · 499 阅读 · 0 评论 -
hdu6363(杭电多校第六场2)容斥、数学公式
bookshelfTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 449 Accepted Submission(s): 207Problem DescriptionPatrick Star bought a books...原创 2018-08-10 21:44:23 · 265 阅读 · 0 评论 -
codeforces1111d(dp、组合数学)
D. Destroy the Colonytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThere is a colony of villains with several holes aligned in...原创 2019-02-11 19:14:40 · 1731 阅读 · 0 评论 -
线性基学习
在这里学习了线性基:https://www.cnblogs.com/wfj2048/p/6547789.html主要还是应用在异或运算中比较多,比如一个数的集合S,取出它的一个子集,将这个子集中的数字异或起来得到一个数字,我们就可以得到这样一个异或值的集合,然后我们就可以用一组线性基X来代替这个集合S,他们所得到的异或集合一样,且集合X的大小最小,如果|X|==|S|则S为线性不相关,否则S线...原创 2018-10-10 23:32:13 · 157 阅读 · 0 评论 -
ACM-ICPC 2018南京赛区网络预赛 J Sum(线性筛)
A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is a square n...原创 2018-09-02 21:57:24 · 786 阅读 · 2 评论 -
FFT水题记录
hdu1402#include<iostream>#include<stdio.h>#include<math.h>#include<string.h>using namespace std;const int maxn = 100010;const double PI = acos(-1.0);//复数结构体struct c...原创 2018-08-24 22:23:16 · 183 阅读 · 0 评论 -
狄利克雷卷积、杜教筛学习
今天才知道有杜教筛这个逆天的东西,实在惭愧,学习了,先放上链接,后面再补题。https://blog.csdn.net/hzj1054689699/article/details/75091655这个也写得很好:https://blog.csdn.net/u011495472/article/details/50460409hdu5608functionTime Limit: ...原创 2018-08-30 21:35:16 · 181 阅读 · 0 评论 -
hdu2018多校七
Age of MoyuTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1029 Accepted Submission(s): 286Problem DescriptionMr.Quin love fishes so...原创 2018-08-13 21:22:18 · 669 阅读 · 0 评论 -
牛客2018暑假多校训练九-E(期望)
链接:https://www.nowcoder.com/acm/contest/147/E来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Niuniu likes to play OSU!We simplify the game OSU to the foll...原创 2018-08-17 21:41:40 · 250 阅读 · 0 评论 -
牛客2018暑假多校训练八-H(fwt)
链接:https://www.nowcoder.com/acm/contest/146/H来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Niuniu likes playing games. He has n piles of stones. The i-th ...原创 2018-08-13 08:50:58 · 518 阅读 · 0 评论 -
hdu5909(树形dp+fwt)
Tree CuttingTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 1298 Accepted Submission(s): 501Problem DescriptionByteasar has a tree T...原创 2018-08-12 19:25:44 · 303 阅读 · 0 评论 -
fwt学习
转载自:https://blog.csdn.net/neither_nor/article/details/60335099 FWT能干什么:FWT可以对于两个数组a和b,求出他们的位运算卷积c,使得c[k]=对于所有的i和j 满足 i位运算j等于k sigma a[i]*b[j]我们先讲与卷积和或卷积,最后再讲异或卷积一个简单的问题:先考虑一下前言中提到的问题给定数组...转载 2018-08-11 20:15:40 · 153 阅读 · 0 评论 -
hdu6333(杭电多校第四场B)分块
Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1463 Accepted Submission(s): 555Problem DescriptionThere...原创 2018-08-02 13:54:14 · 255 阅读 · 0 评论 -
poj2425(公平组合博弈 SG定理)
A Chess GameTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 4261 Accepted: 1728DescriptionLet's design a new chess game. There are N positions to hold原创 2018-02-08 20:45:36 · 357 阅读 · 0 评论 -
poj2661(Stirling公式)
Factstone BenchmarkTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4699 Accepted: 2240DescriptionAmtel has announced that it will release a 128-bit co原创 2018-01-20 20:42:12 · 251 阅读 · 0 评论 -
poj1671(第二类Stirling数)
Rhyme SchemesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1871 Accepted: 1033 Special JudgeDescriptionThe rhyme scheme for a poem (or stanza of原创 2018-01-20 19:38:31 · 347 阅读 · 0 评论 -
hdu5446(组合数取模 Lucas定理 中国剩余定理)
Unknown TreasureTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3047 Accepted Submission(s): 1122Problem DescriptionOn the原创 2017-11-11 16:07:11 · 268 阅读 · 0 评论 -
hdu5968(组合数取模Lucas定理)
瞬间移动Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1460 Accepted Submission(s): 703Problem Description有一个无限大的矩形,初始时你在左上角(即第一原创 2017-11-09 15:18:35 · 231 阅读 · 0 评论 -
poj2773(互质)
Happy 2006Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 12662 Accepted: 4456DescriptionTwo positive integers are said to be relatively prime to each原创 2017-09-21 20:15:12 · 246 阅读 · 0 评论 -
poj2992(求因子个数)
DivisorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12022 Accepted: 3587DescriptionYour task in this problem is to determine the number of divisor原创 2017-09-21 19:28:19 · 276 阅读 · 0 评论 -
codeforces 869c(组合数)
C. The Intriguing Obsessiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output— This is not playing but duty a原创 2017-10-07 14:47:29 · 1171 阅读 · 0 评论 -
poj1284(欧拉函数、原根)
Primitive RootsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4639 Accepted: 2744DescriptionWe say that integer x, 0 i mod p) | 1 <= i <= p-1 } is eq原创 2017-09-19 20:16:21 · 410 阅读 · 0 评论 -
hdu2588(欧拉函数)
GCDTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2461 Accepted Submission(s): 1271Problem DescriptionThe greatest common di原创 2017-09-19 16:25:54 · 374 阅读 · 0 评论 -
poj3735(矩阵快速幂)
Training little catsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14625 Accepted: 3619DescriptionFacer's pet cat just gave birth to a brood of littl原创 2017-09-01 16:20:21 · 264 阅读 · 0 评论 -
poj3734(矩阵快速幂)
BlocksTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7108 Accepted: 3440DescriptionPanda has received an assignment of painting a line of blocks. Sin原创 2017-09-24 21:36:11 · 273 阅读 · 0 评论 -
hihoCoder1584
#1584 : Bounce时间限制:1000ms单点时限:1000ms内存限制:256MB描述For Argo, it is very interesting watching a circle bouncing in a rectangle.As shown in the figure below, the rectangle i原创 2017-09-23 20:11:42 · 338 阅读 · 0 评论