会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
晨阳
导航
博客园
首页
新随笔
联系
订阅
管理
公告
上一页
1
2
3
4
5
6
7
8
下一页
2018年8月2日
链式前向星详解(转)
摘要: 转自我们首先来看一下什么是前向星. 前向星是一种特殊的边集数组,我们把边集数组中的每一条边按照起点从小到大排序,如果起点相同就按照终点从小到大排序,并记录下以某个点为起点的所有边在数组中的起始位置和存储长度,那么前向星就构造好了. 用len[i]来记录所有以i为起点的...
阅读全文
posted @ 2018-08-02 14:40 ~~晨阳
阅读(415)
评论(0)
推荐(0)
LCA最近公共祖先(Tarjan离线算法)详解(转)
摘要: 转自https://www.cnblogs.com/ECJTUACM-873284962/p/6613379.html 首先是最近公共祖先的概念(什么是最近公共祖先?): 在一棵没有环的树上,每个节点肯定有其父亲节点和祖先节点,而最近公共祖先,就是两个节点在这棵...
阅读全文
posted @ 2018-08-02 11:23 ~~晨阳
阅读(202)
评论(0)
推荐(0)
POJ1330-LCA最近公共祖先(Tarjan算法模板代码)
摘要: 转自:https://blog.csdn.net/Akatsuki__Itachi/article/details/81279173题目链接 poj1330关于LCA的Tarjan算法详解可看https://blog.csdn.net/Septembre_/ar...
阅读全文
posted @ 2018-08-02 11:19 ~~晨阳
阅读(150)
评论(0)
推荐(0)
CodeForces - 899B
摘要: Everybody in Russia uses Gregorian calendar. In this calendar there are 31 days in January, 28 or 29 days in February (depending on wh...
阅读全文
posted @ 2018-08-02 11:09 ~~晨阳
阅读(200)
评论(0)
推荐(0)
2018年8月1日
Color the ball (树状数组,改段求点)
摘要: N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#includeusing namespace std;int c[100100];int a[100100];int n;int lowbit(int x){ ...
阅读全文
posted @ 2018-08-01 11:00 ~~晨阳
阅读(128)
评论(0)
推荐(0)
2018年7月31日
A Simple Problem with Integers(树状数组,改段求段)
摘要: A Simple Problem with IntegersYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of...
阅读全文
posted @ 2018-07-31 20:24 ~~晨阳
阅读(165)
评论(0)
推荐(0)
CodeForces - 1005C (map)
摘要: 题目链接 CodeForces - 1005CA sequence a1,a2,…,an is called good if, for each element ai, there exists...
阅读全文
posted @ 2018-07-31 11:30 ~~晨阳
阅读(193)
评论(0)
推荐(0)
树状数组(逆序对)(模板)
摘要: 举个例子加以说明: 例子来源 假设给定的序列为 4 3 2 1,我们从左往右依次将给定的序列输入,每次输入一个数temp时,就将当前序列中大于temp的元素的个数计算出来,并累加到ans中,最后ans就是这个序列的逆序数个数。 序列的变化(下划线为新增加元...
阅读全文
posted @ 2018-07-31 11:09 ~~晨阳
阅读(218)
评论(0)
推荐(0)
2018年7月30日
线段树习题集(模板)
摘要: I Hate It 暑假训练7.30——(基础...
阅读全文
posted @ 2018-07-30 16:19 ~~晨阳
阅读(224)
评论(0)
推荐(0)
2018年7月27日
BFS和DFS模板
摘要: BFS#include #include #include #include #include #include #include struct A{ int x,y,time;}t,now;int map1[350][350];int m,n;int vis[...
阅读全文
posted @ 2018-07-27 11:37 ~~晨阳
阅读(138)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页