上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 31 下一页
摘要: /* codevs 3119 高精度练习之大整数开根 (各种高精+压位) 二分答案 然后高精判重 打了一个多小时..... 最后还超时了...压位就好了 测试点#1.in 结果:AC 内存使用量: 256kB 时间使用量: 0ms 测试点#2.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms 测试点#3.in 结果... 阅读全文
posted @ 2016-10-18 21:30 一入OI深似海 阅读(703) 评论(0) 推荐(0) 编辑
摘要: /*codevs 1519 过路费 最小生成树+倍增*/ #include #include #include #include #define maxn 100010 #define inf 0x3f3f3f3 using namespace std; int n,m,q,num,head[maxn],fa[maxn][25],mx[maxn][25],c[maxn],father[maxn]... 阅读全文
posted @ 2016-10-18 21:27 一入OI深似海 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 分火腿 (hdogs.pas/.c/.cpp) 时间限制:1s;内存限制 64MB 题目描述: 小月言要过四岁生日了,她的妈妈为她准备了n根火腿,她想将这些火腿均分给m位小朋友,所以她可能需要切火腿。为了省事,小月言想切最少的刀数,使这n根火腿分成均等的m份。请问最少要切几刀? 输入描述: 第一行一 阅读全文
posted @ 2016-10-18 17:52 一入OI深似海 阅读(955) 评论(0) 推荐(0) 编辑
摘要: /* poj 3565 递归分治 还有用KM的做法 这里写的分治 按紫书上的方法 不过那里说的有点冗杂了 可以简化一下 首先为啥可以分治 也就是分成子问题解决 只要有一个集合 黑白的个数相等 就一定能一一匹配 这个应该比较明显 因为是special judge 所以我们只要保证每次处理的集合黑白相等就好了 关键是怎么分 我们找到最下最左的点 作为基点 然后将其他的按照连线与横坐标夹角的大... 阅读全文
posted @ 2016-10-18 17:50 一入OI深似海 阅读(222) 评论(0) 推荐(0) 编辑
摘要: /* 莫名其妙就做了集训队的题 不过..数据好水 codevs 1342 哈哈哈乱搞85 贪心的(好像有bug2333)照起点和终点 然后dp搞答案 这个应该很简单的 要滚一下数组 同桌打的暴力dp 55好像 思路一样的 就是省去了那个正确性不一定的贪心 */ #include #include #define maxn 200010 using namespace std; int ... 阅读全文
posted @ 2016-10-18 07:45 一入OI深似海 阅读(454) 评论(0) 推荐(0) 编辑
摘要: /* poj 1821 n*n*m 暴力*/ #include #include #include #include #define maxn 110 #define maxm 16010 using namespace std; int n,m,f[maxn][maxm],ans; struct node{ int l,s,p; bool operator y?x:y; } i... 阅读全文
posted @ 2016-10-17 16:06 一入OI深似海 阅读(219) 评论(0) 推荐(0) 编辑
摘要: /* bzoj 2763 SPFA小优化 循环队列+SLF 顺面改掉自己之前手打qeueu的坏毛病*/ #include #include #include #define mk make pair #define maxn 2000010 #define N 2000000 using namespace std; int n,m,k,s,t,num,hea[maxn],dis[maxn],c... 阅读全文
posted @ 2016-10-16 11:38 一入OI深似海 阅读(208) 评论(0) 推荐(0) 编辑
摘要: /*后来该数据了那个题 原来的被卡常数了 重写了一份*/ #include #include #include #define maxn 7010 #define mem(a,b)for(int i=0;i'9'){if(s=='-')f=-1;s=getchar();} while(s>='0'&&sm)return; mes(g,0); for(int i=0;ic)... 阅读全文
posted @ 2016-10-16 11:37 一入OI深似海 阅读(507) 评论(0) 推荐(0) 编辑
摘要: /* 一看就是最大匹配然后删边.... 开始不会建图...总觉得有好多 分 ... 看了看题解 二分图嘛 按行列建图 某个点能放车 x连y 最后删掉这个匹配和边 看看能不能匹配 */ #include #include #include #define maxn 110 using namespace std; int n,m,k,G[maxn][maxn],match[maxn],mx,... 阅读全文
posted @ 2016-10-15 21:47 一入OI深似海 阅读(183) 评论(0) 推荐(0) 编辑
摘要: /* hdu 1599 ( find the mincost route ) Floyed求最小环 每个环一定是 由 i j k 构成 假设k是环中的max 要成环 就要保证不是链(md废话) 利用Floyed的最外层循环含义 i-j最短路经过的点编号=3 因为i j k 互不相同 */ #include #include #include #define maxn 110 #defi... 阅读全文
posted @ 2016-10-14 22:22 一入OI深似海 阅读(314) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 31 下一页