上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 题意:给出m个n的全排列,求一个n的全排列,满足对于i<j,至少存在一半的全排列中,ai排在aj的前面,求字典序最小方案,或者是无解。 (1)首先我们对 vis[ a[i] ][ a[j] ]++ ,求出a[i] 对 a[j] 的贡献。对vis[i][j] 和 vis[j][i]是否大于 一半 ,若 阅读全文
posted @ 2018-09-06 20:35 jadelemon 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一棵树,树上每个节点都有一个权值,问将一条边断开,形成两棵树,每棵树上权值不同的数量 的和 , 让这个和尽量大 很显然这是一道求区间数字种类数的问题,这道题给的是一棵树,不是区间,因此我们首先将树给区间化, 然而dfs序 就是干这种事情的,我们将树区间化后,就转化为求区间【L,R】中不同的 阅读全文
posted @ 2018-09-06 10:30 jadelemon 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 又get 新知识 Lindström–Gessel–Viennot引理 改引理主要是解决n条严格不相交的路径的问题 其中ai代表路径的起点, bi代表路径的终点, e(ai,bj)代表ai到bj的方案数,答案是这个行列式的值 对于这道题而言,知道这个引理,这就是水题啊 其他知识:求组合数,本文采用这 阅读全文
posted @ 2018-09-05 21:17 jadelemon 阅读(583) 评论(2) 推荐(0) 编辑
摘要: Abandoned Animal 题目描述 Your little sister has been a big help today: she went into town to do all the groceries! During this grand voyage, she was acco 阅读全文
posted @ 2018-08-25 11:39 jadelemon 阅读(342) 评论(0) 推荐(0) 编辑
摘要: A Possible Tree 题目描述 Alice knows that Bob has a secret tree (in terms of graph theory) with n nodes with n − 1 weighted edges with integer values in [ 阅读全文
posted @ 2018-08-24 09:36 jadelemon 阅读(305) 评论(0) 推荐(0) 编辑
摘要: https://www.jisuanke.com/contest/1409/challenges 题目描述 Alice and Bob are playing a simple game. They line up a row of n identical coins, all with the h 阅读全文
posted @ 2018-08-22 10:29 jadelemon 阅读(297) 评论(0) 推荐(0) 编辑
摘要: https://www.jisuanke.com/contest/1409/challenges 题目描述 Consider a triangle of integers, denoted by T. The value at (r, c) is denoted by Tr,c , where 1 阅读全文
posted @ 2018-08-22 10:01 jadelemon 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Sequence Problem Description Let us define a sequence as below Your job is simple, for each task, you should output Fn module 1e9+7. Input The first l 阅读全文
posted @ 2018-08-20 10:47 jadelemon 阅读(157) 评论(0) 推荐(0) 编辑
摘要: HDU 6406 Taotao Picks Apples Problem Description There is an apple tree in front of Taotao's house. When autumn comes, n apples on the tree ripen, and 阅读全文
posted @ 2018-08-16 09:15 jadelemon 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/40/F来源:牛客网 珂朵莉给你一个长为n的序列,有m次查询 每次查询给两个数l,r 设s为区间[l,r]内所有数的乘积 求s的约数个数mod 1000000007 输入描述: 第一行两个正整数n,m第二行一个长为n的序 阅读全文
posted @ 2018-08-10 09:26 jadelemon 阅读(232) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页