enumerate() 函数字面上是枚举、列举的意思,用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。 enumerate(sequence, [start=0]) 参数 sequence -- 一个序列、迭代器或其他支持迭代 ...
分类:
编程语言 时间:
2020-05-10 01:00:52
阅读次数:
63
Headers Connection Management State Tansition Diagram Sequence Diagram Normal Simultaneous Open Simultaneous Close Half Close Normal with State Exampl ...
分类:
其他好文 时间:
2020-05-09 18:55:49
阅读次数:
61
给你 $ a $ 个 $ 0 $,$ b $ 个 $1$,$ c $ 个 $ 2 $,$ d $ 个 $ 3 $,要求排成一个长度为 $ a+b+c+d $ 的数列,相邻两个差的绝对值为 $ 1 $,并输出任一方案。 ...
分类:
其他好文 时间:
2020-05-08 22:38:01
阅读次数:
90
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s ...
分类:
其他好文 时间:
2020-05-08 18:36:48
阅读次数:
75
一 前言 本篇主讲内容为python基础模块random库的基本使用,读者熟悉基本用法即可,需要特殊要求查询官方文档即可 公众号: 知识追寻者 知识追寻者(Inheriting the spirit of open source, Spreading technology knowledge;) 二 ...
分类:
编程语言 时间:
2020-05-07 15:18:36
阅读次数:
67
使用floyd求取传递闭包,每次都进行判断 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=27; int g[N][N]; bool st[N]; int n,m; int d[N][N] ...
分类:
编程语言 时间:
2020-05-05 10:52:48
阅读次数:
62
语法 在python3中,内置函数中已经没有reduce了。要使用reduce,需要从functools模块里引入 可以看到,reduce有三个参数,第一个是函数function,第二个是序列sequence,第三个是initial,为初始值,默认为None 作用 对序列中的元素进行累积 返回值 返 ...
分类:
编程语言 时间:
2020-05-03 19:00:32
阅读次数:
114
Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any ...
分类:
其他好文 时间:
2020-05-03 14:27:36
阅读次数:
67
普通代码测试 jupyter notebook代码测试 实现方法(仅供参考) 编写时 在markdown外部包裹``或`` ...
分类:
其他好文 时间:
2020-05-03 12:18:24
阅读次数:
69