Math的常用方法 Math.sqrt() : 计算平方根 Math.cbrt() : 计算立方根 Math.pow(a, b) : 计算a的b次方 Math.max( , ) : 计算最大值 Math.min( , ) : 计算最小值 Math.abs() : 取绝对值 static double ...
分类:
其他好文 时间:
2020-04-04 18:57:56
阅读次数:
156
一、题目说明 题目208. Implement Trie (Prefix Tree),实现trie,包括insert、search、startsWith。 二、我的解答 Trie树,又叫“字典树”,“前缀树”。实现代码如下: 性能如下: 三、优化措施 ...
分类:
其他好文 时间:
2020-04-04 18:36:12
阅读次数:
65
题目如下: Implement the class UndergroundSystem that supports three methods: 1. checkIn(int id, string stationName, int t) A customer with id card equal t ...
分类:
其他好文 时间:
2020-04-04 14:27:25
阅读次数:
69
同事前两天打算重启一个EC2实例,结果手滑点到了Termination,然后EC2就悲剧了。幸好有Snapshot备份,服务器挂了15分钟之后成功的恢复了。可以看见reboot和terminate靠的十分近,所以为了避免悲剧再次发生,我们需要打开terminationprotection如果只有几台EC2,可以手动点开,如图所示但是如果很多的话,还是写脚本实现方便一些下面是PowerShell实现
分类:
系统相关 时间:
2020-04-03 19:49:20
阅读次数:
88
正则表达式 是对字符串(包括普通字符(例如,a 到 z 之间的字母)和特殊字符(称为“元字符”))操作的一种逻辑公式,就是用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。正则表达式是一种文本模式,该模式描述在搜索文本时要匹配 ...
分类:
其他好文 时间:
2020-04-02 17:39:55
阅读次数:
78
1 /** 2 * // This is the interface that allows for creating nested lists. 3 * // You should not implement it, or speculate about its implementation 4 ...
分类:
其他好文 时间:
2020-04-02 15:56:20
阅读次数:
67
import random import math import time n=pow(10,7) m=0.0 print("执行开始".center(20,'-')) for i in range(1,n+1): a='*'*i b='.'*i c=(i/n)*100 x,y=random.ran ...
分类:
其他好文 时间:
2020-03-30 21:39:23
阅读次数:
64
题目描述 Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...
分类:
其他好文 时间:
2020-03-30 12:48:40
阅读次数:
69
一、以管理员权限启动PowerShell,输入lxrun /setdefaultuser root,打开WSL,输入passwd root修改密码。 二、打开CMD或PowerShell,输入ubuntu config --default-user root,修改ubuntu系统默认用户为root, ...
a=5 b=8 c=3 m=pow(pow(b,2)-4*a*c,0.5) x=(-b+m)/2/a print("{}".format(x)) ...
分类:
其他好文 时间:
2020-03-28 23:24:07
阅读次数:
85