自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(155)
  • 资源 (6)
  • 收藏
  • 关注

原创 [万能办法] Mac安装pkg包报错:安装失败 “安装器遇到了一个错误,导致安装失败,请联系软件制造商以获得帮助

然后在【系统偏好设置】-【安全性与隐私】-【通用】-【允许从以下位置下载的应用】中选择「任何来源」,然后再安装。如果依然安装失败可以重启电脑后再试一次。原理是可能因为一些权限问题安装失败,但报错信息完全只字不提权限的事,这时候直接 sudo 安装暴力解决即可。换成你的安装包的名字即可。然后输入锁屏密码,把。

2023-04-04 01:20:01 10115 4

原创 LeetCode Weekly Contest 127

第一次参加 LeetCode 的每周编程赛,排在 178 / 4682 ,还是可以接受的。(第一题交了次错答案罚时 5分钟真的伤不起啊不然都可以挺进前100了)1、1005. Maximize Sum Of Array After K NegationsGiven an array A of integers, we must modify the array in the following...

2019-03-10 11:34:31 456

原创 商汤科技2018校招研究员笔试第一场

https://www.nowcoder.com/test/11960206/summary题目1铁柱在研究一个区域的小黄车使用分布。他得到了服务器上最近10000个用户的二维位置,现在他想把这些用户聚成K(K<10) 组,每组有一个中心C_i。他想评价聚类算法的好坏,把每个数据点到中心的l1距离作为总距离。即D = sum_j || X_j - C( X_j ) ||_1其中C(X...

2019-03-03 22:50:51 1210

原创 LeetCode 101. Symmetric Tree

https://leetcode.com/problems/symmetric-tree/DescriptionGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] i...

2019-02-18 02:42:53 262

原创 LeetCode 97. Interleaving String

https://leetcode.com/problems/interleaving-string/DescriptionGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.Example 1:Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbc...

2019-02-16 17:45:49 182

原创 LeetCode 96. Unique Binary Search Trees

https://leetcode.com/problems/unique-binary-search-trees/DescriptionGiven n, how many structurally unique BST’s (binary search trees) that store values 1 … n?Example:Input: 3Output: 5Explanatio...

2019-02-16 16:59:16 165

原创 LeetCode 85. Maximal Rectangle

https://leetcode.com/problems/maximal-rectangle/DescriptionGiven a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.Example:Input:[ [...

2019-02-15 18:54:53 207

原创 LeetCode 84. Largest Rectangle in Histogram

https://leetcode.com/problems/largest-rectangle-in-histogram/DescriptionGiven n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of large...

2019-02-15 01:41:51 178

原创 LeetCode 87. Scramble String

https://leetcode.com/problems/scramble-string/DescriptionGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible rep...

2019-02-13 15:14:37 156

原创 Inplace ABNSync 与 pytorch GPU多卡并行的一点坑

