很不错的期望题 先设i号节点到达n号节点的期望步数为E[i] 由于每次选择的都是最优策略 所以得到一个性质:若在某一时刻i号节点到j号、k号节点的道路都存在时,一定选择E数组较小的那个 由此可以得到一个小柿子: $E[i]=\sum\limits_{E[j]<E[i]} E[j]*p(i,j) * ...
分类:
其他好文 时间:
2021-01-07 11:54:16
阅读次数:
0
NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。 数据分析三剑客:Numpy,Pandas,Matplotlib 一、创建ndarray 1.使用np.array()创建 一维数组创建 im ...
分类:
其他好文 时间:
2021-01-07 11:53:57
阅读次数:
0
1、 #include <stdio.h> int main(void) { int a,b; puts("please input two integers."); printf("a = "), scanf("%d", &a); printf("b = "), scanf("%d", &b); ...
分类:
编程语言 时间:
2021-01-07 11:48:01
阅读次数:
0
最小不相交路径覆盖:使用最小条数的路径,覆盖每个点恰好1次。 最小可相交路径覆盖:使用最小条数的路径,每个点可以覆盖多次。 最小可相交路径覆盖做一次Floyd传递闭包变成最小不相交路径覆盖。 最小不相交路径覆盖使用二分图匹配:把每个点x拆成x1(出度)和x2(入度),初始状态没有匹配,使用的路径数量 ...
分类:
其他好文 时间:
2021-01-06 12:12:01
阅读次数:
0
175. 组合两个表 地址:https://leetcode-cn.com/problems/combine-two-tables/ //表1: Person // + + + //| 列名 | 类型 | //+ + + //| PersonId | int | //| FirstName | va ...
分类:
其他好文 时间:
2021-01-06 12:09:24
阅读次数:
0
Find a Corresponding Node of a Binary Tree in a Clone of That Tree (M) 题目 Given two binary trees original and cloned and given a reference to a node t ...
分类:
其他好文 时间:
2021-01-06 11:39:40
阅读次数:
0
""" 输入字符串,判断只包含数字、a-z、A-Z、+-的数字串,进行+-,算出最小和 """ import re def sum_s(s): sum = 0 if re.match('^[0-9a-zA-Z+-]+$',s):#判断只包含数字、a-z、A-Z、+-的数字串 list1 = re.f ...
分类:
编程语言 时间:
2021-01-05 11:35:21
阅读次数:
0
求满足
* $\forall i \in [0,n-1],a[i] \in [1,10]$
* $\exist \space 0\leq x < y < z < w <= n,\sum_\limits{i=x}^{y-1}=X,\sum_\limits{i=y}^{z-1}=Y,\sum_\limi... ...
分类:
其他好文 时间:
2021-01-05 11:21:55
阅读次数:
0
使用方式 KafkaProducer 发送消息主要有以下 3 种方式: Properties properties = new Properties(); properties.setProperty("bootstrap.servers", "localhost:9092"); propertie ...
分类:
其他好文 时间:
2021-01-05 10:45:01
阅读次数:
0
这题首先我们可以推出递推式: 我们先把加数个数大于等于 \(2\) 的限制去掉,最后再减回去即可。 \[ f_0=1 \] \[ f_n=\sum\limits_{i=1}^{n} j \cdot f_{i-j} \] 暴力代码: #include<bits/stdc++.h> using name ...
分类:
其他好文 时间:
2021-01-05 10:41:20
阅读次数:
0