摘要: 前缀和(prefix sum/cumulative sum)的应用. 还用了一个知识点: a≡b(mod d) 则 a-b被d整除. 即:a与b对d同余,则a-b被d整除. 阅读全文
posted @ 2019-03-16 20:16 周洋 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 送分题 阅读全文
posted @ 2019-03-16 19:44 周洋 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 送分题 阅读全文
posted @ 2019-03-16 19:35 周洋 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Brute Force(暴力) 阅读全文
posted @ 2019-03-16 08:24 周洋 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 每次找到当前最大数,转两下把最大数转到最右边.重复这个操作,直到都转完. 时间复杂度O(n**2) class Solution(object): def pancakeSort(self, A): """ :type A: List[int] :rtype: List[int] """ maxA, 阅读全文
posted @ 2019-03-16 08:14 周洋 阅读(105) 评论(0) 推荐(0) 编辑
摘要: append: Appends object at the end. gives you: [1, 2, 3, [4, 5]] extend: Extends list by appending elements from the iterable. gives you: [1, 2, 3, 4, 阅读全文
posted @ 2019-03-16 07:10 周洋 阅读(1228) 评论(0) 推荐(0) 编辑