
类欧几里得算法
里阿奴摩西
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[类欧几里得算法 数论] BZOJ 2987 Earthquake
第一道类欧题 其实是裸题啦 手推 #include #include #include using namespace std; typedef long long ll; inline char nc(){ static char buf[100000],*p1=buf,*p2=buf; if (p1==p2) { p2=(p1=buf)+fread(buf,1,100原创 2016-08-28 07:55:56 · 1543 阅读 · 0 评论 -
[类欧几里得算法 数论] BZOJ 3817 Sum
类欧的变形 #include #include #include #include #include using namespace std; typedef long long ll; inline char nc(){ static char buf[100000],*p1=buf,*p2=buf; if (p1==p2) { p2=(p1=原创 2016-08-28 07:58:28 · 1468 阅读 · 0 评论 -
[类欧几里得算法 数论] BZOJ 2187 fraction
应该也是个变形 %%%Vani #include #include #include #include using namespace std; typedef long long ll; typedef pair abcd; inline char nc(){ static char buf[100000],*p1=buf,*p2=buf; if (p1==p2) { p2=(原创 2016-08-28 08:00:00 · 1028 阅读 · 1 评论 -
[类欧几里得算法 数学技巧] 51Nod 1132 覆盖数字的数量 V2 & Ural 1797 Summit Online Judge. Version 2
传送门:http://acm.timus.ru/problem.aspx?space=1&num=1797 讨论帖 膜拜各路神犇:http://www.51nod.com/question/index.html#!questionId=683 分类讨论 n>=x*y 以及 n #include #include #include using namespace std; typede原创 2016-11-25 20:32:10 · 857 阅读 · 0 评论 -
[类欧几里得算法 线段树] BZOJ 1938 [CROATIAN2010] ALADIN
直接在线段树上区间覆盖咯 怎么求和? ∑x=lr(A∗x) mod B=∑x=lrA∗x−B∗∑x=lr⌊A∗xB⌋\sum_{x=l}^r (A*x)\ mod\ B=\sum_{x=l}^r A*x-B*\sum_{x=l}^r\lfloor {A*x \over B}\rfloor后半部分直接用类欧求就好了 类似 [类欧几里得算法 数论] BZOJ 2987 Earthquake 但是更原创 2017-03-18 20:12:17 · 1349 阅读 · 0 评论 -
[类欧几里得算法] BZOJ 2712 [Violet 2]棒球
同 [类欧几里得算法 数论] BZOJ 2187 fractionAwD orzz#include<cstdio> #include<cstdlib> #include<algorithm> #include<cmath> using namespace std; typedef long long ll; typedef pair<ll,ll> abcd; abcd Solve(ll原创 2017-03-10 16:13:07 · 613 阅读 · 0 评论 -
[类欧几里得算法] Codechef JUNE17 #ES Euler Sum
这题有毒吧⌊ei⌋=⌊(e×10w)i10w⌋\lfloor ei\rfloor=\lfloor {(e\times 10^w)i \over 10^w}\rfloor然后只要ee的精度足够高 就可以当做整数类欧求 这里ww取80008000,40004000是不够的,纠结了好久,阿爷说会小数点后有进位进到个位from decimal import * import mathdef calc(a,b原创 2017-06-13 20:31:51 · 477 阅读 · 0 评论