
数学------
文章平均质量分 53
Miaowey
即使是无尽的黑夜包围了我,依愿眸子里满是星光。
while(true) ++rp;
展开
-
8.27考试整理
木工(dp)作为一代神犇WXR,准备在暑假学习LRJ,通过卖家具来发家致富。但是他手艺不精,最后还是只能为别人造栅栏。有一天,他忽然想到,如果一块木板可做出很多种栅栏的话,他也许就可以发家致富了。于是,他在想,如果他有一块为n 的木板,有多少种方法截成 4 段长为整数的段,它们可以围成一个四边形呢注意:如果两种方式中,有一点的切割位置不同,则原创 2016-08-27 15:07:03 · 1014 阅读 · 5 评论 -
EXGCD 求最小非负整数解
#include<cstdio>#include<cstring>#include<cmath>using namespace std;int Exgcd(int a, int b, int &x, int &y){ if(b==0){ x=1, y=0; return a; } int r = Exgcd(b, a%b, x, y);原创 2017-03-24 21:56:28 · 990 阅读 · 0 评论 -
poj__3145(配套总结本)
Harmony ForeverTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 5834 Accepted: 1414DescriptionWe believe that every inhabitant of this universe eventual原创 2016-12-15 18:08:14 · 363 阅读 · 0 评论 -
URAL - 1748 The Most Complex Number(数论+搜索)
URAL - 1748点我点我DescriptionLet us define a complexity of an integer as the number of its divisors. Your task is to find the most complex integer in range from 1 ton. If there are many原创 2016-09-05 20:31:18 · 488 阅读 · 0 评论 -
欧拉函数 & poj2047
欧拉函数是指:对于一个正整数n,小于n且和n互质的正整数(包括1)的个数,记作φ(n) 。通式:φ(x)=x*(1-1/p1)*(1-1/p2)*(1-1/p3)*(1-1/p4)…..(1-1/pn),其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(唯一和1互质的数就是1本身)。对于质数p,φ(p) = p - 1。注意φ(1)=1.欧拉定理:对于互质的正整原创 2016-09-25 14:48:20 · 438 阅读 · 0 评论 -
URAL - 2070
URAL - 2070点我点我:-) Interesting NumbersTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmitStatus Descriptio原创 2016-09-05 21:13:19 · 381 阅读 · 0 评论 -
8.28 考试第二题(DP + 矩阵快速幂)
显然本题很容易看出递推式,f[x] = f[x-1] + 4*f[x-2] + 2*f[x-3]但是呢,即便用滚动数组,我们也无法完成10^18数据规模的计算。。。显然。。。我们用矩阵快速幂进行优化f[x-1] f[x-2] f[x-3] ----> f[x] f[x-1] f[x-2] 0 0 0原创 2016-08-28 20:47:05 · 851 阅读 · 0 评论 -
poj 1131 (小数)十进制转八进制
POJ - 1131Octal FractionsTime Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionFractions in octal (base 8) notation原创 2016-09-19 19:57:37 · 1368 阅读 · 0 评论 -
啊啊啊求c(n,k)
poj 1306 Combinations 下面给出两种方法^-^(都AC!!!)#include#include#include#include#include#includeusing namespace std;#define For(i, a, b) for(int i = a; i <= b; i++)#define ULL原创 2016-09-22 22:32:45 · 572 阅读 · 0 评论 -
poj 1019 (数学计算)
POJ - 1019点我点我:-)大致题意:有一串数字串,其规律为1 12 123 1234 12345 123456 1234567 12345678 123456789 12345678910 1234567891011 123456789101112······k输入位置n,计算这一串数字第n位是什么数字,注意是数字,不是数!例如12345678910的第10位是原创 2016-09-21 21:36:19 · 472 阅读 · 0 评论 -
poj 1811 (prime test)
POJ - 1811Prime TestTime Limit:6000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionGiven a big integer number, you are req原创 2016-09-15 12:05:34 · 630 阅读 · 0 评论 -
任意模数求行列式
void Guass(int n){ int ans = 1; For(i, 1, n){ For(j, i + 1, n){ while(a[j][i]){ int t = a[i][i] / a[j][i]; For(k, i, n){ ...原创 2018-07-04 23:16:51 · 504 阅读 · 0 评论