F - F HDU - 2647 拓扑排序,从上往下回溯,挺好奇差分约束为啥就不对。拓扑排序有明显的优先级。 #include<bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; const i ...
分类:
其他好文 时间:
2020-04-22 00:02:10
阅读次数:
67
Problem : Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) Push element x onto stack. pop() R ...
分类:
其他好文 时间:
2020-04-21 23:45:18
阅读次数:
59
D D HDU 3282 思路 题意:给我一个奇数长度为n的序列,从左到右依次输出 1~当前技术位置的 这个子区间内的中位数。 思路 1 .法一: 维护一个最小根堆、最大根堆(注意less 在priority_queue 中的数字排列的顺序是按从头部top 按数字大小逐渐递减,而gerater 在p ...
分类:
其他好文 时间:
2020-04-21 12:54:09
阅读次数:
59
最小生成树介绍: 修路问题本质就是最小生成树问题,先介绍一下最小生成树(Minimum Cost Spanning Tree),简称MST。 1)给定一个带权的无向连通图,如何选择一颗生成树,使树上所有边上权的总和为最小,这叫最小生成树。 2)N个顶点,一定有N-1条边 3)包含全部顶点 4)N-1 ...
分类:
编程语言 时间:
2020-04-20 23:41:35
阅读次数:
158
I I HDU 3466Proud Merchants(贪心+01背包) Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in ...
分类:
其他好文 时间:
2020-04-20 14:04:37
阅读次数:
77
Given n integers, your task is to pick k out of them so that the picked number are minimum when do bitwise “AND” among all of them. For example, there ...
分类:
其他好文 时间:
2020-04-20 11:39:23
阅读次数:
56
Paths on the treeProblem Descriptionbobo has a tree, whose vertices are conveniently labeled by 1,2,…,n.** There are m paths on the tree. bobo would l ...
分类:
其他好文 时间:
2020-04-19 18:07:45
阅读次数:
62
1. 概念 MESI(Modified Exclusive Shared Or Invalid)是一种广泛使用的支持写回策略的缓存一致性协议。 cpu核中每个缓存行使用2bit表示4种状态。 2.状态机 M(Modified,修改的): 缓存行只被缓存在该cpu中(其它cpu中如果有,也会变为inv ...
分类:
其他好文 时间:
2020-04-19 17:46:00
阅读次数:
72
二叉树的最小深度 LeetCode: "二叉树的最小深度" 题目描述: 给定一个二叉树,找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明: 叶子节点是指没有子节点的节点 示例: 思想: 还是递归,没啥特别的 代码 我的第一遍代码: 优化之后: if(x == 0||y ...
分类:
编程语言 时间:
2020-04-19 11:17:51
阅读次数:
76
<html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> <title>jQuery排名窗口文字滚动代码 ...
分类:
Web程序 时间:
2020-04-19 10:44:50
阅读次数:
96