题目内容 Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of th ...
分类:
其他好文 时间:
2020-01-29 18:24:31
阅读次数:
58
#include<iostream> #include<algorithm> #include<cstring> #include<cmath> using namespace std; #define x first #define y second const int N=210; typede ...
分类:
其他好文 时间:
2020-01-29 17:52:38
阅读次数:
92
1、题目 14. Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, re ...
分类:
其他好文 时间:
2020-01-29 17:50:57
阅读次数:
65
# 本程序为学习代码,成功爬取了'梨视频'网站的全部视频文件,并保存在video文件夹 import os import re import requests def getHTMLText(url): try: r=requests.get(url) r.raise_for_status() r. ...
分类:
编程语言 时间:
2020-01-29 16:27:45
阅读次数:
434
S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱, ...
分类:
编程语言 时间:
2020-01-29 15:45:51
阅读次数:
70
#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=0x3f3f3f3f; int p[50]; struct edge{ int a,b,w; }e[100]; bool ...
分类:
其他好文 时间:
2020-01-29 12:11:08
阅读次数:
72
数据查询 基本查询 方法find():查询 db.集合名称.find({条件文档}) 方法findOne():查询,只返回第一个 db.集合名称.findOne({条件文档}) 方法pretty():将结果格式化 db.集合名称.find({条件文档}).pretty() 比较运算符 等于,默认是等 ...
分类:
数据库 时间:
2020-01-29 10:57:22
阅读次数:
109
一、shell脚本介绍 (一)脚本案例及介绍: !/bin/bash LOG_DIR=/var/log ROOT_UID=0 if ["$UID ne "$ROOT_UID"] then echo "must be root run this script." exit 1 fi cd $ LOG_ ...
分类:
系统相关 时间:
2020-01-29 01:14:22
阅读次数:
99
按名称查找 find . -name filename [root@vps repo]# ls README.md vps.sh[root@vps repo]# find . -iname vps*./vps.sh[root@vps repo]# find . ! -iname vps* | gre ...
分类:
系统相关 时间:
2020-01-28 23:35:05
阅读次数:
131
链接: "LeetCode653" 给定一个二叉搜索树和一个目标结果,如果 BST 中存在两个元素且它们的和等于给定的目标结果,则返回 true。 相关标签: 哈希表 类似于求两数之和,我们只需要在遍历二叉树过程中寻找是否存在有数为k 已经遍历到的数即可。 代码如下: python: C++: ...
分类:
其他好文 时间:
2020-01-28 22:58:39
阅读次数:
75