10 2021 档案
摘要:class Singleton{ //volatile关键字禁止指令重排 private volatile static Singleton instance; private Singleton(){} public Singleton getInstance(){ if(instance==nu
阅读全文
摘要:import sys print(sys.executable)
阅读全文
摘要:https://www.cnblogs.com/miaosha5s/p/8987344.html
阅读全文
摘要:Python自带有排序容器SortedList, SortedDict, SortedSet 下面以SortedSet为例,leetcode414 from sortedcontainers import SortedSet class Solution: def thirdMax(self, nu
阅读全文
摘要:heapq只有小顶堆,大顶需要自己取相反数操作... leetcode414 from heapq import * class Solution: def thirdMax(self, nums: List[int]) -> int: if len(nums)==1: return nums[0]
阅读全文
摘要:实例方法的第一个参数self是类的实例,调用这种方法需要先实例对象再调用函数 如果定义时不写第一个参数就成了类方法,可以直接“类名.函数名”调用 不是类里的函数不需要self 参考:https://www.cnblogs.com/jins-note/p/9581568.html
阅读全文

浙公网安备 33010602011771号