7 fisty

尚未进行身份认证

我要认证

hi

等级
TA的排名 1w+

anaconda 安装使用 opencv ERROR

系统Ubuntu 18.04 LTSpython 版本 Anaconda python3.6采用conda install opencv后,调用opencv的函数时,出现错误:cv2.error: OpenCV(3.4.1) /opt/conda/conda-bld/opencv-suite_1530789967746/work/modules/highgui/src/window.cpp:...

2019-05-27 09:11:33

【leetcode206】206. Reverse Linked List 反转链表

Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL迭代版/** * Definition for singly-linked list. * struct ListNode { * ...

2018-08-02 17:31:45

【leetcode148 Sort List】链表归并排序,空间复杂度o(logn)

Sort a linked list in O(n log n) time Example 1:Input: 4->2->1->3 Output: 1->2->3->4Example 2:Input: -1->5->3->4->0 Output: -1->0->3->4->5 解析: 先递归

2018-07-23 17:56:40

C++ cv::Mat转unity Texture2D

解决的c++项目里的图片需要传输到unity做显示,返回的是cv::Mat 的data和 宽高,原始图像是三通道RGB图 C++:cv::Mat _currentFrame;void GetRawImageBytes(unsigned char* data, int width, int height){ //Resize Mat to match the array passe...

2018-07-16 12:27:15

c++ typename和class的区别

相信学习C++的人对class这个关键字都非常明白,class用于定义类,在模板引入c++后,最初定义模板的方法为: template……在这里class关键字表明T是一个类型,后来为了避免class在这两个地方的使用可能给人带来混淆,所以引入了typename这个关键字,它的作用同class一样表明后面的符号为一个类型,这样在定义模板的时候就可以使用下面的方式了:template……...

2018-06-29 11:49:50

【leetcode】111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no childre...

2018-05-19 17:04:23

【leetcode】 75. Sort Colors

Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the in...

2018-05-15 16:35:07

【leetcode】 64. Minimum Path Sum 动态规划

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at a...

2018-05-04 17:42:41

【leetcode 】 57 Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Examp...

2018-05-02 14:43:24

【leetcode】No.56. Merge Intervals 区间合并 题解

Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlap...

2018-04-26 17:05:24

【leetcode】55. Jump Game 动态规划解法

55. Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determ...

2018-04-19 16:34:32

lightoj 1145 Dice (I) (DP)

1145 - Dice (I) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBYou have N dices; each of them has K facesnumbered from1 t

2015-10-11 23:01:09

1418 - Trees on My Island ( Peake's theorem )

1418 - Trees on My Island PDF (English)StatisticsForumTime Limit: 5 second(s)Memory Limit: 32 MBI have bought an island where I want to plant tree

2015-10-11 22:50:35

用后缀数组求两个字符串的最长公共子串

对于两个字符串,不好直接运用后缀数组,所以我们可以把两个子串串中间用一个在字符串中不会出现的字符连接起 来,比如'$‘,计算后缀数组,检查后缀数组中所有相邻后缀。分属于两个字符串的后缀的lcp的最大值就是答案。因为字符串的任何一个子串都是这个字符串某个后缀的前缀。求A和B 的最长公共子串等价于求A得后缀和B的后缀的最长公共前缀。/******************************

2015-08-30 17:28:33

SPOJ DISUBSTR Distinct Substrings (后缀数组)

题意:给定一个字符串,求不相同的子串个数.每一个子串一定是某个后缀的前缀。对于一个字符串的后缀,一共可以产生n - sa[i] + 1个子串。但是其中有height[i]个和前面是相同的.所以对于每一个后缀S[sa[i]].贡献的子串个数是n - sa[i] + 1 - height[i];累加后便是答案./*****************************************

2015-08-30 16:39:17

POJ 3261 Milk Patterns (后缀数组)

题意:求可重叠k次的最长重复子串.思路:和这题类似,http://blog.csdn.net/u013008291/article/details/48105673先二分答案,判断是否有长度为s的可重叠k次的重复子串,之后将后缀分成若干组。要判断有没有一组的后缀个数大与等于k,有则抬高二分答案的上界。/******************************************

2015-08-30 16:24:42

POJ 1743 Musical Theme (后缀数组)

思路:先二分答案,判断是否存在两个长度为k的子串是相同的,且不重叠。之后把排好序的后缀按照后缀之间的height值都不小于k分为若干组。例如当字符串为“aabaaaab”时,k = 2,后缀分成了如下4组:可以看出,有希望成为最小公共前缀不小于k的两个后缀一定在同一组。然后对于每组后缀,只需判断每个后缀的sa值的最大值和最小值之差是否大于等于k。如果有一组满足则存在。/********

2015-08-30 16:18:16

poj2406 Power Strings(KMP)

定理:假设S的长度为n,则S存在循环子串,当且仅当,n可以被n - next[len]整除,最短循环子串为S[n - next[n]]例子证明:设S=q1q2q3q4q5q6q7q8,并设next[8] = 6,此时str = S[len - next[n]] = q1q2,由字符串特征向量next的定义可知,q1q2q3q4q5q6= q3q4q5q6q7q8,即有q1q2=

2015-08-29 10:09:21

HDU 4686(矩阵快速幂)

An Arc of Dream is a curve defined by following function:where a 0 = A0 a i = a i-1*AX+AY b 0 = B0 b i = b i-1*BX+BY What is the value of AoD(N) modulo 1,000,000,007?   Input

2015-08-27 13:40:37

HDU4687 (一般图匹配)

A new season of Touhou M-1 Grand Prix is approaching. Girls in Gensokyo cannot wait for participating it. Before the registration, they have to decide which combination they are going to compete as. E

2015-08-27 13:34:33

查看更多

勋章 我的勋章
  • 专栏达人
    专栏达人
    授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!