码迷,mamicode.com
首页 >  
搜索关键字:median of two sor    ( 12209个结果
Full Binary Tree
题目来源 Full Binary Tree Description In computer science,a binary tree is a tree data structure in which each node has at most two children. Consider an ...
分类:其他好文   时间:2021-04-13 12:02:15    阅读次数:0
[CF468B] Two Sets - 2-sat
给定 $n$ 个数字,要划分成 $A,B$ 两个集合。要求对任意 $x$,若 $x$ 在 $A$ 中则 $a-x$ 也在 $A$ 中,若 $x$ 在 $B$ 中则 $b-x$ 也在 $B$ 中。保证数互不相同。 ...
分类:其他好文   时间:2021-04-06 14:31:06    阅读次数:0
02 add two numbers
02 add two numbers 1. 题目讲解 给定两个链表,每个链表表示一个整数,求这两个整数之和。结果也还是用链表表示。 2. 题解 思路: ? 本质上这道题是两个数带进位的加法。两个对应位置上的和是和对10取余。进位则是和整除10. class Solution { public: Li ...
分类:其他好文   时间:2021-04-06 14:12:17    阅读次数:0
[LeetCode] 670. Maximum Swap
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. ...
分类:其他好文   时间:2021-03-18 14:32:17    阅读次数:0
PAT 2020年秋季 7-2 How Many Ways to Buy a Piece of Land (25 分)
The land is for sale in CyberCity, and is divided into several pieces. Here it is assumed that each piece of land has exactly two neighboring pieces, ...
分类:其他好文   时间:2021-03-11 19:32:24    阅读次数:0
【数据结构】算法 Reverse Linked List II 反转链表的一部分
Reverse Linked List II 反转链表 Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list ...
分类:编程语言   时间:2021-03-10 13:27:14    阅读次数:0
#构造,二分#[AGC006B] [AGC006D] Median Pyramid
Easy Hard 分析(Easy) 若$X=1$或$X=2n-1$无解,否则在正中间构造$X-1,X,X+1$, 其余位置升序铺入剩余数, 若$X-1$左侧数大于$X-1$那么$X-1$和$X$上方必定为$X$, $X+1$上方为$X+1$,可以发现比原来更接近$X$,显然到塔尖答案即为$X$ $ ...
分类:其他好文   时间:2021-03-06 14:41:14    阅读次数:0
[LeetCode] 1046. Last Stone Weight 最后的石头重量
We have a collection of stones, each stone?has a positive integer weight. Each turn, we choose the two?heaviest?stones?and smash them together. Suppos ...
分类:其他好文   时间:2021-03-02 12:02:57    阅读次数:0
[CodeForces1492C] Maximum Width
description: There are two strings \(a\), \(b\) with the length \(n\), and \(m\). Find the Array <\(p_1, p_2, ..., p_m>\), such that \(a_{p_i}= b_i\), ...
分类:其他好文   时间:2021-03-01 13:26:32    阅读次数:0
LeetCode - Make The String Great
Given a string s of lower and upper case English letters. A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where ...
分类:其他好文   时间:2021-02-22 12:38:24    阅读次数:0
12209条   上一页 1 2 3 4 5 6 ... 1221 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!