随笔分类 - Python
摘要:Python3 heapq # 默认小根堆 Heap = [] # 初始化为空 heapq.heapify(list) # 将一个list原地转换为堆,线性时间 heapq.heappush(Heap, item) # 插入一个元素 item,类型随意 x, (x, y) 均可 Top = heap
阅读全文
摘要:n = int(input()) a = [list(map(int, input().split())) for _ in range(n)] # 二维数组.jpg ans = 0 for x1, y1 in a : for x2, y2 in a: for x3, y3 in a: if x1
阅读全文
摘要:a = list(map(int, input().split())) #python 读入一行 a.sort() print(a[0] ,a[1] ,a[6] - a[0] - a[1])
阅读全文