自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(202)
  • 收藏
  • 关注

原创 Round C 2019 - Kick Start 2019 Circuit Board

#include <iostream>#include <string>#include <vector>#include <unordered_map>#include <list>#include <limits.h>#include <algorithm>#include <map>...

2019-05-28 00:35:08 458

原创 kick start 2019 round A Parcels

#include <iostream>#include <string>#include <vector>#include <unordered_map>#include <list>#include <limits.h>#include <algorithm>#include <map>...

2019-05-18 18:45:19 458

原创 阿里云 ai计算平台事业部 实习 一面面经

上周找的阿里云的内部人员内推的,加了微信约今天下午简单的电话面试。主要聊了30分钟,全程聊项目。主要问题:1.k8s主要的架构和概念2.pod,deployment介绍一下3.创建一个pod的过程4.k8s的热升级5.service是干什么的6.当时你们为什么优化python多线程7.GPU调度器的实现8.nvdia_docker 是怎么获取GPU信息的知道么?9.redis...

2019-03-07 16:36:44 1580

原创 2019 字节跳动 实习面经

本人目前在南京大学 本硕都是电子 比较水。。。之前有在图森基础架构部门实习所以对容器编排,docker和faas函数计算有所了解,就走的头条的内推,推的是上海的基础架构部门。有一点还是体验不错的,刚内推完半个小时hr就来电话约面试时间,非常的效率。我约的时间是下午四点,一次性面完3面大概持续了3个小时。形式走的是牛客网的面试平台,视频面加上编辑器撸代码。一面:第一面一上来先让我自我介...

2019-03-07 14:19:17 3168 1

原创 Linux 系统资源查看 常用命令总结

一些常用的命令总结查看系统的cpu的信息:lscpu只看核数:nproc查看系统当前的资源占用情况 top主要是记得和几核联系起来,负载的表示是按照核数来计算的,单核的上限是1多核的上限就是核数。分别是1分钟 5分钟 10分钟的负载情况。然后就是实时的看内存和cpu的使用情况。ctrl + Z 是将当前的控制台的任务 暂停放入作业当中jobs 查看当前的作业jobs -l 查...

2019-01-02 20:14:31 278

