摘要: 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<stack> 5 #include<algorithm> 6 #include<queue> 7 #include<cmath> 8 using namesp 阅读全文
posted @ 2016-06-22 21:16 wls001 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cstring> 3 #include<algorithm> 4 #include<cmath> 5 #include<cstdio> 6 #include<queue> 7 #define LL long long 8 using n 阅读全文
posted @ 2016-06-20 21:07 wls001 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 #include<queue> 7 #define inf 2147483647 8 using 阅读全文
posted @ 2016-06-19 21:28 wls001 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cmath> 3 #include<algorithm> 4 #include<cstring> 5 #include<cstdio> 6 #include<queue> 7 #define inf 2147483647 8 using 阅读全文
posted @ 2016-06-18 23:39 wls001 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cmath> 3 #include<algorithm> 4 #include<cstring> 5 #include<cstdio> 6 #include<queue> 7 #define inf 2147483647 8 using 阅读全文
posted @ 2016-06-18 23:24 wls001 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cstring> 3 #include<algorithm> 4 #include<cmath> 5 #include<cstdio> 6 #include<queue> 7 using namespace std; 8 struct 阅读全文
posted @ 2016-06-18 12:54 wls001 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <queue> 3 #include<string.h> 4 using namespace std; 5 #define arraysize 201 6 int maxData = 0x7fffffff; 7 int a[222][ 阅读全文
posted @ 2016-06-18 12:38 wls001 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 众所周知 ,所以我们只需要求出m!和n!(m-n)!。 但是由于n和m都偏大,直接乘一定会爆掉(喜闻乐见(●'◡'●))。所以我们首先想到的是边乘边模,但是尝试了一组数据后我们神奇地发现答案不对。 但是我们知道另一种定理,n!%p=n!边乘边模的逆元。 所以这时候我们可以利用逆元来解决这个问题。 而 阅读全文
posted @ 2016-03-27 10:12 wls001 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 关于RMQ的问题我就直接截取刘汝佳的《算法竞赛训练指南》上的解释了 阅读全文
posted @ 2016-01-28 13:30 wls001 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 在数论,对正整数n,欧拉函数是小于n的数中与n互质的数的数目。首先我们给出欧拉函数的通式:其中p1, p2……pk为n的所有质因数,n是不为0的整数。以上式子是如何得到的呢?下面给出证明:先将n分解质因数为然后利用容斥原理来减去p1、p2……pk的倍数的个数,即。然后我们加上同时时两个因数的倍数的数... 阅读全文
posted @ 2016-01-27 13:51 wls001 阅读(159) 评论(0) 推荐(0) 编辑