10 2021 档案

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