HDU 5969 最大的位或 题目大意 B君和G君聊天的时候想到了如下的问题。 给定自然数$l$和$r$ ,选取$2$个整数$x,y$满足$l using namespace std; typedef long long ll; int main(){ ll aa,bb,t; scanf("%lld ...
分类:
其他好文 时间:
2020-05-07 18:15:15
阅读次数:
65
https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/solution/li-jie-zhe-dao-ti-de-jie-shu-tiao-jian-by-user7208/ 思路:有个特殊情况,比如树是1,2.这样的话,根节点为 ...
分类:
其他好文 时间:
2020-05-07 10:48:03
阅读次数:
60
http://acm.hdu.edu.cn/showproblem.php?pid=1272 题目链接 思路: 1.每输入一组数据,如果两个点的祖先都是相同的,那么说明他们已经是一个集合的了,如果再连接a,b两个点,就会构成回路,这里也就是要输出no. 2.并查集判断是否存在回路已经通过上述过程判断 ...
分类:
其他好文 时间:
2020-05-07 00:27:33
阅读次数:
54
题意: n层图,每个点放在一层,然后给了n个点,相邻的两层距离是固定的c,有额外m条边,然后求1到n的最短路径,如果没有则输出-1 题解: 这道题原来我想着还用1到n表示点,层用n+1到2*n表示,但是这样是不行的,因为这样建图的话就相当于同层之间的距离为0.但是事实证明不是这样的 我按照上面建图就 ...
分类:
其他好文 时间:
2020-05-06 13:44:42
阅读次数:
51
题目描述 给你一棵所有节点为非负值的二叉搜索树,请你计算树中任意两节点的差的绝对值的最小值。 示例: 题目链接: https://leetcode cn.com/problems/minimum absolute difference in bst/ 思路 二叉搜索树的中序遍历序列是一个升序序列。任 ...
分类:
其他好文 时间:
2020-05-05 23:45:00
阅读次数:
178
Tunnel Warfare HDU - 1540 During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plai ...
分类:
其他好文 时间:
2020-05-05 01:04:25
阅读次数:
78
1 #include<iostream> 2 #include<list> 3 using namespace std; 4 int main(){ 5 int t,n; 6 cin>>t; 7 while(t--){ 8 cin>>n; 9 int k=2; 10 list<int>mylist; ...
分类:
其他好文 时间:
2020-05-05 01:02:54
阅读次数:
79
Can you answer these queries? HDU - 4027 A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secre ...
分类:
其他好文 时间:
2020-05-05 00:41:14
阅读次数:
64
1.指定屏幕的缩放级别 <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"> 2.reset.css(基础样 ...
分类:
移动开发 时间:
2020-05-05 00:36:32
阅读次数:
84
Just a Hook HDU - 1698 In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of sever ...
分类:
其他好文 时间:
2020-05-05 00:29:03
阅读次数:
57