P3065 [USACO12DEC]First! G 题目大意:给你$n$个字符串,字符串的总长度不超过$300000$,问你在自定字典序的情况下有哪些字符串的字典序能够最小。 看到这道题第一想法是字典树和判环。字典树是存储字符串的方式,环则是判断矛盾的方式,考虑如何把这两个结合起来。 先看样例: ...
分类:
其他好文 时间:
2020-06-21 09:14:16
阅读次数:
45
题目描述 给定两个二叉树,编写一个函数来检验它们是否相同。 如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。 示例: 输入: 1 1 / \ / \ 2 3 2 3 [1,2,3], [1,2,3] 输出: true 输入: 1 1 / \ 2 2 [1,2], [1,null,2 ...
分类:
其他好文 时间:
2020-06-21 00:47:05
阅读次数:
64
'''装饰器前奏'''account={ "is_authenticated":False , "username":"zxz", "password":"zxz123456"}def login(func): if account['is_authenticated'] is False: use ...
分类:
其他好文 时间:
2020-06-21 00:30:45
阅读次数:
59
call,apply,bind 实现 /** * 实现 * call , * apply , * bind */ var c = { name:'huge', age:1236 } var d = { name:'huge', age:1236 } function Person(sex,hobby ...
分类:
移动开发 时间:
2020-06-20 21:52:21
阅读次数:
59
Django Form 组件用于对页面进行初始化,生成 HTML 标签,此外还可以对用户提交对数据进行校验(显示错误信息)。报错信息显示顺序:先显示字段属性中的错误信息,然后再显示局部钩子的错误信息。若显示了字段属性的错误信息,就不会显示局部钩子的错误信息。若有全局钩子,则全局钩子是等所有的数据都校... ...
分类:
其他好文 时间:
2020-06-20 21:15:48
阅读次数:
57
class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = rightclass Solution: def flatten(self, ...
分类:
其他好文 时间:
2020-06-20 21:12:01
阅读次数:
58
#include <list> #include <iostream> using namespace std; //list数据存取 void printList(const list<int>&L){ for (list<int>::const_iterator it = L.begin(); ...
分类:
其他好文 时间:
2020-06-20 19:42:41
阅读次数:
51
#include <list> #include <iostream> #include <algorithm> using namespace std; //list反转和排序 void printList(const list<int>&L){ for (list<int>::const_ite ...
分类:
编程语言 时间:
2020-06-20 19:31:03
阅读次数:
65
path = r"C:\Users\wuhao\.keras\datasets\mnist.npz" def load_data(path): with np.load(path) as f: x_train, y_train = f['x_train'], f['y_train'] x_test, ...
分类:
其他好文 时间:
2020-06-20 16:12:54
阅读次数:
89
设计一个能够获取当前栈最小值的栈 问题描述 ? 实现一个特殊的栈,在实现栈的基本功能的基础上,再实现返回栈中最小元素的操作,要求pop、push、getMin 操作的时间复杂度都是 O(1)。 解题思路 ? 使用两个栈来实现这一功能,一个普通栈stackData,一个能获取最小值的栈stackMin ...
分类:
编程语言 时间:
2020-06-20 15:53:31
阅读次数:
53