原创 重建二叉树

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };例如输入前序遍历序列{1,2,4,...

2018-12-22 17:18:24 136

原创 86. Partition List

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* pa...

2018-12-22 15:50:41 190

原创 234. Palindrome Linked List

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: bool isPalin...

2018-12-22 15:30:32 138

原创 222. Count Complete Tree Nodes

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */clas...

2018-12-22 14:41:40 139

原创 二叉树后序遍历的简单实现

实现二叉树的后序遍历#include "head.cpp"struct Node { Node* left; Node* right; int val; Node(int v,Node* l,Node* r):val(v),left(l),right(r){}};void posOrder(Node* head) { if(!head) return; stack&lt;N...

2018-12-22 10:25:12 218

原创 互斥锁和条件变量的封装类

/*两个简单的实现类: MutexLock,MutexLockGuard,Condition类MutexLock是封装了互斥量的封装类MutexLockGuard是管理MutexLock资源的警卫类Condition是条件变量的封装类 */class MutexLock : boost::noncopyable {public: MutexLock() : holder_(0)...

2018-12-17 12:56:45 250

原创 momenta实习面试总结

写在前面最近闲来无事就试试各家公司的面试,发现现在的寒假实习还是比较好找的,可能由于寒假比较缺实习生所以实习的机会和难度还是比较小的。我投的momenta的实习岗位其实是后端偏系统之类的岗位但是实际上接收到的面试没有一面是这个相关的。比较有意思的是我收到了2个部门的3次1面。1面首先是一个地图部门的做硬件加速的面试我问了我很多的这方面的东西,尤其对非线性和线性优化很感兴趣,正巧我之前本科毕...

2018-12-04 00:38:19 7837

原创 OJ RuntimeError常见原因

RuntimeError常见出错的原因可能有以下几种:1、数组开得太小了,导致访问到了不该访问的内存区域2、发生除零错误3、大数组定义在函数内,导致程序栈区耗尽4、指针用错了,导致访问到不该访问的内存区域5、还有可能是程序抛出了未接收的异常最经常的就是你使用c++数组的访问越界 或者访问不存在的内存单元。注意检查自己的代码。...

2018-12-03 14:48:59 4235

原创 dijkstra解题代码

#include &lt;iostream&gt;#include &lt;string&gt;#include &lt;stdio.h&gt;#include &lt;string.h&gt;#include &lt;vector&gt;#include &lt;ctime&gt;#include &lt;set&gt;#include &lt;map&gt;#i

2018-12-03 14:47:30 178

原创 图森未来实习面经

图森未来全栈实习生面试总结总体经历了3面,都是电话面,前两面是技术面主要是技术问答和共享编辑器手撸算法题。第三面是主管面主要是基础知识以及实习意向的问答。最终成功拿到了offer。后序细节有空再补。...

2018-11-20 20:14:39 5788 4

原创 旷视科技face++ AI工程师面经·

旷视科技面经我是面的开发岗位 主要的语言是c++和python一面上午10点电话面试。上来先是自我介绍,大概说一下学校,本硕的情况,接着是当前做过的项目和学习的技术。接着问算法题:第一题:给出一些整数区间的无序集合,如何将这些集合进行合并,最后返回合并到不能在合并的区间集合。这道题目比较的简单就是贪心,先对集合当中的区间按照起点进行排序,之后一遍扫描就可以解决。第二道题目:给出一...

2018-11-19 20:26:23 2513 3

原创 杂记

vim操作查看文件上下翻页 :ctrl + f 或者ctrl + b光标跳到之指定的行:命令模式下 :行号复制一行:yy粘贴:p到文档末尾一行 :GNFS服务器安装nfs服务:sudo apt install nfs-common修改配置文件:sudo vim /etc/exports修改内容:/home *(rw,sync,no_root_squash)/h...

2018-10-21 09:26:42 197

原创 笔试模板

#include &lt;iostream&gt;#include &lt;string&gt;#include &lt;stdio.h&gt;#include &lt;string.h&gt;#include &lt;vector&gt;#include &lt;ctime&gt;#include &lt;set&gt;#include &lt;map&gt;#i

2018-10-15 09:40:06 377

原创 hihocoder #1851 : D级上司

时间限制:10000ms单点时限:1000ms内存限制:256MB描述H公司一共有N名员工,编号为1~N,其中CEO的编号是1。除了CEO之外,每名员工都恰好有唯一的直接上司;N名员工形成了一个树形结构。我们定义X的1级上司是他的直接上司,2级上司是他上司的上司,以此类推……请你找出每名员工的D级上司是谁。输入第一行包含2个整数N和D。以下N-1行每行包含一个整数,依次代表编...

2018-10-14 20:56:14 316

原创 97. Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.Example 1:Input: s1 = “aabcc”, s2 = “dbbca”, s3 = “aadbbcbcac”Output: trueExample 2:Input: s1 = “aabcc”, s2 = “dbbca”,...

2018-10-14 11:02:19 458

原创 股票买卖最大收益总结-Best Time to Buy and Sell Stock

Best Time to Buy and Sell Stock IIISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at mo...

2018-10-13 17:08:51 615

原创 85. Maximal Rectangle

Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.Input:[[“1”,“0”,“1”,“0”,“0”],[“1”,“0”,“1”,“1”,“1”],[“1”,“1”,“1”,“1”,“1”],[“1...

2018-10-12 22:36:43 112

原创 84. Largest Rectangle in Histogram

Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.参考一下大神的总结:LeetCode Monotone Stack Summary ...

2018-10-12 22:18:16 353

原创 42. Trapping Rain Water

42. Trapping Rain Water参考:LeetCode Monotone Stack Summary 单调栈小结Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to t...

2018-10-12 20:54:48 899

原创 使用Intellij Idea 创建一个JDBC连接数据库的程序步骤

JDBC使用案例[参考]使用Intellij Idea 创建一个JDBC连接数据库的程序步骤:创建一个目录,用来放mysql的驱动包,类似eclipse的lib目录:JDBCDemo-&gt;New-&gt;Directory。把mysql的jar包复制过来把jar包添加到项目里,类似eclipse的add to build path功能,快捷键:Ctrl+Alt+Shi...

2018-10-11 20:56:51 9995 2

原创 Echo 服务器练习

简单Echo服务器package zhc.Net;import java.io.*;import java.net.InetAddress;import java.net.ServerSocket;import java.net.Socket;import java.util.Scanner;/** * 简单的Echo服务器 */public class EchoServe...

2018-10-11 10:32:01 252

原创 DP : 132. Palindrome Partitioning II

132. Palindrome Partitioning IIGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.Example:In...

2018-10-10 21:38:46 132

原创 今日头条笔试 10.8 第一题

#include&lt;iostream&gt;#include&lt;math.h&gt;#include&lt;algorithm&gt;#include&lt;string.h&gt;#include&lt;string&gt;#include&lt;stdio.h&gt;#include&lt;fstream&gt;using namespace std;const lo

2018-10-10 21:37:04 157

原创 telnet 使用

Windows 默认是关闭Telnet服务的,打开的话需要通过控制面板打开这里有个打开控制面板的快捷方式:Windows 上查看Telnet命令参数帮助的方式

2018-10-10 08:46:32 851

原创 PlantUML使用教程

双击 plantuml.jar 文件, 启动 plantUML界面. 可以点击"Change Directory"按钮 来重新指定工作目录. 保持界面处于打开状态,不要关闭.这时候,就可以尝试绘制您的第一个本地UML图了. 可以使用任何您喜欢的文本工具, 例如, 在工作目录中建立一个sequenceDiagram.txt, 内容如下:@startumlAlice -&gt; Bob: tes...

2018-10-09 19:33:49 1545

原创 2019/10/8今日头条笔试

2019/10/8今日头条笔试 第三题public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int num = Integer.parseInt(scanner.nextLine()); for(int i=0; i&lt;num; i++) { ...

2018-10-09 09:26:28 320

原创 2019/10/8 今日头条笔试第3题

2019/10/8 今日头条笔试第3题#include &lt;iostream&gt;#include &lt;vector&gt;using namespace std;int helper(int n,int m,vector&lt;vector&lt;int&gt;&gt;&amp; dp,vector&lt;vector&lt;int&gt;&gt;&amp; arm,in

2018-10-09 09:04:45 222

原创 2019/10/8今日头条笔试

2019/10/8 今日头条笔试第五题#include &lt;iostream&gt;#include &lt;vector&gt;#include &lt;unordered_map&gt;using namespace std;/*m个台阶,一次可爬a~b个台阶部分台阶损坏 坏的台阶出现在n个给定的位置有多少种登山方案 */int helper(int m,int ...

2018-10-09 08:47:39 315

原创 LeetCode 120. Triangle

动态规划 问题120. TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2],...

2018-10-08 15:39:44 156

原创 背包问题

0-1背包#include &lt;iostream&gt;#include &lt;vector&gt;using namespace std;int helper(vector&lt;vector&lt;int&gt;&gt;&amp; dp, vector&lt;int&gt;&amp; need, vector&lt;int&gt;&amp; value,int M)

2018-10-07 17:22:09 100

原创 c++ cin,cout 加速

加上以下两行 ios::sync_with_stdio(0); cin.tie(0);

2018-09-24 18:54:35 1721

原创 KMP字符串匹配算法

写在前面KMP算法典型例题输入第一行一个整数N,表示测试数据组数。接下来的N*2行,每两行表示一个测试数据。在每一个测试数据中,第一行为模式串,由不超过10^4 个大写字母组成,第二行为原串,由不超过10^6 个大写字母组成。其中N&amp;lt;=20输出对于每一个测试数据,按照它们在输入中出现的顺序输出一行Ans,表示模式串在原串中出现的次数。解法暴力解:遍历原串每一个元素逐一匹配...

2018-09-24 18:53:05 142

原创 java 当中的 hashcode

写在前面java 当中的hashcode参考浅谈Java中的hashcode方法主要内容在Java的Object类中有一个方法:public native int hashCode();这个方法是一个本地方法,也就是其他语言实现的方法。所以在Object的源码当中并不能看到这个方法的实现。hashCode方法的主要作用是为了配合基于散列的集合一起正常运行,这样的散列集合包括Hash...

2018-09-24 15:00:45 138

原创 回文子串问题之Manacher算法

先占坑

2018-09-23 00:28:41 179

原创 java不支持运算符重载

写在前面java是不支持运算符重载,在使用类的时候会出现一些使用的不舒服因为这一点不像c++一样用的那么流畅,语法上java会比较的啰嗦。理解c++的运算符重载是为了向上兼容,使得自定义的类型像基本数据类型一样拥有相同的能力。但是c++的运算符重载其实也是借助编译器的帮助将运算符的使用转化为相应的函数(全局,或者类的成员函数)。java并不支持这项特性,但是这样的功能也是可以直接使用方...

2018-09-19 19:30:10 6266

空空如也

空空如也

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

TA关注的人

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