
搜索
文章平均质量分 85
MMMMMMMW
广告太多,已换博客。
https://www.cnblogs.com/MMMMMMMW/
展开
-
POJ 2836 Lake Counting (DFS典型例题)
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 39702 Accepted: 19677 Description Due to recent rains, water has pooled in various places i原创 2018-01-30 12:57:32 · 421 阅读 · 0 评论 -
Prime Ring Problem (dfs)
Prime Ring ProblemTime Limit: 2000/1000ms (Java/Others)Problem Description: A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and...原创 2018-03-14 20:35:39 · 215 阅读 · 0 评论 -
【二分查找】查找数组中第一个比k大的数的下标
题目:EPI提示:当left和right都是非负数时,使用 mid = left + (right - left) / 2;这种形式可以避免溢出。 当left和right一个为负另一个为非负时,用mid = (left + right) / 2;这种形式可以避免溢出。[cpp] view plain copyint search_first_larger_k(int* arr...转载 2018-04-26 21:41:46 · 742 阅读 · 0 评论 -
线段树模板加部分内容详解
线段树是处理区间问题的一种算法,大概内容就是下图,可以用来处理区间和等相关问题。 一、线段树的建立 void build(int l,int r,int now) { if(l == r)//到达叶子结点 { sum[now] = a[l]; return ; } int m = (l+r)>>1; build(l,m,now<<1);//...原创 2018-07-20 09:57:07 · 251 阅读 · 0 评论