上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: Description 这项比赛将在一条笔直的河道中进行,河道中分布着一些巨大岩石。组委会已经选择好了两块岩石作为比赛起点和终点。在起点和终点之间,有 N 块岩石(不含起点和终 点的岩石)。在比赛过程中,选手们将从起点出发,每一步跳向相邻的岩石,直至到达 终点。 为了提高比赛难度,组委会计划移走一些 阅读全文
posted @ 2018-04-06 12:19 Neworld1111 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Description 有$n$个同学(编号为$1$到$n$)正在玩一个信息传递的游戏。在游戏里每人都有一个固定的信息传递对象,其中,编号为$i$的同学的信息传递对象是编号为$Ti$同学。 游戏开始时,每人都只知道自己的生日。之后每一轮中,所有人会同时将自己当前所知的生日信息告诉各自的信息传递对象( 阅读全文
posted @ 2018-04-05 23:53 Neworld1111 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Description 有两个长度都是$N$的序列$A$和$B$,在$A$和$B$中各取一个数相加可以得到$N^2$个和,求这$N^2$个和中最小的$N$个。 Input: 第一行一个正整数$N$; 第二行$N$个整数$Ai$,满足$Ai include define MAXN 100005 str 阅读全文
posted @ 2018-04-05 22:05 Neworld1111 阅读(166) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include define MAX 500005 int d[MAX],fa[MAX],size[MAX],top[MAX],son[MAX]; int N,M,S,tot=0; int head[MAX]; struct edge{ int v,next; }G[M 阅读全文
posted @ 2018-03-24 19:22 Neworld1111 阅读(133) 评论(0) 推荐(0) 编辑
摘要: "友链" Description Examples input output Solution 两两算出LCA,有两个LCA是相同的,选择另一个作为答案 这道题似乎卡常数 cpp include include include define MAXN 500005 int head[MAXN]; i 阅读全文
posted @ 2018-03-11 13:44 Neworld1111 阅读(87) 评论(0) 推荐(0) 编辑
摘要: "友链" Description Alice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any more of it. Bob has thus 阅读全文
posted @ 2018-03-11 11:25 Neworld1111 阅读(424) 评论(0) 推荐(0) 编辑
摘要: "洛谷P1250 种树 链接" "POJ1201 Intervals 链接" 差分约束,取最长路。 注意隐藏条件:因为对于第i个点有选择和不选择两种情况,所以$0 include include define MAXN 50005 define N 50005 int dis[MAXN],vis[M 阅读全文
posted @ 2018-03-10 11:32 Neworld1111 阅读(165) 评论(0) 推荐(0) 编辑
摘要: "首先先奉上一篇博客" "然后奉上洛谷模板题" 单模数 (80) cpp include include include define mod 19260817 define MAXN 10005 define base 131 char str[1505]; unsigned long long 阅读全文
posted @ 2018-03-09 23:11 Neworld1111 阅读(154) 评论(0) 推荐(0) 编辑
摘要: "题目链接" cpp include include define MAXN 1005 using namespace std; int link[MAXN],vis[MAXN],head[MAXN]; struct edge{ int v,next; }G[MAXN 阅读全文
posted @ 2018-03-08 23:35 Neworld1111 阅读(128) 评论(0) 推荐(0) 编辑
摘要: "题目链接" LCA裸题 cpp include define MAXN 1005 using namespace std; int N,Q,tot=0; struct size{ int v,w,next; }G[MAXN=0; i) if(d[anc[i][u]] =d[v])u=anc[i][ 阅读全文
posted @ 2018-03-08 23:12 Neworld1111 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页