题意:给你一张有向图,求从1出发,回到1的欧拉回路数量。 先特判掉欧拉回路不存在时的情况。 看这个吧:http://blog.csdn.net/yuanjunlai141/article/details/76691680。 这是求有向图(以某个点为根的)生成外向树的方法。 ...
分类:
其他好文 时间:
2017-10-06 10:28:38
阅读次数:
126
转载自http://www.cnblogs.com/wangshide/archive/2012/04/30/2477131.html ...
分类:
其他好文 时间:
2017-10-05 21:23:10
阅读次数:
140
1 package cn.bjsxt.array2; 2 /** 3 * 4 * 矩阵加法 5 * 乘法 6 * @author Administrator 7 * 8 */ 9 public class Matrix { 10 public static void print(int[][] c)... ...
分类:
编程语言 时间:
2017-10-04 18:31:24
阅读次数:
260
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: You s ...
分类:
其他好文 时间:
2017-10-02 17:50:20
阅读次数:
152
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma ...
分类:
其他好文 时间:
2017-10-01 21:09:40
阅读次数:
107
题目大意:求斐波那契数列第n项。第一项和第二项为1。 解题思路:矩阵快速幂模板题。 公式: $$\begin{bmatrix} F[n] \\F[n-1] \end{bmatrix} \quad =\begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} ^n \qu ...
分类:
其他好文 时间:
2017-09-29 22:56:08
阅读次数:
124
class Solution { public int maximalRectangle(char[][] matrix) { if(matrix.length==0||matrix[0].length==0) return 0; int[] heights=new int[matrix[0].le... ...
分类:
其他好文 时间:
2017-09-28 10:02:40
阅读次数:
121
#include <iostream>#include <cstdio> using namespace std; void traceBack(int i, int j, int **s){ if(i==j) //the function is used to record the optimal ...
分类:
其他好文 时间:
2017-09-27 21:50:26
阅读次数:
168
1.什么是numpy NumPy系统是Python的一种开源的数值计算扩展。这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structure)结构要高效的多(该结构也可以用来表示矩阵(matrix))。 包括: 1、一个强大的N维数组对象Array; 2、比 ...
分类:
其他好文 时间:
2017-09-27 19:04:01
阅读次数:
382