- 博客(21)
- 收藏
- 关注
转载 容斥原理
【组合数学_容斥原理专辑】总概述 专辑的开头贡献一篇容斥原理讲得非常好的文章,讲得十分清楚,很容易就明白容斥原理是什么。 http://www.cppblog.com/vici/archive/2011/09/05/155103.html。 我个人认为容斥原理就是用来解决基于集合的统计问题,不同题目的集合有很多不同的性质,我们利用容斥理解把只有一个性质的集
2015-07-31 17:09:13 833
转载 动态规划转移方程
Robberies http://acm.hdu.edu.cn/showproblem.php?pid=2955 背包;第一次做的时候把概率当做背包(放大100000倍化为整数):在此范围内最多能抢多少钱 最脑残的是把总的概率以为是抢N家银行的概率之和… 把状态转移方程写成了f[j]=max{f[j],f[j-q[i].v]+q[i].money}(f[j]表示在概率j之下能抢的大洋
2015-07-28 20:56:51 594
原创 2015 Multi-University Training Contest 1 /hdu 5289 Assignment -树状数组
点击打开题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5289#include#include#includeusing namespace std;#define MAXN 100100#define lowbit(i) (i&(-i))int tree1[MAXN],tree2[MAXN];//int max(int a
2015-07-27 11:32:23 521
原创 poj 1011 Sticks - 经典DFS
点击打开题目链接//poj1011经典搜索#include#include#includeusing namespace std;int a[65];bool vis[65];int n;int dfs(int len,int need_len,int num)/*三个系数分别代表 当前的搜索长度, 达到目的要求还需要的长度, 还未拼接的木棒个数 */ {
2015-07-26 15:10:26 448
原创 poj 2151 Check the difficulty of problems- DP
点击打开题目链接http://poj.org/problem?id=2151RegisterUpdate your infoAuthors ranklistCurrent ContestPast ContestsScheduled ContestsAward Contestyangshengjie
2015-07-26 15:06:49 381
原创 poj3267 The Cow Lexicon -DP
点击打开题目链接http://poj.org/problem?id=3267The Cow LexiconTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8722 Accepted: 4110DescriptionFew know th
2015-07-26 13:55:41 578
原创 poj 1837 Balance -DP
题目链接http://poj.org/problem?id=1837//思路:开一个G*(平衡度)的数组,DP找的就是状态,所以平衡度就是该状态~~表示DP真的不好~~继续DP吧!//dp[i][j] 表示在挂满前i个物体的时,平衡度为j的挂法的数量。j为正表示右面重。//最极端的情况是所有物体都挂在最远端,因此平衡度最大值为15*20*25=7500。原则上就应该有dp[ 0..20 ]
2015-07-24 17:53:01 461
原创 HDU 3635 Dragon balls -并查集
题目链接点击打开链接http://acm.hdu.edu.cn/showproblem.php?pid=3635#include#includeconst int MAXN=10010;int fath[MAXN],num[MAXN],move[MAXN];int N,Q ;void init(){ for(int i=1;i<=N;i++) { fath[i]=i
2015-07-24 14:53:14 449
原创 HDU 1242 Rescue BFS+优先队列
题目链接:点击打开链接http://acm.hdu.edu.cn/showproblem.php?pid=1242#include #include #include #include #include #include using namespace std;const int N=220;int n,m,stx,sty,endx,endy;char mp[N]
2015-07-23 20:01:20 634
原创 HDU 1431 素数回文-暴力枚举
题目链接:点击打开链接http://acm.hdu.edu.cn/showproblem.php?pid=1431这道题搞了几天一直Memory Limit Exceeded,始终找不到错误,求指教,不胜感激!后附有枚举代码!#include #include #include #include #include #include #include using
2015-07-23 19:58:41 729
原创 HDU 1271 整数对-组合数学
点击打开链接http://acm.hdu.edu.cn/showproblem.php?pid=1271#include#include#includeusing namespace std; int num[100];int main(){ int n; while(~scanf("%d",&n),n) { int a,b,c; int t=0;
2015-07-22 20:08:40 583
原创 HDU3388 -Coprime-容斥原理
友情题目链接http://acm.hdu.edu.cn/showproblem.php?pid=3388#include #include #include #include using namespace std;typedef long long LL;const int N=1000005;const LL INF=(LL)1<<62;bool prime[
2015-07-22 15:07:00 943 1
原创 HDU 2577 How to Type 动态规划
友情题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2577#include#include#includeusing namespace std;const int N=110;char str[N];int close[N],open[N];int MIN(int a ,int b){ return a=a<b?a:b;}i
2015-07-22 09:22:40 679
原创 计算机网络习题辅导
第一章 测验 1.TCP/IP参考模型中的网络接口层(Network Access)对应了OSI参考模型中的( )。A.网络层 B.数据链路层和物理层 C.数据链路层 D.物理层答案关键: B2.下列Internet应用中,基于C/S计算模式的是()。A.FTP B.BT C.MSN D.Skype答案关键: A3. 数据链路层传输的数据单位是 ( )A.bi
2015-07-21 21:40:52 6345
原创 计算机网络知识点
计算机网络学习目标:了解抽象虚拟的网络结构,更好的蹭WIFI(Wireless Fidelity 无线保真) 简述1983年 ARPANET 采用TCP/IP 协议族因特网标准是以RFC的形式发表因特网的正式标准经历四个阶段:1. 因特网草案2. 建议标准3. 草案标准4. 因特网标准因特网的组成:边缘部分(连接在因特网上的主机组成,用户直接使用
2015-07-21 21:38:11 840
原创 HDU 1251 统计难题-字典树
友情题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1251基础字典树:#include#includechar s[15];struct node{ int cnt; node *next[26]; void init() //初始化 { cnt=0; for(int i=0;i<26;i++) {
2015-07-21 21:34:24 551
原创 hdoj 2277 Change the ball 【找规律】
友情题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2277#include#includeusing namespace std;int main(){ int a[3]; while(~scanf("%d%d%d",&a[0],&a[1],&a[2])) { sort(a,a+3); if(a[0]==a[1]||(
2015-07-21 21:27:44 559
原创 poj 2594 Treasure Exploration 最小路径覆盖/最大匹配
题目链接:点击打开链接http://poj.org/problem?id=2594#include#includeconst int N=510;int line[N][N];int mac[N];int used[N];int n,m;void floyd(){ for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++)
2015-07-21 21:21:20 582
原创 HDU4152-Happy 2004-积性函数和快速幂乘
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1452本题主要是积性函数和快速幂乘的运用。下面主要介绍一下积性函数:积性函数是描述因子和的一种关系:6的因子是1,2,3,6; 6的因子和是 s(6)=1+2+3+6=12;20的因子是1,2,4,5,10,20; 20的因子和是 s(20)=1+2+4+5+10+20=4
2015-07-20 16:03:21 573
原创 HDU1396:Counting Triangles -DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1396//根据每增加一条边所增加的正三角和倒三角的个数构造方程 #include#include__int64 dp[510];int main(){ int n; memset(dp,0,sizeof(dp)); dp[1]=1; for(int i=2;i<=500;i+
2015-07-20 09:31:14 609
转载 TCP协议知识点总结
TCP协议是我们学习工程实践的宝库,其中蕴含了很多重要的模型。有几个比较重要的机制可以研究:连接管理、可靠传输、流量控制和拥塞控制。在实现自己的功能模块的时候,可以借鉴其中的思想。连接管理: 可靠传输采用自适应的超时计算方法。流量控制使用一种基于滑动窗口协议的流量控制机制。包括接受窗口(rwnd)和发送窗口(也称为拥塞窗口:cwnd):rwnd限制发送方向网络注入报文的速率,cwn
2015-07-09 14:49:47 791
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人