随笔分类 -  Python

摘要:Python3 heapq # 默认小根堆 Heap = [] # 初始化为空 heapq.heapify(list) # 将一个list原地转换为堆,线性时间 heapq.heappush(Heap, item) # 插入一个元素 item,类型随意 x, (x, y) 均可 Top = heap 阅读全文
posted @ 2023-01-02 08:38 ccz9729 阅读(27) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-03-22 10:22 ccz9729 阅读(19) 评论(0) 推荐(0) 编辑
摘要:a = list(map(int, input().split())) #python 读入一行 a.sort() print(a[0] ,a[1] ,a[6] - a[0] - a[1]) 阅读全文
posted @ 2022-03-17 19:08 ccz9729 阅读(59) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示
主题色彩