随笔分类 - # 语言
摘要:Python数据结构 文章目录 Python数据结构字符串列表集合元组双端队列优先队列小顶堆字典字典计数器有序字典 字符串 字符串方法 字符串操作 列表 集合 元组 双端队列 优先队列 小顶堆 字典 字典计数器 有序字典 var code = "34b60421-2fc1-4e09-9505-f02
阅读全文
摘要:Python内置函数——竞赛向 文章目录 Python内置函数——竞赛向进制转换 c l a s s i n t ( x , b a s e = 10 ) class\ int(x, base=10) class int(x,base=10) b i n ( x ) bin(x) bin(x) o
阅读全文
摘要:Python——math模块 文章目录 Python——math模块数论与表示函数 m a t h . f a c t o r i a l ( n ) math.factorial(n) math.factorial(n) m a t h . f l o o r ( x ) math.floor(x
阅读全文
摘要:文章目录 Itertool函数组合函数排列函数总结 Itertool函数 下列模块函数均创建并返回迭代器。 排列组合迭代器 迭代器实参结果permutations()p[, r]长度r元组,所有可能的排列,无重复元素combinations()p, r长度r元组,有序,无重复元素combinatio
阅读全文
摘要:datetime—基本日期和时间类型 文章目录 datetime 基本日期和时间类型概述timedelta 类对象date 对象time 对象datetime 对象 概述 c l a s s d a t e t i m e . d a t e class datetime.date classdat
阅读全文
摘要:文章目录 Python特性输入输出 算法方面快排:分治调整区间的两种方法 归并排序 :分治高精度(大乌龙)前缀和与差分前缀和差分 双指针离散化与合并区间离散化合并区间 DFS && BFSDFS:BFS : 一些小技巧 Python特性 输入输出 输入 单值输入input()、int(input()
阅读全文
摘要:基本操作 输入输出print()自动换行 # 循环读取到文件末尾 try: while True: s = input() except: pass # 读取n,m n, m = map(int,input().split()) # 读取一个数或者一个列表 a = list(map(int,inpu
阅读全文
摘要:今天遇到了的问题 Missing parentheses in call to ‘print‘ Python2和Python3不兼容原因Python3只能用print(....) str不是迭代器,不能直接用for循环,最佳处理办法是遍历索引 输入 输入单个值 int(input()) 确定个数的值
阅读全文