一、 運行快速啟動 在註冊表中註冊文件:Win+R→Regedit 在\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\App Paths中新建項,設置名稱(即快速啟動名,自設,後面必須以exe後綴名結尾),然後設置位置即可 ...
原题链接: "https://leetcode.com/problems/binary tree paths/description/" 直接走一波深度优先遍历: 不过这道题目我的实现还是写复杂了,提交区有的是简洁高效的代码。。。都怪自己基础不好啊!!! ...
分类:
其他好文 时间:
2018-04-06 14:00:24
阅读次数:
145
Description: 有F个牧场,1<=F<=5000,现在一个牧群经常需要从一个牧场迁移到另一个牧场。奶牛们已经厌烦老是走同一条路,所以有必要再新修几条路,这样它们从一个牧场迁移到另一个牧场时总是可以选择至少两条独立的路。现在F个牧场的任何两个牧场之间已经至少有一条路了,奶牛们需要至少有两条。 ...
分类:
其他好文 时间:
2018-04-06 00:15:33
阅读次数:
206
一、json模块 二、os模块 练习: 编写一个函数,遍历路径下,所有的目录和子目录 """ 编写一个函数,遍历路径下,所有的目录和子目录 """ import os def list_all_file(file_path): paths = os.listdir(file_path) for ea ...
分类:
编程语言 时间:
2018-03-31 15:11:04
阅读次数:
186
使用动态规划,思路很清晰 使用如下代码,发现超时了 这段代码遍历出了所有的路径,而题目只需要路径的数目。 使用数组记录,关键在于怎么确定边界条件 ...
分类:
其他好文 时间:
2018-03-28 22:01:14
阅读次数:
153
题目链接 Round #440 Div 1 Problem D 题意 把每个数看成一个点,如果$gcd(x, y) \neq 1$,则在$x$和$y$之间连一条长度为$1$的无向边。 设$d(u, v)$为$u$到$v$之间的最短路,如果$u$和v不连通那么$d(u, v) = 0$ 现在给定$n$ ...
分类:
其他好文 时间:
2018-03-22 01:40:59
阅读次数:
106
62. Unique Paths 题目 解析 C++ class Solution_62 { public: int uniquePaths(int m, int n) { //matrix(m n) vector vecs(m, vector(n, 1)); for (int i = 1; i v ...
分类:
其他好文 时间:
2018-03-20 11:45:53
阅读次数:
158
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum ...
分类:
其他好文 时间:
2018-03-17 15:17:18
阅读次数:
145
[抄题]: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not ...
分类:
其他好文 时间:
2018-03-15 16:24:42
阅读次数:
139
[抄题]: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: [暴力解法]: 时间分析: 空间分析 ...
分类:
其他好文 时间:
2018-03-11 14:32:22
阅读次数:
132