码迷,mamicode.com
首页 >  
搜索关键字:pair    ( 2800个结果
二叉树的右视图
给定一棵二叉树,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。示例:输入: [1,2,3,null,5,null,4]输出: [1, 3, 4]解释: 1 rightSideView(TreeNode* root) { vector ans; if(root==NULL)... ...
分类:其他好文   时间:2020-04-22 09:54:24    阅读次数:52
239.Sliding Window Maximum
题目描述 Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the ...
分类:Windows程序   时间:2020-04-21 23:44:12    阅读次数:95
[每日一题]:糖糖别胡说,我真的不是签到题目
题目: 考察点: 差分数组,思维。 分析: Code: ...
分类:其他好文   时间:2020-04-20 23:53:02    阅读次数:115
代码模板(new)
1.树状数组:题目:UVA1428 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<string> 5 #include<cstring> 6 #include<numeric> 7 #include< ...
分类:其他好文   时间:2020-04-18 20:11:25    阅读次数:110
646. Maximum Length of Pair Chain
Problem : You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can ...
分类:其他好文   时间:2020-04-18 10:09:19    阅读次数:67
哈夫曼树
先给出哈夫曼树的定义:构造一颗包含n个节点的k叉树其中每个叶子节点都有权值w[i],要求最小化所有叶子节点的w[i]*deep[i]之和.该问题的解被称为k叉哈夫曼树. 先来说两个引理: 1.权值最小的节点深度必定最大. 证明:我们设x,y.使得w[x]>w[y].但deep[x]>deep[y]如 ...
分类:其他好文   时间:2020-04-16 20:55:30    阅读次数:89
题解 CF3B 【Lorry】
这道题大可看成贪心来做。 根据题目所说,物品重量无非两种,要么重量是 1 ,要么重量是 2 ,那么按物品重量把它们分成两类,用一个 $pair$ 来存物品的价值和序号(因为输出要用),按价值对两个物品序列降序排序。 然后枚举用 $i$ 个重量为 1 的物品(理论上 2 也可以),那么就用了 $\fr ...
分类:其他好文   时间:2020-04-16 13:18:58    阅读次数:48
BASIC-7 特殊的数字
逐个分解数字判断和是否为本身 ...
分类:其他好文   时间:2020-04-15 17:42:09    阅读次数:47
VsCode插件
Chinese(Simplified) Language Pack for Visual Stidio Code 中文汉化包 Bracket Pair Colorizer 用不同颜色高亮显示匹配的括号 Auto Rename Tag 尾部闭合标签同步修改 Auto Close Tag 自动闭合标签 ...
分类:其他好文   时间:2020-04-14 15:12:29    阅读次数:66
2019-2020 ACM-ICPC Latin American Regional Programming Contest A- Algorithm Teaching 二分图
``` #include #define f first #define s second using namespace std; typedef long long ll; const int N=300005; typedef pair P; int n,tot,t,V; map mp; ma... ...
分类:其他好文   时间:2020-04-12 18:18:38    阅读次数:100
2800条   上一页 1 ... 24 25 26 27 28 ... 280 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!