pytorch GPU多卡并行的一点坑说在前头1、torch.cuda()2、ninja 的问题3、libcudart.so.9.1 找不到4、os.environ["CUDA_VISIBLE_DEVICES"] 设置无效5、 Inplace ABNSync 使用中的编译相关问题6、Inplace ABNSync 同步时卡住不动说在前头众所周知,torch.nn.DataParallel(va...

2018-12-20 02:13:28 7264 2

原创 Ubuntu 18.04和windows建立共享文件夹

1、安装sambasudo apt install samba sudo apt install cifs-utils2、创建共享目录mkdir /home/yourname/share (yourname是home下一个文件夹,自己新建)sudo chmod 777 mkdir /home/yourname/share3、创建samba配置文件并拷贝副本sudo cp /etc/...

2018-09-22 20:16:52 7113

原创 Dilated Convolutions

1. 扩张卷积Dilated Convolutions,翻译为扩张卷积或空洞卷积。扩张卷积与普通的卷积相比,除了卷积核的大小以外,还有一个扩张率(dilation rate)参数,主要用来表示扩张的大小。扩张卷积与普通卷积的相同点在于,卷积核的大小是一样的,在神经网络中即参数数量不变,区别在于扩张卷积具有更大的感受野。感受野是卷积核在图像上看到的大小,或者说卷积后的图像上,一个像素点对应着原图中...

2018-09-19 18:23:33 1114

转载 双线性插值算法以及python实现

双线性插值算法【文章主题内容为转载,代码为自己所写】,在这里也感谢一些大牛的博文。http://www.cnblogs.com/linkr/p/3630902.htmlhttp://www.cnblogs.com/funny-world/p/3162003.html双线性插值      假设源图像大小为mxn,目标图像为axb。那么两幅图像的...

2018-09-13 16:24:11 14754 4

转载 HMM和Viterbi算法

一、隐马尔可夫模型(Hidden Markov Model)1、简介  隐含马尔可夫模型并不是俄罗斯数学家马尔可夫发明的,而是美国数学家鲍姆提出的,隐含马尔可夫模型的训练方法(鲍姆-韦尔奇算法)也是以他名字命名的。隐含马尔可夫模型一直被认为是解决大多数自然语言处理问题最为快速、有效的方法。2、马尔可夫假设  随机过程中各个状态St的概率分布,只与它的前一个状态St-1有关,即P(S...

2018-09-11 16:29:55 699

原创 Leetcode 79. Word Search

https://leetcode.com/problems/word-search/description/exampleboard =[ ['A','B','C','E'], ['S','F','C','S'], ['A','D','E','E']]Given word = "ABCCED", return true.Given word = "SEE", retu...

2018-09-07 16:49:54 263

原创 去除百度右侧广告栏的插件

https://greasyfork.org/zh-CN/scripts/14178-ac-baidu-%E4%BC%98%E5%8C%96%E7%99%BE%E5%BA%A6-%E6%90%9C%E7%8B%97-%E8%B0%B7%E6%AD%8C%E6%90%9C%E7%B4%A2%E7%BB%93%E6%9E%9C%E4%B9%8B%E9%87%8D%E5%AE%9A%E5%90%91%E...

2018-07-16 00:39:42 2319

原创 POJ 滑动窗口(优先队列的应用)

数据结构与算法A (第三章 栈与队列 练习题): 滑动窗口思路对于最大最小值分别维护一个优先队列(保存元素下标)。以最小值为例。 每次遇到一个新元素,从队尾插入。插入时删去队列中比该值大的元素。(因为当前值出现的下标较晚,所以以后一定范围窗口的最小值不会超过该值)。队首是当前窗口的最小值。同时要注意维护队首的下标是否在当前窗口内。#include <iostream&g...

2018-07-11 13:18:59 1608

原创 POJ 数据结构与算法A 0407:去除C程序中的注释

http://dsa.openjudge.cn/string/0407/ 直接贴代码,注释说明的很详细。#include <iostream>#include <algorithm>#include <string>#include <cstring>#include <cstdio>#include <vect...

2018-07-11 00:39:45 945

原创 KMP 算法的应用

KMP算法的应用主要体现在Next数组的计算方式上。Next数组含义如下: Next[i] = j, 表示下标 i 之前连续 j 个字符,和字符串开始的连续 j 个字符相同。这会带来很多应用。比如1、POJ 2406:字符串乘方#include <iostream>#include <algorithm>#include <string>#i...

2018-07-10 23:59:31 1419

原创 POJ 2255:重建二叉树

http://bailian.openjudge.cn/practice/2255/思路在前序中找到根节点(每个前序串的第一个字符),然后在中序串中找到根节点的位置。前半部分是左子树,后半部分是右子树,递归输出。#include <iostream>#include <cstdio>using namespace std;string front,...

2018-07-07 17:21:43 456

原创 POJ 2251:Dungeon Master

http://bailian.openjudge.cn/practice/2251/思路“3D”的BFS,其实就是多个两个搜索的方向。(上下前后左右)#include <iostream>#include <queue>using namespace std;int L, R, C, Find, FindStep;int startx, star...

2018-07-07 16:12:43 183

转载 Android studio 手机模拟器 Guest isn’t online after 7 seconds, retrying ADB connections

android studio运行程序,打开手机模拟器,一直黑屏,提示信息为: Guest isn’t online after 7 seconds, retrying ADB connections 解决方法为: Tools -> AVD Manager -> Cold boot now 然后可以正常启动。...

2018-06-05 11:27:43 1665

原创 pip3速度慢,换源的问题

临时换源: pip3 install 包名 -i 源的url国内源列表 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/阿里云 http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/豆瓣(douban) http://p...

2018-05-30 17:12:29 6071

原创 Android Studio 按钮跳转功能的实现,以及点击后闪退问题的处理

安卓小白,课程需求要做一个APP。在做的时候,做到一个功能:点击按钮,跳转到新的界面。 教程可参考: https://blog.csdn.net/baidu_30258569/article/details/49409145 https://blog.csdn.net/mghhz816210/article/details/50373698 https://blog.csdn.net/qq...

2018-05-22 14:42:38 17734

原创 POJ 1129: Channel Allocation

http://bailian.openjudge.cn/practice/1129/ 搜索问题。用递归超时,直接用模拟法枚举即可3ms ACAC代码:染色问题。枚举相邻接点的颜色,找到最小可以使本节点染色的颜色,进行染色。#include <iostream>#include <vector>#include <cstdio>#include &...

2018-04-23 22:32:08 340

原创 POJ 1065 Wooden Sticks(贪心法)

题目链接 http://bailian.openjudge.cn/practice/1065/思路:贪心法。对所有wood按照len升序、weight升序排序。对于每一个wood,向后查找,尽可能找到能覆盖它的wood,并将覆盖它的wood标进行加工(不需要额外的setup time)。遍历时,如果当前wood未加工,setup time 加1#include <iostrea...

2018-04-17 22:18:25 342

原创 POJ 1011 Sticks(搜索问题)

题目链接 http://bailian.openjudge.cn/practice/1011/思路一(TLE): 输入数据时,计算出需要枚举的原始棍子长度的上界下界,然后枚举。对每一个stick,将他归到某一组棍子中(如果当前枚举的原始棍子长度为i,一组棍子的总和就应该恰好是i),然后搜索。#include <iostream>#include <algorithm...

2018-04-17 21:41:48 336

原创 POJ 2479 Maximum sum (动态规划)

题目链接 http://bailian.openjudge.cn/practice/2479/用两次动态规划,否则超时#include <iostream>#include <cstdio>using namespace std;int T, N;long long A[51000];long long front_sum[51000], bac...

2018-04-17 20:00:28 404

原创 POJ 2479 分解因数

题目链接 http://bailian.openjudge.cn/practice/2749/#include <iostream>#include <cstdio>using namespace std;int f(int begin, int tot){ int res = 1; // 自己本身就是1个 if(beg...

2018-04-17 19:58:46 628

原创 POJ 4001 抓住那头牛(广度优先搜索)

题目链接 http://bailian.openjudge.cn/practice/4001/#include <iostream>#include <queue>#include <cstdio>using namespace std;int N, K;int vis[201000];struct point{ int p...

2018-04-17 19:57:02 673

原创 POJ 3714 最近点对

POJ 3714 最近点对描述 给定点集A和点集B,两个点集分别有N个顶点。问任意顶点对(a,b)的最近距离是多少,其中a属于A,b属于B。输入 第一行为数据个数T,表示接下来有T个测试数据。 对于每个测试数据: 第一行为顶点个数N。(N<=100,000) 接下来N行,每行两个整数,表示点集A中的N个点的坐标。 再接下来N行,每行两个整数,表示点集B中的N个点的坐标...

2018-04-12 22:08:22 1280

原创 LeetCode | 88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional

2017-10-16 19:01:53 972

原创 LeetCode | 89. Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray

2017-09-30 10:10:20 355

原创 LeetCode | 81. Search in Rotated Sorted Array II

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Write a function to determine if a given target is in the

2017-09-22 17:49:54 325

原创 LeetCode | 80. Remove Duplicates from Sorted Array II

Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the first five element

2017-09-16 22:03:32 298

原创 LeetCode | 78. Subsets

Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,3], a solution is:[ [3], [1], [2], [1,2

2017-09-07 10:58:02 328

原创 LeetCode | 77. Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]Solution递归

2017-09-06 11:42:08 278

原创 LeetCode | 76. Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BANC".Note: If

2017-09-05 13:35:33 254

原创 LeetCode | 75. Sort Colors

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

2017-08-20 20:51:00 282

原创 LeetCode | 74. Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right. The first integer of each row is

2017-08-10 21:49:14 309

印刷体数字&&字母数据集

印刷体数字和字母的数据集,每个类别有1000张左右的图片

2019-01-03

斯坦福大学概率图模型PGM讲义

斯坦福大学概率图模型的讲义,以及笔者自行整理的部分note

2018-09-13

吴恩达机器学习课程中文笔记

吴恩达老师机器学习课程的中文笔记,包含课堂所讲的所有内容以及部分截图,适合配套慕课一起学习,方便巩固重点。

2018-09-13

MATLAB中文用户手册

MATLAB中文用户手册。包含各种代码的作用以及实例。、

2018-09-13

常用中文停用词表

常见中文停用词表。包含标点符号、数字,某些英文单词等。

2018-09-13

计算机网络(严伟、潘爱民译) 清华大学出版社 第五版 答案

计算机网络(严伟、潘爱民译) 清华大学出版社 第五版 答案 ------1-7章,基本所有题目都有,中文版,Word文档------ 计算机网络(严伟、潘爱民译) 清华大学出版社 第五版 答案

2017-09-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除