- 博客(7)
- 收藏
- 关注
原创 【51nod 1353】 树(树形DP)
基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 今天小a在纸上研究树的形态,众所周知的,有芭蕉树,樟树,函树,平衡树,树套树等等。那么小a今天在研究的就是其中的平衡树啦。 小a认为一棵平衡树的定义为一个n个点,从1到n编号,n-1条边,且任意两点间一定存在唯一一条简单路径,且n>=k。 现在小a看到一棵很大很大的树,足足有n个节点,这里n一定大于等于k!为...
2018-10-19 16:33:54 333
原创 【CodeChef - CRYPCUR】Crypto Trading(二分套tarjan、拓扑排序)
AMRExchange is the latest cryptocurrency exchange that has become very popular among cryptocurrency traders. On AMRExchange, there are N cryptocurrencies - let us denote the ith currency by Ci. M pair...
2018-10-18 14:39:25 734
原创 【51nod 1293】 球与切换器(dp、模拟)
题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 有N行M列的正方形盒子。每个盒子有三种状态0, -1, +1。球从盒子上边或左边进入盒子,从下边或右边离开盒子。规则: 如果盒子的模式是-1,则进入它的球从下面出去。(方向变为向下) 如果盒子的模式是+1,则进入它的球从右面出去。 (反向变为向右) 如果盒子的模式是0, 则进入它的球方...
2018-10-15 21:54:36 243
原创 【CodeChef - VRTXCOVR 】Vertex Cover(2-SAT之构造解)
You are given an undirected graph G = (V, E) containing N nodes and M edges. The nodes are numbered from 1 to N. A subset C of V is a vertex cover if for every edge (u, v) ∈ E, at least one of u and v...
2018-10-14 16:08:16 350
原创 【 POJ - 3648】Wedding(2-SAT之构造解)
Up to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end, opposite each other, and the bride wears an elaborate...
2018-10-14 15:39:49 263
原创 【POJ - 3678】Katu Puzzle(2-SAT之判断有解)
Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an integer c (0 ≤ c ≤ 1). One Katu is solvable if one can find ea...
2018-10-09 21:28:28 343
原创 【POJ - 3207】Ikki's Story IV - Panda's Trick(2-SAT之判断有解)
liympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy games and wants to play another game with Ikki. l...
2018-10-09 19:32:46 273
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人