码迷,mamicode.com
首页 >  
搜索关键字:intersection of two    ( 11974个结果
Common Substrings POJ - 3415 (后缀数组 + 单调栈)
A substring of a string T is defined as: T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|. Given two strings A, B and one integer K, we define S, a set of tripl ...
分类:编程语言   时间:2020-07-11 13:09:02    阅读次数:71
归并排序
归并排序: 先分治后归并。 edit play_arrow brightness_4 /* Java program for Merge Sort */ class MergeSort { // Merges two subarrays of arr[]. // First subarray is ...
分类:编程语言   时间:2020-07-10 23:51:51    阅读次数:78
LeetCode160
题目链接 https://leetcode-cn.com/problems/intersection-of-two-linked-lists/ 初次读题 初次读题可知 两个指针相同即需要求得的结果 链表长度可能不同 两个链表可能没有交叉点,此时返回NULL 不可修改链表结构 链表中无循环 我第一次读 ...
分类:其他好文   时间:2020-07-10 23:51:38    阅读次数:63
leetcode 64 add binary
题目 Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Exampl ...
分类:其他好文   时间:2020-07-10 20:58:33    阅读次数:56
LeetCode刷题
LC148 two-sum 题意:数组中找出两个加起来等于目标值的数 题解:unordered存值对应下标,注意相同数的特判 LC147 median-of-two-sorted-arrays 题意:两个有序数组中位数 题解:Kth(A,m,B,n,k),若m>n交换,pa=min(k/2,m),p ...
分类:其他好文   时间:2020-07-10 15:23:31    阅读次数:60
680. Valid Palindrome II
package LeetCode_680 /** * 680. Valid Palindrome II * https://leetcode.com/problems/delete-operation-for-two-strings/description/ * * Given two words ...
分类:其他好文   时间:2020-07-10 09:29:42    阅读次数:68
Code-Output File-Two Way
#Code-Output File-Two Way July 9, 2020 9:25 PM ##1.使用ofstream 输出 #include <fstream> SYSTEMTIME st; GetLocalTime(&st); CString strTime; strTime.Format( ...
分类:其他好文   时间:2020-07-09 22:11:03    阅读次数:73
题解 CF1004F Sonya and Bitwise OR
如果只有一次询问,可以分治,每次考虑跨过中点的情况。预处理左半边后缀or和,右半边前缀or和,然后用two pointers求。发现前、后缀or和只会变化O(log a)次。用线段树维护,记录每个区间的答案,以及前、后缀or和(这O(log a)个段)。push_up和查询时,还用two point... ...
分类:其他好文   时间:2020-07-08 23:21:12    阅读次数:78
463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve ...
分类:其他好文   时间:2020-07-08 09:14:32    阅读次数:54
ARTS-WEEK-006
Algorithm: 70: Climbing Stairs (Easy) 167: Two Sum II - Input array is sorted (Easy) 120: Triangle (Medium) 经典动态规划,状态转移方程是自底向上,row[i] = row[i] + min(p ...
分类:其他好文   时间:2020-07-05 17:18:19    阅读次数:70
11974条   上一页 1 ... 12 13 14 15 16 ... 1198 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!